DWITE Online Computer Programming Contest
December 2007
Problem 1
Yet Another Primes Question

Tony is busy writing his university exams, and thus lacks creativity. So he's making you write what you've already done in the last DWITE round, but differently. Instead of semiprimes, this time you're interested in numbers with 3 unique prime factors.

The input file DATA1.txt will contain five integers, one per line. 1 <= N <= 1000.

The output file OUT1.txt will contain five lines, stating if the supplied integers were "valid" or "not". Use the exact string output, all lower case, without quotes.

Note: You're looking for unique factors. For example, 12 has three prime factors: 2, 2, 3. But it's only two unique numbers: 2 and 3. Thus 12 is not what is asked for.

Sample Input:
10
12
15
30
105
        
Sample Output:
not
not
not
valid
valid