stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

#define rep(i,n) for (ll i=0; i<n; ++i)

#define all(c) begin(c),end(c)

template<typename T1, typename T2>

bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}

template<typename T1, typename T2>

bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}

/*

全部の数の約数とりたい





各桁毎の素数の数一覧

範囲	0の数	素数の個数

10まで	10^1	1	4

100まで	10^2	2	25

1000まで	10^3	3	168

1万まで	10^4	4	1229

10万まで	10^5	5	9592

100万まで	10^6	6	78498

1000*10^6まで

*/

int main(){

  cin.tie(0);

  ios::sync_with_stdio(0);

  

  ll N; cin>>N;

  vector<ll> A(N,0), B(1000010, 0);

  ll ans = 2;

  rep(k,N){

    ll a;

    cin >> a;

    for(ll i=2; i*i<=a; i++){

      if (a%i == 0){

        if (B[i]>0)

          ans = 1;

        B[i]++;

        while (a%i == 0)

          a /= i;

      }

    }

    if (a>1){

      if (B[a] > 0)

        ans = 1;

      B[a]++;

    }

  }

  if (ans == 2){

    cout << "pairwise coprime" <<endl;

    return 0;

  }

  for(ll i=2; i<=1000000; i++){

    if (B[i] == N){

      cout << "not coprime" <<endl;

      return 0;

    }

  }

  cout << "setwise coprime" << endl;

}


// Faster C++ solution for the same problem (measured speedup: 9.919689209865608x):
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

#define rep(i,n) for (int i=0; i<n; ++i)

#define all(c) begin(c),end(c)

template<typename T1, typename T2>

bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}

template<typename T1, typename T2>

bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}

/*

全部の数の約数とりたい





各桁毎の素数の数一覧

範囲	0の数	素数の個数

10まで	10^1	1	4

100まで	10^2	2	25

1000まで	10^3	3	168

1万まで	10^4	4	1229

10万まで	10^5	5	9592

100万まで	10^6	6	78498

1000*10^6まで

*/

int main(){

  cin.tie(0);

  ios::sync_with_stdio(0);

  

  int N; cin>>N;

  vector<int> A(N,0);

  rep(i,N) cin>>A[i];

  int ans = 2;

  map<int,int> MP;

  rep(k,N){

    int a = A[k];

    for(int i=2; i*i<=a; i++){

      if (a%i == 0){

        if (MP[i]>0)

          ans = 1;

        MP[i]++;

        while (a%i == 0)

          a /= i;

      }

    }

    if (a>1){

      if (MP[a] > 0)

        ans = 1;

      MP[a]++;

    }

  }

  if (ans == 2){

    cout << "pairwise coprime" <<endl;

    return 0;

  }

  for(auto v: MP){

    if (v.second == N){

      cout << "not coprime" <<endl;

      return 0;

    }

  }

  cout << "setwise coprime" << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

#define rep(i,n) for (ll i=0; i<n; ++i)

#define all(c) begin(c),end(c)

template<typename T1, typename T2>

bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}

template<typename T1, typename T2>

bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}

/*

全部の数の約数とりたい





各桁毎の素数の数一覧

範囲	0の数	素数の個数

10まで	10^1	1	4

100まで	10^2	2	25

1000まで	10^3	3	168

1万まで	10^4	4	1229

10万まで	10^5	5	9592

100万まで	10^6	6	78498

1000*10^6まで

*/

int main(){

  cin.tie(0);

  ios::sync_with_stdio(0);

  

  ll N; cin>>N;

  vector<ll> A(N,0), B(1000010, 0);

  ll ans = 2;

  rep(k,N){

    ll a;

    cin >> a;

    for(ll i=2; i*i<=a; i++){

      if (a%i == 0){

        if (B[i]>0)

          ans = 1;

        B[i]++;

        while (a%i == 0)

          a /= i;

      }

    }

    if (a>1){

      if (B[a] > 0)

        ans = 1;

      B[a]++;

    }

  }

  if (ans == 2){

    cout << "pairwise coprime" <<endl;

    return 0;

  }

  for(ll i=2; i<=1000000; i++){

    if (B[i] == N){

      cout << "not coprime" <<endl;

      return 0;

    }

  }

  cout << "setwise coprime" << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.7514959815117639x):
#include <bits/stdc++.h>

using namespace std;

using ll=long long;

#define rep(i,n) for (int i=0; i<n; ++i)

#define all(c) begin(c),end(c)

template<typename T1, typename T2>

bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}

template<typename T1, typename T2>

bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}

/*

全部の数の約数とりたい





各桁毎の素数の数一覧

範囲	0の数	素数の個数

10まで	10^1	1	4

100まで	10^2	2	25

1000まで	10^3	3	168

1万まで	10^4	4	1229

10万まで	10^5	5	9592

100万まで	10^6	6	78498

1000*10^6まで



1000までの素数とってそれで探索。

*/

vector<int> prime(0, 0);



void eratos(int n){

  vector<bool> N(n+10,true);

  N[0] = false;

  N[1] = false;

  for(int i=2; i<=n; i++){

    if (N[i])

      prime.push_back(i);

    int j=2;

    while (i*j <= n)

      N[i*j++] = false;

  }

}



int main(){

  cin.tie(0);

  ios::sync_with_stdio(0);

  eratos(1100);//nまでの素数を抽出

  

  int N; cin>>N;

  vector<int> A(N,0), B(1000010, 0);

  int ans = 2;

  rep(k,N){

    int a;

    cin >> a;

    for(int i=0; prime[i]*prime[i] <= a; i++){

      int p = prime[i];

      if (a%p == 0){

        if (B[p] > 0)

          ans = 1;

        B[p]++;

        while (a%p == 0)

          a /= p;

      }

    }

    if (a > 1){

      if (B[a] > 0)

        ans = 1;

      B[a]++;

    }

  }

  if (ans == 2){

    cout << "pairwise coprime" <<endl;

    return 0;

  }

  for(int i=2; i<=1000000; i++){

    if (B[i] == N){

      cout << "not coprime" <<endl;

      return 0;

    }

  }

  cout << "setwise coprime" << endl;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, N) for(int i = 0; i < (int)N; i++)

using ll = long long;

using namespace std;

typedef vector<int> vi;



int main() {

    int n;

    cin >> n;

    vi a(n);

    rep(i,n) scanf("%d", &a[i]);



    int ggg = a[0];

    rep(i,n-1) ggg = __gcd(ggg, a[i+1]);

    if(ggg != 1){

        puts("not coprime");

        return 0;

    }



    //エラトステネスの篩

    const int P_MAX = 1000005;

    int pmn[P_MAX];     //smallest prime number that can divide i(pmn[i] == i -> i is prime number)

    for(int i = 1; i < P_MAX; i++)

        if(i%2 == 0) pmn[i] = 2;

        else pmn[i] = i;

    for(int i = 3; i*i < P_MAX; i += 2){

        if(pmn[i] == i){

            for(int j = 3*i; j < P_MAX; j += 2*i)

                if(pmn[j] == j) pmn[j] = i; 

        }

    }



    int cnt[P_MAX] = {0};

    rep(i,n){

        while(a[i] != 1){

            int apmn = pmn[a[i]];

            if(cnt[apmn]){

                puts("setwise coprime");

                return 0;

            }

            cnt[apmn]++;

            while(a[i]%apmn == 0) a[i] /= apmn;

        }

    }

    puts("pairwise coprime");

}


// Faster C++ solution for the same problem (measured speedup: 1.1934977639370061x):
#include <bits/stdc++.h>

#define rep(i, N) for(int i = 0; i < (int)N; i++)

using ll = long long;

using namespace std;

typedef vector<int> vi;



int a[1010101];

int main() {

    int n;

    cin >> n;

    rep(i,n) scanf("%d", &a[i]);



    int ggg = a[0];

    rep(i,n-1) ggg = __gcd(ggg, a[i+1]);

    if(ggg != 1){

        puts("not coprime");

        return 0;

    }



    //エラトステネスの篩

    const int P_MAX = 1000005;

    vi pmn(P_MAX);     //smallest prime number that can divide i(pmn[i] == i -> i is prime number)

    for(int i = 1; i < P_MAX; i++)

        if(i%2 == 0) pmn[i] = 2;

        else pmn[i] = i;

    for(int i = 3; i*i < P_MAX; i += 2){

        if(pmn[i] == i){

            for(int j = 3*i; j < P_MAX; j += 2*i)

                if(pmn[j] == j) pmn[j] = i; 

        }

    }



    vi cnt(P_MAX,0);

    rep(i,n){

        while(a[i] != 1){

            int apmn = pmn[a[i]];

            if(cnt[apmn]){

                puts("setwise coprime");

                return 0;

            }

            cnt[apmn]++;

            while(a[i]%apmn == 0) a[i] /= apmn;

        }

    }

    puts("pairwise coprime");

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, N) for(int i = 0; i < (int)N; i++)

using ll = long long;

using namespace std;

typedef vector<int> vi;



int main() {

    int n;

    cin >> n;

    vi a(n);

    rep(i,n) scanf("%d", &a[i]);



    int ggg = a[0];

    rep(i,n-1) ggg = __gcd(ggg, a[i+1]);

    if(ggg != 1){

        puts("not coprime");

        return 0;

    }



    //エラトステネスの篩

    const int P_MAX = 1000005;

    int pmn[P_MAX];     //smallest prime number that can divide i(pmn[i] == i -> i is prime number)

    for(int i = 1; i < P_MAX; i++)

        if(i%2 == 0) pmn[i] = 2;

        else pmn[i] = i;

    for(int i = 3; i*i < P_MAX; i += 2){

        if(pmn[i] == i){

            for(int j = 3*i; j < P_MAX; j += 2*i)

                if(pmn[j] == j) pmn[j] = i; 

        }

    }



    int cnt[P_MAX] = {0};

    rep(i,n){

        while(a[i] != 1){

            int apmn = pmn[a[i]];

            if(cnt[apmn]){

                puts("setwise coprime");

                return 0;

            }

            cnt[apmn]++;

            while(a[i]%apmn == 0) a[i] /= apmn;

        }

    }

    puts("pairwise coprime");

}


// Faster C++ solution for the same problem (measured speedup: 1.1909324579743397x):
#include <bits/stdc++.h>

#define rep(i, N) for(int i = 0; i < (int)N; i++)

using ll = long long;

using namespace std;

typedef vector<int> vi;



int main() {

    int n;

    cin >> n;

    vi a(n);

    rep(i,n) scanf("%d", &a[i]);



    int ggg = a[0];

    rep(i,n-1) ggg = __gcd(ggg, a[i+1]);

    if(ggg != 1){

        puts("not coprime");

        return 0;

    }



    //エラトステネスの篩

    const int P_MAX = 1000005;

    vi pmn(P_MAX);     //smallest prime number that can divide i(pmn[i] == i -> i is prime number)

    for(int i = 1; i < P_MAX; i++)

        if(i%2 == 0) pmn[i] = 2;

        else pmn[i] = i;

    for(int i = 3; i*i < P_MAX; i += 2){

        if(pmn[i] == i){

            for(int j = i*i; j < P_MAX; j += 2*i)

                if(pmn[j] == j) pmn[j] = i; 

        }

    }



    vi cnt(P_MAX,0);

    rep(i,n){

        while(a[i] != 1){

            int apmn = pmn[a[i]];

            if(cnt[apmn]){

                puts("setwise coprime");

                return 0;

            }

            cnt[apmn]++;

            while(a[i]%apmn == 0) a[i] /= apmn;

        }

    }

    puts("pairwise coprime");

}
// Slower C++ solution:
#include <stdio.h>



#include <algorithm>

#include <cmath>

#include <cstring>

#include <iostream>

#include <map>

#include <queue>

#include <set>

#include <string>

#include <vector>

using namespace std;

typedef long long ll;

const ll maxn = 1e6 + 111;

const ll mod = 1e9 + 7;

int a[maxn];

int m = 0, p[maxn];

void divide(int n) {

    for (int i = 2; i * i <= n; ++i) {

        if (n % i == 0) {

            int cnt = 0;

            while (n % i == 0) n /= i, ++cnt;

            p[i]++;

        }

    }

    if (n > 1) p[n]++;

}

int main() {

    int n;

    scanf("%d", &n);

    int num = 0;

    for (int i = 1; i <= n; ++i) {

        scanf("%d", a + i);

        divide(a[i]);

    }

    int tot = 0;

    int tot2 = 0;

    int flag1 = 0;

    for (int i = 1; i <= 1000000; ++i) {

        if (p[i] == 0) continue;

        if (p[i] != 1) flag1 = 1;

        if (p[i] == n) ++tot2;

    }

    if (!flag1) {

        puts("pairwise coprime");

    } else if (tot2 == 0) {

        puts("setwise coprime");

    } else {

        puts("not coprime");

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.772362449849351x):
#include <bits/stdc++.h>

#define ll long long

#define fr(i,n) for(ll i=0;i<n;i++)

using namespace std;

const ll A = 1000005;

ll k[A],j[A];ll n;

bool pairwise(){

for(ll i=2;i<A;i++)

    {int cnt = 0;



        for(ll ii=i;ii<A;ii+=i)

        {

            cnt += j[ii];

        }

        if(cnt>1)

        {

            return false;

        }

    }

    return true;}



bool setwise(){

    ll gcd=k[0];

for(ll i=1;i<n;i++){

        gcd=__gcd(k[i],gcd);

        {if(gcd==1)return true;}

}

return false;}





int main() {

    cin>>n;

    fr(i,n)cin>>k[i],j[k[i]]++;

   if(pairwise())cout<<"pairwise coprime";

    else if(setwise())cout<<"setwise coprime";

    else  cout<<"not coprime";



    }
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.2850263207367747x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	int max_c = 0;

	for(int a:A)

		for(auto p:factorize(a)) max_c = max(max_c, ++C[p.first]);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.1330385601776412x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;

vi A;

int N;



int gcd_all(vi &A){int g = 0; for(int a:A) g = gcd(g, a);return g;}



bool is_pairwise(){

	#define MAX_A 1'000'001

	vi C(MAX_A, 0);

	for(int a:A) C[a]++;

	int c = 0;

	for(int j=2; j<MAX_A; j+=2) c += C[j];

	if(c > 1) return false;

	for(int i=3; i<MAX_A; i+=2){

		int c = 0;

		for(int j=i; j<MAX_A; j+=i) c += C[j];

		if(c > 1) return false;

	}

	return true;

}



int solve(){

	if(is_pairwise()) return 0;

	if(gcd_all(A) == 1) return 1;

	return 2;

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< vector<string>{"pairwise","setwise","not"}[solve()] <<" coprime\n";

}
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.132654815484402x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;



int gcd_all(vi &A){int g = 0; for(int a:A) g = gcd(g, a);return g;}



bool is_pairwise(vi &A){

	#define MAX_A 1'000'001

	vi C(MAX_A, 0);

	for(int a:A) C[a]++;

	int c = 0;

	for(int j=2; j<MAX_A; j+=2) c += C[j];

	if(c > 1) return false;

	for(int i=3; i<MAX_A; i+=2){

		int c = 0;

		for(int j=i; j<MAX_A; j+=i) c += C[j];

		if(c > 1) return false;

	}

	return true;

}



int solve(vi &A){

	if(is_pairwise(A)) return 0;

	if(gcd_all(A) == 1) return 1;

	return 2;

}



int main(){

	int N; cin>>N;

	vi A(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< vector<string>{"pairwise","setwise","not"}[solve(A)] <<" coprime\n";

}
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.1325432037527539x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;

#define rpd(i,s,e,d) for(int i=(s);i<(int)(e);i+=(d))



int gcd_all(vi &A){ int g = 0; for(int a:A) g = gcd(g, a); return g; }



int sum_array(vi &C, int start, int end, int step){

	int c = 0;

	rpd(i, start, end, step) c += C[i];

	return c;

}



bool is_pairwise(vi &A){

	int MAX_A = 1000000 + 1;

	vi C(MAX_A, 0); for(int a:A) C[a]++;

	if(sum_array(C, 2, MAX_A, 2) > 1) return false;

	rpd(i, 3, MAX_A, 2) if(sum_array(C, i, MAX_A, i) > 1) return false;

	return true;

}



int solve(vi &A){

	if(is_pairwise(A)) return 0;

	if(gcd_all(A) == 1) return 1;

	return 2;

}



int main(){

	int N; cin>>N;

	vi A(N); rpd(i, 0, N, 1) cin>>A[i];

	cout<< vector<string>{"pairwise","setwise","not"}[solve(A)] <<" coprime\n";

}
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.1330836491674785x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;

#define rpd(i,s,e,d) for(int i=(s);i<(int)(e);i+=(d))

#define MAX_A 1000000 + 1



int sum_array(vi &C, int start, int end, int step){

	int c = 0;

	rpd(i, start, end, step) c += C[i];

	return c;

}



bool is_pairwise(vi &C){

	if(sum_array(C, 2, MAX_A, 2) > 1) return false;

	rpd(i, 3, MAX_A, 2) if(sum_array(C, i, MAX_A, i) > 1) return false;

	return true;

}



int is_type(vi &C, int g){

	if(is_pairwise(C)) return 0;

	if(g == 1) return 1;

	return 2;

}



int main(){

	int N; cin>>N;

	vi C(MAX_A, 0);

	int g = 0;

	rpd(i, 0, N, 1){

		int a; cin>>a;

		C[a]++;

		g = gcd(g, a);

	}

	cout<< vector<string>{"pairwise","setwise","not"}[is_type(C, g)] <<" coprime\n";

}
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.1329314972798032x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;

#define rpd(i,s,e,d) for(int i=(s);i<(int)(e);i+=(d))

#define MAX_A 1000000 + 1



int sum_array(vi &C, int start, int end, int step){

	int c = 0;

	rpd(i, start, end, step) c += C[i];

	return c;

}



bool is_pairwise(vi &C){

	if(sum_array(C, 2, MAX_A, 2) > 1) return false;

	rpd(i, 3, MAX_A, 2) if(sum_array(C, i, MAX_A, i) > 1) return false;

	return true;

}



int main(){

	int N; cin>>N;

	vi C(MAX_A, 0);

	int g = 0;

	rpd(i, 0, N, 1){

		int a; cin>>a;

		C[a]++;

		g = gcd(g, a);

	}

	int t = 2;

	if(is_pairwise(C)) t = 0;

	else if(g == 1) t = 1;

	cout<< vector<string>{"pairwise","setwise","not"}[t] <<" coprime\n";

}
// Slower C++ solution:
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

#define MAX_A 1'000'001

int N;

vector<int> A, C(MAX_A, 0);



// 素数と個数を求める

vector<pair<int,int>> factorize(int n){

  vector<pair<int,int>> res;

  for(int i=2; i*i<=n; ++i){

    if (n%i) continue;

    res.emplace_back(i,0);

    while(n%i == 0){

      n /= i;

      res.back().second++;

    }

  }

  if(n != 1) res.emplace_back(n,1);

  return res;

}



string solve(){

	for(int a:A)

		for(auto p:factorize(a)) C[p.first]++;

	int max_c = 0;

	for(auto c:C) max_c = max(max_c, c);

	if(max_c <= 1) return "pairwise";

	else if(max_c <= N-1) return "setwise";

	return "not";

}



int main(){

	cin>>N;

	A.resize(N); for(int i=0; i<N; ++i) cin>>A[i];

	cout<< solve() <<" coprime\n";

}


// Faster C++ solution for the same problem (measured speedup: 1.13288536395173x):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;

#define rpd(i,s,e,d) for(int i=(s);i<(int)(e);i+=(d))

#define MAX_A 1000000 + 1



int sum_array(vi &C, int start, int end, int step){

	int c = 0;

	rpd(i, start, end, step) c += C[i];

	return c;

}



int main(){

	int N; cin>>N;

	vi C(MAX_A, 0);

	int g = 0;

	rpd(i, 0, N, 1){

		int a; cin>>a;

		C[a]++;

		g = gcd(g, a);

	}

	int t = 0;

	if(sum_array(C, 2, MAX_A, 2) > 1) t = 1;

	else

		rpd(i, 3, MAX_A, 2) if(sum_array(C, i, MAX_A, i) > 1){

			t = 1;

			break;

		}

	if(t == 1 && g != 1) t = 2;

	cout<< vector<string>{"pairwise","setwise","not"}[t] <<" coprime\n";

}