#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;

int main()
{
  int N;scanf("%d",&N);
  int A[N];
  for(int i=0;i<N;i++)scanf("%d",&A[i]);
  bool check[1000001];fill(check,check+1000001,false);
  int num=A[N-1],lastnum=0;bool works=true;
  for(int i=2;i<=A[N-1];i++)while(num%i==0){check[i]=true;num/=i;}
  for(int i=N-2;i>-1;i--)
  {
    num=A[i];
    for(int j=2;j<=A[i];j++)
    {
      while(num%j==0)
      {
        if(lastnum!=j&&check[j])works=false;
        check[j]=true;num/=j;
        lastnum=j;
      }
    }
  }
  if(works){printf("pairwise coprime");return 0;}
  int g=A[0];
  for(int i=1;i<N;i++)g=gcd(g,A[i]);
  if(g==1)printf("setwise coprime");
  else printf("not coprime");
}