#C9128. Prime Numbers Filter

    ID: 53187 Type: Default 1000ms 256MiB

Prime Numbers Filter

Prime Numbers Filter

This problem requires you to read a list of integers from standard input and output only the prime numbers in the list.

A prime number is defined as an integer \( n \) greater than 1 that has no positive divisors other than 1 and itself. In other words, a number \( n \) is prime if it satisfies:

\[ n > 1 \quad \text{and} \quad \forall d \in \mathbb{Z}, \; 1 < d < n, \; d \nmid n. \]

Your task is to implement a solution that reads numbers from standard input, filters out the ones that are prime, and prints them in the order they appeared. If no prime numbers are present, the output should be empty.

inputFormat

The input is read from standard input. It consists of a single line containing space-separated integers.

outputFormat

The output should be a single line containing the prime numbers from the input in their original order, separated by a single space. If there are no prime numbers, print an empty line.

## sample
2 3 4 15 17 19 23
2 3 17 19 23