1148: 质数筛查-1

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:305 Solved:105

Description

输入n个正整数,输出这n个数中,倒着输出所有的质数,如果没有质数,输出-1。

Input

第一行为整数n,
第二行为n个整数,每个整数x以空格隔开。

Output

倒着输出所有的质数,一行一个质数。

Sample Input Copy

6
3 2 8 10 6 7

Sample Output Copy

7
2
3

HINT

4 ≤ n ≤ 100,1 ≤ x ≤ 10000

Source/Category