#C13775. Prime Number Extractor
Prime Number Extractor
Prime Number Extractor
You are given a sequence of tokens in a single line of input. Each token may represent an integer or other data. Your task is to extract all prime numbers from the tokens. A prime number is defined as an integer \(n\) such that \(n > 1\) and its only divisors are 1 and itself.
Ignore tokens that do not represent an integer. The order of the prime numbers in the output should be the same as their order in the input.
Definition: A number \(p\) is prime if and only if \(p > 1\) and for all integers \(a\) and \(b\), if \(p = a \times b\) then either \(a = 1\) or \(b = 1\).
inputFormat
The input is a single line of space-separated tokens. Each token could be an integer or a non-integer value.
outputFormat
Output a single line containing the prime numbers extracted from the input, in the order they appear, separated by a single space. If no prime numbers are found, output an empty line.
## sample11 22 foo 3 4.5 5
11 3 5