Sample challenge

Write a program which will decide which of these numbers are prime.

Note: The solution will be tested on two datasets. The first dataset consists of small numbers and tests the correctness of the solution. The second dataset consists of larger numbers and acceptance depends on the memory efficiency of the solution.

Input

You are given a sequence of positive integer numbers as input, one in each line.

Output

For each of the numbers at input, you should write a line containing 1 if it is prime and 0 if it is composite.

Example
input
1
2
17

output
0
1
1

Sample solutions


function foo(items) { var x = "All this is syntax highlighted"; return x; }