using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
public class Solution {
static void Main(String[] args) {
int t = Convert.ToInt32(Console.ReadLine());
for(int a0 = 0; a0 < t; a0++){
int n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(SmallestNumber(n));
}
}
static int SmallestNumber(int n)
{
var m=1;
while(true)
{
if(Divisible(n,m))
return m;
m++;
}
}
static bool Divisible(int n,int m)
{
for(int i=1; i<=n;i++)
{
if(m%i!=0)
{
return false;
}
}
return true;
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLklPOwp1c2luZyBTeXN0ZW0uTGlucTsKcHVibGljIGNsYXNzIFNvbHV0aW9uIHsKCiAgICBzdGF0aWMgdm9pZCBNYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBpbnQgdCA9IENvbnZlcnQuVG9JbnQzMihDb25zb2xlLlJlYWRMaW5lKCkpOwogICAgICAgIGZvcihpbnQgYTAgPSAwOyBhMCA8IHQ7IGEwKyspewogICAgICAgICAgICBpbnQgbiA9IENvbnZlcnQuVG9JbnQzMihDb25zb2xlLlJlYWRMaW5lKCkpOwogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZShTbWFsbGVzdE51bWJlcihuKSk7CiAgICAgICAgfQogICAgfQogICAgc3RhdGljIGludCBTbWFsbGVzdE51bWJlcihpbnQgbikKICAgIHsKICAgICAgICB2YXIgbT0xOwogICAgICAgIHdoaWxlKHRydWUpCiAgICAgICAgewogICAgICAgICAgICBpZihEaXZpc2libGUobixtKSkKICAgICAgICAgICAgICAgIHJldHVybiBtOwogICAgICAgICAgICAKICAgICAgICAgICAgbSsrOwogICAgICAgIH0KICAgIH0KICAgIHN0YXRpYyBib29sIERpdmlzaWJsZShpbnQgbixpbnQgbSkKICAgIHsKICAgICAgICBmb3IoaW50IGk9MTsgaTw9bjtpKyspCiAgICAgICAgewogICAgICAgICAgICBpZihtJWkhPTApCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KfQ==