#K92307. Filter Prime Numbers

    ID: 38168 Type: Default 1000ms 256MiB

Filter Prime Numbers

Filter Prime Numbers

Given a list of integers, your task is to filter out and print all the prime numbers from the list. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. If no prime numbers exist in the input list, output an empty line.

You should implement the solution by reading input from standard input (stdin) and writing the result to standard output (stdout). The numbers will be provided in a single line, separated by spaces.

In mathematical notation, a number \(p\) is prime if \(p > 1\) and \(\forall d \in \mathbb{N},\, (d \mid p \Rightarrow d = 1 \text{ or } d = p)\).

inputFormat

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

outputFormat

Print the list of prime numbers extracted from the input, separated by a single space. If there are no prime numbers, print an empty line.

## sample
10 15 3 7 9 11
3 7 11