Prime Elements


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

Print every prime element of an integer array, preserving its input order.

Input

The first line contains \(n\). The second line contains \(n\) integers.

The input satisfies:

  • \(0 <= n <= 10^5\)

Output

Print the prime elements in input order, separated by spaces. Print an empty line if none exist.

Example

Input
5
6 10 5 2 3
Output
5 2 3

Comments

There are no comments at the moment.