stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");

}


// Optimized solution to the same problem (faster):
#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");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

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



int sum_array(vector<int> &C, int start, int end, int step){

	int c = 0;

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

	return c;

}



int main(){

	int MAX_A = 1000000 + 1;

	int N; cin>>N;

	vector<int> 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

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



int sum_array(vector<int> &C, int start, int end, int step){

	int c = 0;

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

	return c;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);

	

	int MAX_A = 1000000 + 1;

	int N; cin>>N;

	vector<int> 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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";

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// E - Coprime

#include <bits/stdc++.h>

using namespace std;

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



int sum_array(vector<int> &C, int start, int end, int step){

	int c = 0;

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

	return c;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false); // 232ms -> 90ms



	int MAX_A = 1000000 + 1;

	int N; cin>>N;

	vector<int> 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(g > 1) t = 2;

	else 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; }

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

}


// Optimized solution to the same problem (faster):
// 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))



vi gen_d_prim(int n){

	vi D(n+1, 0);

	rpd(i, 2, n+1, 1)

		if(!D[i]) rpd(j, i, n+1, i) D[j] = i;

	return D;

}



bool is_pairwise(vi &A){

	vi D = gen_d_prim(1000000);

	set<int> past;

	for(auto a:A){

		set<int> now;

		while(a != 1){

			// # 素数 D[a]: 今回は未済 & 過去は済

			if(!now.count(D[a]) && past.count(D[a])) return false;

			now.insert(D[a]);

			past.insert(D[a]);

			a /= D[a];

		}

	}

	return true;

}



int main(){

	cin.tie(0); ios::sync_with_stdio(false);



	int N; cin>>N;

	int g = 0;

	vi A(N); rpd(i, 0, N, 1){ cin>>A[i]; g = gcd(g, A[i]); }

	int t = 0;

	if(g > 1) t = 2;

	else t = !is_pairwise(A);

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

}


// Fastest known solution for this problem: