stablegradients/pie-gem5-pairs huggingface dataset:
// 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;

#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";

}
// 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.1300172826850146x):
// 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";

}
// 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.2160367412427484x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0732527417708488x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.07361636097639x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0737221654885512x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0732100336424577x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.073354164980392x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0733978740805423x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0733978740805423x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0761222504078383x):
// 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";

}
// 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.2160367412427484x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0732527417708488x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.07361636097639x):
// 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";

}
// Slower C++ solution:
// 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";

}


// Faster C++ solution for the same problem (measured speedup: 1.0737221654885512x):
// 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";

}