~/algor $ cat problems/sonlar-eng-kichik-tub-boluvchi
Smallest prime divisor
Easy
1000 ms
128 MB
31%
You are given $q$ positive integers. For each of them find its smallest prime divisor. For example, the smallest prime divisor of $35$ is $5$, and the prime $7$ is its own smallest prime divisor.
Input
The first line contains a positive integer $q$. The second line contains $q$ positive integers $n_{i}$ separated by spaces.
Output
One line with $q$ numbers separated by spaces — the smallest prime divisor of each.
Note
$1 \le q \le 10^{5}$
$2 \le n_{i} \le 10^{6}$
Examples
Input #1
5 12 7 35 49 2
Output #1
2 7 5 7 2
Input #2
1 1000000
Output #2
2