#include <fstream>
#include <cmath>
#include <iomanip>
using namespace std;
int ntcn(long long n1, long long n2) 
{ 
if (n1>n2)
{
for (int i=2;i<n2;i++)
if (n1%i==0&n2%i==0)
return 0;
else
return 1;
}
if (n1<n2) 
for (int i=2;i<n1;i++)
if (n1%i==0&n2%i==0)
return 0;
else
return 1;
}
int main()
{
      ifstream f("dayso.inp");
      ofstream g1("NTCN.out");
      ofstream g2("DOINP.out");
      ofstream g3("SOHH.out");
      long long n,a[999999];
      f>>n;
      for (int i=1;i<=n;i++)
      {f>>a[i];}
      for (int j=1;j<=n;j++)
      for (int k=1;k<=n+1;k++)
      if (ntcn(a[j],a[k]==1))
      g1<<a[j]<<' '<<a[k];
      f.close();
      g1.close();
      g2.close();
      g3.close();
}
 

