#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mset(x, y) memset((x), (y), sizeof(x))
#define sz(x) ((ll)(x).size())
#define rep(i, a, b) for(i = a; i < b; i++)
#define per(i, a, b) for(i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define cerr cout
#define endl '\n'
using namespace std;

string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cerr << " " << to_string(H); debug_out(T...);}
#define pr(...) cerr << "[" << #__VA_ARGS__ << "] :", debug_out(__VA_ARGS__)

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const ld eps = 1e-7;
const ll mod = 1000000007;
const ll N = 998244353;

ll binpow(ll b, ll p){ ll ans = 1; while(p > 0){if(p & 1) ans = (ans * b) % mod; b = (b * b) % mod; p >>= 1;}return ans;}
ll modinv(ll x){return binpow(x, mod - 2);}

const ll mxn = 1e6 + 100;

ll arr[mxn];

ll spf[mxn]; 
  
// Hash to store prime factors count 
ll hash1[mxn] = { 0 }; 
  
// Function to calculate SPF (Smallest Prime Factor) 
// for every number till mxn 
void sieve() 
{ 
    spf[1] = 1; 
    for (ll i = 2; i < mxn; i++) 
  
        // Marking smallest prime factor for every 
        // number to be itself 
        spf[i] = i; 
  
    // Separately marking spf for every even 
    // number as 2 
    for (ll i = 4; i < mxn; i += 2) 
        spf[i] = 2; 
  
    // Checking if i is prime 
    for (ll i = 3; i * i < mxn; i++) { 
  
        // Marking SPF for all numbers divisible by i 
        if (spf[i] == i) { 
            for (ll j = i * i; j < mxn; 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(ll x) 
{ 
    ll 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(ll x) 
{ 
    ll 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; 
} 

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	ll n, i, tot = 1;
	cin >> n;
	cin >> arr[0];
	tot = arr[0];
	rep(i, 1, n)
	{
		cin >> arr[i];
		tot = __gcd(tot, arr[i]);
	}
	//cout << "ok\n";
	sieve(); 
	//cout << "ok\n";
  
    for(i = 0; i < n; i++) 
        getFactorization(arr[i]); 
    bool f = 1;
    for (i = 0; i < n; i++) 
    {
        if(!check(arr[i]))
        {
        	f = 0;
        	break;
        }
    }
    if(f)
    {
    	cout << "pairwise coprime";
    	return 0;
    }
    else
    {
    	if(tot == 1)
    		cout << "setwise coprime";
    	else
    		cout << "not coprime";
    }
  
}

Measured memory_bytes: 26972