#nt802. 原根

原根

Primitive Root

Problem Description

Answer TT queries; each query gives a prime pp, and you must output its smallest primitive root gg.

Input Format

The first line contains an integer TT. The following TT lines each contain one integer pp.

Output Format

Output one integer: the smallest primitive root.

Sample Input

3
2
178187
998244353

Sample Output

1
2
3

Constraints

For all data, T≤100T \leq 100, 2≤p≤1092 \leq p \leq 10^9, and pp is prime.