#C13949. Prime Number Extraction

    ID: 43543 Type: Default 1000ms 256MiB

Prime Number Extraction

Prime Number Extraction

Given a list of integers, extract all the prime numbers and output them in the same order as they appear in the input. A prime number is defined as an integer \(n\) such that \(n > 1\) and for every divisor \(d\) (with \(1 < d < n\)), \(d\) does not divide \(n\) evenly. For example, the number 2 is prime, but 4 is not because it is divisible by 2.

Your program should read the input from standard input and write the output to standard output.

inputFormat

The first line of input contains an integer \(N\) representing the number of integers. The second line contains \(N\) space-separated integers.

outputFormat

Output all the prime numbers extracted from the list in a single line, separated by a single space. If there are no prime numbers, output an empty line.

## sample
5
2 3 5 7 11
2 3 5 7 11