//Author : Prakhar Asaiya
#include<bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(ll i = a; i < b; ++i)
#define REPN(i,a,b) for(ll i = a; i <= b; ++i)
#define REPV(i,a,b) for(ll i = a; i >= b; --i)
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define with_tests int t; cin>>t; while(t--){ solve(); }
#define without_tests solve();
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 100000000
#define ff first
#define ss second
const int M=1e9+7;
// credit to https://www.geeksforgeeks.org/check-for-an-array-element-that-is-co-prime-with-all-others/#:~:text=Using%20hash%2C%20store%20the%20count,prime%20pair%20with%20other%20elements.
//for the below functions
#define MAXN 1000001 

// Stores smallest prime factor for every number 
int spf[MAXN]; 
  
// Hash to store prime factors count 
int hash1[MAXN] = { 0 }; 
  
// Function to calculate SPF (Smallest Prime Factor) 
// for every number till MAXN 
void sieve() 
{ 
    spf[1] = 1; 
    for (int i = 2; i < MAXN; i++) 
  
        // Marking smallest prime factor for every 
        // number to be itself 
        spf[i] = i; 
  
    // Separately marking spf for every even 
    // number as 2 
    for (int i = 4; i < MAXN; i += 2) 
        spf[i] = 2; 
  
    // Checking if i is prime 
    for (int i = 3; i * i < MAXN; i++) { 
  
        // Marking SPF for all numbers divisible by i 
        if (spf[i] == i) { 
            for (int j = i * i; j < MAXN; j += i) 
  
                // Marking spf[j] if it is not 
                // previously marked 
                if (spf[j] == j) 
                    spf[j] = i; 
        } 
    } 
} 
  
// Function to store the prime factors after dividing 
// by the smallest prime factor at every step 
void getFactorization(int x) 
{ 
    int temp; 
    while (x != 1) { 
        temp = spf[x]; 
        if (x % temp == 0) { 
  
            // Storing the count of 
            // prime factors in hash 
            hash1[spf[x]]++; 
            x = x / spf[x]; 
        } 
        while (x % temp == 0) 
            x = x / temp; 
    } 
} 
  
// Function that returns true if there are 
// no common prime factors between x 
// and other numbers of the array 
bool check(int x) 
{ 
    int temp; 
    while (x != 1) { 
        temp = spf[x]; 
  
        // Checking whether it common 
        // prime factor with other numbers 
        if (x % temp == 0 && hash1[temp] > 1) 
            return false; 
        while (x % temp == 0) 
            x = x / temp; 
    } 
    return true; 
} 
  
// Function that returns true if there is 
// an element in the array which is coprime 
// with all the other elements of the array 
bool hasValidNum(int arr[], int n) 
{ 
  
    // Using sieve for generating prime factors 
    sieve(); 
  
    for (int i = 0; i < n; i++) 
        getFactorization(arr[i]); 
  bool ok = true;
    // Checking the common prime factors 
    // with other numbers 
    for (int i = 0; i < n; i++) 
        ok &= check(arr[i]);
  
    return ok; 
}

void solve()
{
	int n;
	cin>>n;
	int A[n];
	REP(i,0,n)
	{
		cin>>A[i];
	}
	int res = A[0];
	REP(i,1,n)
	{
		res = __gcd(res, A[i]);
		if(res == 1)
		break;
	}
	if(res != 1)
	{
		cout<<"not coprime";
	}
	else
	{
		bool ans = hasValidNum(A, n);
		if(ans)
		{
			cout<<"pairwise coprime";
		}
		else
		cout<<"setwise coprime";
	}
}
 
int main()
{/*
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#*/
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  //with_tests;
  without_tests;
  return 0;
}

Measured memory_bytes: 15212