Problem

19 /21


Choose simple

Problem

Given an array of numbers. It is necessary to write to another array all the prime numbers of the original array. If there are no prime numbers in the original array, the program should print the number 0.

Input
The first line contains the size of the N array. The second line contains space-separated N numbers – array elements. It is guaranteed that 0 < N ≤ 10000.

Imprint
The program should display all the elements of the new array in one line, separating them with spaces. If there were no suitable elements in the array, the program should print the number 0.
 
Examples
# Input Output
1 6
1 2 3 4 5 6
2 3 5