#K39767. Filter Prime Numbers

    ID: 26494 Type: Default 1000ms 256MiB

Filter Prime Numbers

Filter Prime Numbers

You are given a list of integers. Your task is to filter out all the prime numbers from this list.

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In other words, a number \(n\) is prime if \(n > 1\) and for every integer \(d\) with \(2 \leq d \leq \sqrt{n}\), \(d\) does not divide \(n\) evenly.

If there are no prime numbers in the list, simply output an empty line.

inputFormat

The input consists of a single line containing space-separated integers. For example: 10 15 3 7 18 19.

outputFormat

Output a single line containing the prime numbers from the input list in the order they appear, separated by a single space. If there are no prime numbers, output an empty line.

## sample
10 15 3 7 18 19
3 7 19

</p>