P23454 [AtCoder] [ARC032A] Holidog
入门
题目描述

Problem Description

Holidog, a very intelligent dog, can perform addition and prime number checking. When asked whether a certain positive integer is a prime number, Holidog will bark WANWAN if it is a prime number, and BOWWOW otherwise.

You asked Holidog whether the sum from 1 to $n$, i.e., $1 + 2 + 3 + ... + n$, is a prime number. Write a program that outputs how Holidog barked.

A prime number is a positive integer greater than $1$ that has no positive divisors other than $1$ and itself. For example, $2$, $3$, and $17$ are prime numbers. $1$ and $10$ are not prime numbers.

Input Format

The input is given from the standard input in the following format:

$ n $

  • The first line contains a single integer $n\ (1\ ≦\ n\ ≦\ 1000)$.

Output Format

Output a single line containing WANWAN if $1 + 2 + 3 + ... + n$ is a prime number, and BOWWOW otherwise.

Do not forget the newline at the end.

Sample Input and Output

Sample Input #1

2

Sample Output #1

WANWAN

Sample Input #2

5

Sample Output #2

BOWWOW

Sample Input #3

1

Sample Output #3

BOWWOW

Sample Input #4

999

Sample Output #4

BOWWOW

Notes/Hints

Sample Explanation 1

$1 + 2 = 3$, and $3$ is a prime number, so output WANWAN.

Sample Explanation 2

$1 + 2 + 3 + 4 + 5 = 15$, and $15 = 3 \times 5$, so output BOWWOW.

Sample Explanation 3

$1$ is not a prime number.

Sample Explanation 4

$1 + 2 + ... + 999$ is not a prime number.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2
样例输出
WANWAN