#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int count = 0;
int arr[1000] = { 0 };
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
for (int i = 0; i < n; i++)
{
if (arr[i] == 2 || arr[i]==1)
{
cout << "true" << endl;
}
for (int j = 2; j < arr[i]; j++)
{
if (arr[i] % j == 0)
{
cout << "false"<<endl;
break;
}
else
{
count++;
}
}
if (count < arr[i] - 2)
{
count = 0;
}
if ((arr[i] != 2) && (count == (arr[i] - 2)))
{
count = 0;
cout << "true" << endl;
}
}
return 0;
}
using namespace std;
int main()
{
int n;
cin >> n;
int count = 0;
int arr[1000] = { 0 };
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
for (int i = 0; i < n; i++)
{
if (arr[i] == 2 || arr[i]==1)
{
cout << "true" << endl;
}
for (int j = 2; j < arr[i]; j++)
{
if (arr[i] % j == 0)
{
cout << "false"<<endl;
break;
}
else
{
count++;
}
}
if (count < arr[i] - 2)
{
count = 0;
}
if ((arr[i] != 2) && (count == (arr[i] - 2)))
{
count = 0;
cout << "true" << endl;
}
}
return 0;
}