Prime Elements
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