TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Arithmancy is Draco Malfoy's favorite subject, but what spoils it for him is that Hermione Granger is in his class, and she is better than him at it. Prime numbers are of mystical importance in Arithmancy, and Lucky Numbers even more so. Lucky Numbers are those positive integers that have at least three distinct prime factors; 30 and 42 are the first two. Malfoy's teacher has given them a positive integer n, and has asked them to find the nth lucky number. Malfoy would like to beat Hermione at this exercise, so although he is an evil git, please help him, just this once. After all, the know-it-all Hermione does need a lesson.

Input Format

The first line contains the number of test cases T. Each of the next T lines contains one integer n.

Output Format

Output T lines, containing the corresponding lucky number for that test case.



Constraint


1 <= T <= 1000

1 <= n <= 1000

Sample Input 1

2
1
2

Sample Output 1

30
42

Hints

Problem Source

Migrated from old NTUJ.

Regional Amritapuri 2011

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 2000 32768 200