import java.io.*;
import java.util.*;

public class Main {
    private static final boolean N_CASE = false;
    private static final int M = 1000;

    private List<Integer> sieve() {
        List<Integer> prime = new ArrayList<>();
        boolean[] isPrime = new boolean[M + 1];
        Arrays.fill(isPrime, true);
        for (int i = 2; i <= M; ++i) {
            if (isPrime[i]) {
                prime.add(i);
                for (int j = 2; j * i <= M; ++j) {
                    isPrime[i * j] = false;
                }
            }
        }
        return prime;
    }

    private void solve() {
        List<Integer> prime = sieve();
        List<List<Integer>> fac = new ArrayList<>();
        for (int i = 0; i <= 1000000; ++i) {
            fac.add(new ArrayList<>());
            if (i < 2) {
                continue;
            }

            int v = i;
            for (int p : prime) {
                if (v < p) {
                    break;
                }
                if (v % p == 0) {
                    fac.get(i).add(v);
                    while (v % p == 0) v /= p;
                }
            }
            if (v > 1) {
                fac.get(i).add(v);
            }
        }

        int N = sc.nextInt();
        int[] A = sc.nextIntArray(N);

        Map<Integer, Integer> c = new HashMap<>();
        for (int i = 0; i < N; ++i) {
            for (int v : fac.get(A[i])) {
                c.put(v, c.getOrDefault(v, 0) + 1);
            }
        }

        boolean ok = true;
        for (Map.Entry<Integer, Integer> e : c.entrySet()) {
            if (e.getValue() > 1) {
                ok = false;
                break;
            }
        }

        if (ok) {
            out.println("pairwise coprime");
            return;
        }

        ok = true;
        for (Map.Entry<Integer, Integer> e : c.entrySet()) {
            if (e.getValue() >= N) {
                ok = false;
                break;
            }
        }

        if (ok) {
            out.println("setwise coprime");
        } else {
            out.println("not coprime");
        }
    }

    private void run() {
        int T = N_CASE ? sc.nextInt() : 1;
        for (int t = 0; t < T; ++t) {
            solve();
        }
    }

    private static MyWriter out;
    private static MyScanner sc;

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        private MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        int[][] nextIntArray(int n, int m) {
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = sc.nextInt();
                }
            }
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        long[][] nextLongArray(int n, int m) {
            long[][] a = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = nextLong();
                }
            }
            return a;
        }

        List<Integer> nextList(int n) {
            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(nextInt());
            }
            return list;
        }

        List<Long> nextLongList(int n) {
            List<Long> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(nextLong());
            }
            return list;
        }

        char[] nextCharArray(int n) {
            return sc.next().toCharArray();
        }

        char[][] nextCharArray(int n, int m) {
            char[][] c = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    c[i][j] = s.charAt(j);
                }
            }
            return c;
        }
    }

    private static class MyWriter extends PrintWriter {
        private MyWriter(OutputStream outputStream) {
            super(outputStream);
        }

        void printArray(int[] a) {
            for (int i = 0; i < a.length; ++i) {
                print(a[i]);
                print(i == a.length - 1 ? '\n' : ' ');
            }
        }

        void printArray(long[] a) {
            for (int i = 0; i < a.length; ++i) {
                print(a[i]);
                print(i == a.length - 1 ? '\n' : ' ');
            }
        }

        void println(int[] a) {
            for (int v : a) {
                println(v);
            }
        }

        void print(List<Integer> list) {
            for (int i = 0; i < list.size(); ++i) {
                print(list.get(i));
                print(i == list.size() - 1 ? '\n' : ' ');
            }
        }

        void println(List<Integer> list) {
            list.forEach(this::println);
        }
    }

    private <T> List<List<T>> createGraph(int n) {
        List<List<T>> g = new ArrayList<>();
        for (int i = 0; i < n; ++i) {
            g.add(new ArrayList<>());
        }
        return g;
    }

    private void fill(int[][] a, int value) {
        for (int[] row : a) {
            fill(row, value);
        }
    }

    private void fill(int[] a, int value) {
        Arrays.fill(a, value);
    }

    public static void main(String[] args) {
        out = new MyWriter(new BufferedOutputStream(System.out));
        sc = new MyScanner();
        new Main().run();
        out.close();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastInput in = new FastInput(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Sample solver = new Sample();
		solver.solve(1, in, out);
		out.close();
	}

	static class Sample {

		public void solve(int testNum, FastInput in, PrintWriter out) {

			int n =  in.nextInt();
			int []a = in.nextIntArray(n);

			Arrays.sort(a);
			int max = 1000100;

			int []minf = new int [max];
			boolean []prime = new boolean [max];

			for(int i = 0 ; i < max; i++) {
				minf[i] = -1;
				prime[i] = true;
			}
			minf[0] = 0; prime[0] = false;
			minf[1] = 1; prime[1] = false;

			for(int i = 2 ; i < max ; i++) {
				if(prime[i]) {
					minf[i] = i;
					for(int j = i*2 ; j < max ; j += i) {
						if(minf[j] == -1) {
							minf[j] = i;
							prime[j] = false;
						}
					}
				}
			}

			Set<Integer> all = new HashSet<Integer>();
			List<Set<Integer>> tmp = new ArrayList<>();

			for(int i = 0 ; i < n ;i++) {
				tmp.add(new HashSet<Integer>());
			}
			boolean pair = true;
			int []gcd = new int [max];

			for(int i = 0 ; i < n ;i++) {
				int now = a[i];

				while(now != 1) {
					tmp.get(i).add(minf[now]);
					now /= minf[now];
				}

				for(int num : tmp.get(i)) {
					if(all.contains(num)) {
						pair = false;
					}
					all.add(num);
				}
			}

			boolean not = false;

			for(int num : tmp.get(0)) {
				boolean jdg = true;
				for(int i = 0 ; i < n ;i++) {
					if(!tmp.get(i).contains(num)) {
						jdg  = false;
					}
				}
				if(jdg) {
					not = true;
				}
			}

			if(not) {
				out.println("not coprime");
			}
			else if(pair) {
				out.println("pairwise coprime");
			}
			else {
				out.println("setwise coprime");
				}
			}
	}
	static class FastInput{
		private final BufferedReader in;
		private String[] buff;
		private int index = 0;

		public FastInput(InputStream is) {
			in = new BufferedReader(new InputStreamReader(is));
		}
		String nextLine() {
			try {
				return in.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return null;
		}
		String next() {
			while (buff == null || index >= buff.length) {
				buff = nextLine().split(" ");
				index = 0;
			}
			return buff[index++];
		}
		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		Double nextDouble() {
			return Double.parseDouble(next());
		}

		BigInteger nextBigInteger() {
			return new BigInteger(next());
		}

		BigDecimal nextBigDecimal() {
			return new BigDecimal(next());
		}

		public int[] nextIntArray(final int n) {
			final int[] res = new int [n];

			for(int i = 0 ; i < n ;i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(final int n) {
			final long[] res= new long [n];

			for(int i = 0 ; i < n ;i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public double[] nextDoubleArray(final int n ) {
			final double[] res = new double [n];

			for(int i = 0 ; i < n ;i++) {
				res[i] = nextDouble();
			}
			return res;
		}

		public int[][] nextInt2DArray(final int n , final int m){
			int [][]res = new int [n][m];

			for(int i = 0 ; i < n ;i++) {
				for(int j = 0 ; j < m ;j++) {
					res[i][j] = nextInt();
				}
			}
			return res;
		}
		public long[][] nextLong2DArray(final int n , final int m){
			long [][]res = new long [n][m];

			for(int i = 0 ; i < n ;i++) {
				for(int j = 0 ; j < m ;j++) {
					res[i][j] = nextLong();
				}
			}
			return res;
		}

		public char[][] nextChar2DArray(final int n){
			char [][]res = new char [n][];

			for(int i = 0 ; i < n ;i++) {
				String s = next();
				res[i] = s.toCharArray();
			}

			return res;
		}
	}

}


#include <iostream>
#include <numeric>

inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=x*10+c-'0';c=getchar();}
	return x*f;
}

int cnt[1000001];

int main(){
  int n = read(), num = read(), g = num, ex = (n-1)/8;
  cnt[num] = 1;

  for(int i=0;i<ex;i++){
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
    if(i-cnt[1]>80000){
      if(g==1) printf("setwise coprime\n");
      else printf("not coprime\n");
      return 0;
    }
  }

  for(int i=0;i<(n-1)%8;i++){
    num = read();
    g = std::gcd(g, num);
    cnt[num]++;
  }

  if(n - cnt[1] > 80000){
    if(g==1) printf("setwise coprime\n");
    else printf("not coprime\n");
    return 0;
  }

  if(g!=1){
    printf("not coprime\n");
    return 0;
  }

  int use[1000001];
  int max_S = 0;
  for(int i=2;i<=1000000;i++){
    if(use[i]==-1) continue;
    int S = 0;
    for(int j=i;j<=1000000;j+=i) {
      S += cnt[j];
      use[j] = -1;
    }
    if(max_S<S) max_S = S;
  }
  if(max_S<2) printf("pairwise coprime\n");
  else printf("setwise coprime\n");
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    constexpr int A_MAX = 1000000;
    vector<int> min_factor(A_MAX + 1);
    vector<int> q(A_MAX + 1, 1);
    vector<int> primes;
    for (int i = 2; i <= A_MAX; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
            primes.push_back(i);
        }
        int min_factor_i = min_factor[i];
        for (int p : primes) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }

    int N = 0;
    char c = getchar_unlocked();
    do {
        N = 10 * N + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    vector<int> a(A_MAX + 1);
    for (int i = 0; i < N; ++i) {
        int A = 0;
        c = getchar_unlocked();
        do {
            A = 10 * A + c - '0';
    	} while ((c = getchar_unlocked()) >= '0');
        ++a[A];
    }

    bool is_pairwise_coprime = true;
    for (int n = A_MAX; n > 1; --n) {
        if (a[n] > 1) {
            if (a[n] == N) {
                printf("not coprime\n");
                return 0;
            }
            is_pairwise_coprime = false;
        }
        a[min_factor[n]] += a[n];
        a[q[n]] += a[n];
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }

    return 0;
}


#include <bits/stdc++.h>

#define A_MAX 1000000
#define A_MAX_HALF 500000

using namespace std;

int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
vector<int> primes{ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;

int read_int() {
    int x = 0;
    char c = getchar_unlocked();
    do {
      x = 10 * x + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    return x;
}

int main() {
    for (int i = 2; i <= A_MAX_HALF; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int min_factor_i = min_factor[i];
        for (int p : primes) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }

    char c = getchar_unlocked();
    do {
        N = 10 * N + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    for (int i = 0; i < N; ++i) {
        int A = 0;
        c = getchar_unlocked();
        do {
        	A = 10 * A + c - '0';
    	} while ((c = getchar_unlocked()) >= '0');
        ++a[A];
    }

    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }

    return 0;
}


#include<bits/stdc++.h>
//#include<pair>
using namespace std;

typedef long long ll;
typedef int ii;
//typedef vector<ll> vi;

#define INF 1000000007

#define pi 3.141592654

#define T while(t--)
#define for2(i,a,b) for(i=a;i>=b;i--)
#define for3(i,a,b) for(i=a;i<=b;i=i+2)
#define for1(i,a,b) for(i=a;i<=b;i++)
#define pb push_back
#define mp make_pair

#include<sstream>

#define si set<ll>
#define se multiset<ll>

typedef long double ld;

typedef vector<ll> vi;

#define bb(arr,nn,xx) upper_bound(arr,arr+nn,xx)-arr
#define aa(arra,nna,xxa) lower_bound(arra,arra+nna,xxa)-arra

#define all(v) sort(v.begin(),v.end())

#define all1(v) sort(v.rbegin(),v.rend())

ll gcd(ll a,ll b)
{

    if(b==0) return a;

    return gcd(b,a%b);

}

ii main()
{

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

    ll n,i,j; cin>>n; vi v; ll x; ll f=0,g=0;

    for1(i,1,n)
    {

        cin>>x;

        v.pb(x);

    }

    for1(i,0,n-2)
    {

        for1(j,i+1,n-1)
        {

            if(gcd(v[j],v[i])!=1) {f++; break;}

        }

        if(f==1) break;

    }

    all(v);

    //cout<<v[0]<<"\n";

    if(f==0) cout<<"pairwise coprime"<<"\n";

    else
    {

        for2(i,v[0],2)
        {

            for1(j,0,n-1)
            {

             if(v[j]%i==0) {g++;}

            }

            if(g==3) break;
            else g=0;

            //if(g==1) break;

        }

        //cout<<g<<"\n";

        if(g<3) cout<<"setwise coprime"<<"\n";

        else cout<<"not coprime"<<"\n";

    }

}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int arr[1000007] ;

int main()
{
    int n  ,  pairwise = 1 , i , j, g , f;
    scanf ("%d",&n) ;
    for (i=0 ; i<n ; i++ )
    {
                 scanf("%d",&arr[i]) ;
    }
    f = __gcd ( arr[0] , arr[1] );
    for ( i=0  ; i<n ;i++ )
    {
                 for (j=i+1 ; j<n ; j++)
                 {
                            g = __gcd (arr[j],arr[i]);
                            if ( g>1 )
                            {
                                 pairwise = 0 ;
                            }
                 }
                 f = __gcd(f,arr[i]);
    }
    if ( pairwise )
    {
                 printf("pairwise coprime") ;
    }
    else if ( f == 1 )
    {
                 printf("setwise coprime");
    }
    else
    {
                 printf("not coprime") ;
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int arr[1000007] ;

int main()
{
    int n  ,  pairwise = 1 , i , j, g;
    scanf ("%d",&n) ;
    for (i=0 ; i<n ; i++ )
    {
                 scanf("%d",&arr[i]) ;
    }
    g = __gcd(arr[0],arr[1]) ;
    for ( i=2  ; i<n ;i++ )
    {
                 if (g>1)
                 {
                              pairwise = 0 ;
                 }
                 g = __gcd (g,arr[i]);
    }
    if ( pairwise )
    {
                 printf("pairwise coprime") ;
    }
    else if ( g == 1 )
    {
                 printf("setwise coprime");
    }
    else
    {
                 printf("not coprime") ;
    }
    return 0;
}


#include <stdio.h>

#define A_MAX 1000000
#define A_MAX_HALF 500000

int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;

int main() {

    for (int i = 2; i <= A_MAX_HALF; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int j = 0;
        int min_factor_i = min_factor[i];
        for (int p = 2; ; p = primes[++j]) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }

    char c = getchar_unlocked();
    while (c > 47) {
        N = 10 * N + c - 48;
        c = getchar_unlocked();
    }

    for (int i = 0; i < N; ++i) {
        int x = 0;
        c = getchar_unlocked();
        while (c > 47) {
            x = 10 * x + c - 48;
            c = getchar_unlocked();
        }
        ++a[x];
    }

    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }

    return 0;
}


#include <stdio.h>

#define A_MAX 1000000

int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;

int main() {

    for (int i = 2; i <= A_MAX; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int j = 0;
        for (int p = 2; ; p = primes[++j]) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor[i]) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }

    char c = getchar_unlocked();
    while (c > 47) {
        N = 10 * N + c - 48;
        c = getchar_unlocked();
    }

    for (int i = 0; i < N; ++i) {
        int x = 0;
        c = getchar_unlocked();
        while (c > 47) {
            x = 10 * x + c - 48;
            c = getchar_unlocked();
        }
        ++a[x];
    }

    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }

    return 0;
}


#include <stdio.h>

#define A_MAX 1000000
#define A_MAX_HALF 500000

int min_factor[A_MAX + 1];
int q[A_MAX + 1];
int a[A_MAX + 1];
int primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 };
int N;

int main() {

    for (int i = 2; i <= A_MAX_HALF; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
        }
        int j = 0;
        for (int p = 2; ; p = primes[++j]) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor[i]) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }

    char c = getchar_unlocked();
    while (c > 47) {
        N = 10 * N + c - 48;
        c = getchar_unlocked();
    }

    for (int i = 0; i < N; ++i) {
        int x = 0;
        c = getchar_unlocked();
        while (c > 47) {
            x = 10 * x + c - 48;
            c = getchar_unlocked();
        }
        ++a[x];
    }

    int is_pairwise_coprime = 1;
    for (int n = A_MAX; n > 1; --n) {
        int an = a[n];
        if (an) {
            if (an > 1) {
                if (an == N) {
                    printf("not coprime\n");
                    return 0;
                }
                is_pairwise_coprime = 0;
            }
            a[min_factor[n]] += an;
            a[q[n]] += an;
        }
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }

    return 0;
}


#include <stdio.h>

long gcd(long a,long b){
  long r,tmp;
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  if(a==0) return b;
  r=b%a;
  while(r!=0)
    b=a;
  a=r;
  r=b%a;
}

int main(void){
  long n,a[1000005],count[1000005]={0},max=0,count1=0,k=0,gcd1=0;
    scanf("%ld",&n);
    for(int i=0;i<n;i++){
      scanf("%ld",&a[i]);
      count[a[i]]++;
      if(max<a[i]) max=a[i];
    }
    for(int i=2;i<=max;i++){
      k++;
      for(int j=i;j<max;j+=i){
        count1+=count[j];
      }
      if(count1>1) break;
       count1=0;
    }
    if(k==max-1){
      printf("pairwise coprime");
      return 0;
    }

    for(int i=0;i<n;i++){
      gcd1=gcd(gcd1,a[i]);
    }
    if(gcd1==1) printf("setwise coprime");
    else printf("not coprime");

    return 0;
  }


#include <stdio.h>

long gcd(long a,long b){
  long r,tmp;
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  if(a==0) return b;
  r=b%a;
  while(r!=0)
    b=a;
  a=r;
  r=b%a;
}

int main(void){
  long n,a[1000005],count[1000005]={0},max=0,count1=0,k=0,gcd1=0;
    scanf("%ld",&n);
    for(int i=0;i<n;i++){
      scanf("%ld",&a[i]);
      count[a[i]]++;
      if(max<a[i]) max=a[i];
    }
    for(int i=2;i<=max;i++){
      k++;
      for(int j=2;j<max;j+=i){
        count1+=count[j];
      }
      if(count1>1) break;
       count1=0;
    }
    if(k==max-1){
      printf("pairwise coprime");
      return 0;
    }

    for(int i=0;i<n;i++){
      gcd1=gcd(gcd1,a[i]);
    }
    if(gcd1==1) printf("setwise coprime");
    else printf("not coprime");

    return 0;
  }


#include<stdio.h>

int getgcd(int n,int m){
  int r;
  int tmp;
  if(n>m){
    tmp=n;
    n=m;
    m=tmp;
  }

  r=m%n;//n=a[i],m=a[j]
  while(r!=0){
  m=n;
  n=r;
  r=m%n;
  }
  //printf("n=%d ",n);
  return n;
}

int main(){
  int N;
  scanf("%d",&N);
  int c[N];
  int p=1,s=0;

  int i;
  for(i=0;i<N;i++){
    scanf("%d",&c[i]);

  }

  int j,r,a,b;
  for(i=0;i<N-1;i++){
  	for(j=i+1;j<N;j++){

      b=getgcd(c[i],c[j]);
      //printf("(%d,%d)=%d\n",i,j,b);
      if(b!=1){
        p=0;
        break;
      }

  	}
    if(p==0) break;
  }

  for(i=2;i<N;i++){
    a=getgcd(c[0],c[1]);
    a=getgcd(a,c[i]);
    if(a==1) s=1;
  }

  //printf("%d %d\n",p,s);
  if(p==1) printf("pairwise coprime");
  else if(s==1) printf("setwise coprime");
  else printf("not coprime");

  //for(i=0;i<N;i++) printf("%d",c[i]);

	return 0;
}


function Main(input) {

    input = input.split("\n");

    N = Number(input[0]);
    let An = input[1].split(" ").map(Number);

    if (gcd(An) !== 1) {
        console.log("not coprime");
        return;
    }

    let freq = Array(1000001).fill(0);
    for(let A of An) {
        if (A === 1) continue;
        freq[A]++;
    }

    for (let i = 2; i <= 1000001; i++) {
        let tmp = 0;
        for (let j = i; j <= 1000001; j += i) {
            tmp += freq[j];
            if (tmp >= 2) {
                console.log("setwise coprime");
                return;
            }
        }
    }

    console.log("pairwise coprime");

}

function gcd(arg) {

    let f = (a, b) => b ? f(b, a % b) : a
    let ans = arg[0];
    for (let i = 1; i < arg.length; i++) {
        ans = f(ans, arg[i]);
    }
    return ans;

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const SieveOfEratosthenes = (n) => {
    let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */
    let primes = []/* list of prime numbers */
    for(let i=2; i*i<=n; i++) {
        if(!flg[i]) {
            primes.push(i)
            for(let j=i; j*j<=n; j+=i) {
                flg[j] = 1
            }
        }
    }
    return primes
}

const factorizationBySoE = (n, primes) => {
    //const primes = SieveOfEratosthenes(n)
    let factors = {}
    primes.some(p => {
        if(n < p) return true
        while(n%p===0) {
            if(!factors[p])factors[p]=1
            else factors[p]++
            n/=p
        }
    })
    if(n>1)factors[n]=1
    return factors
}

const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)

    const MAX_A = 10**6+100
  //  const A = Math.max(...a)

    //  check if p is in {a} (paircoprime)
    //const primes = SieveOfEratosthenes(A)
//    return
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
  /*
    for(let i=0; i<N; i++) {
        const factors = Object.keys(factorizationBySoE(a[i], primes))
        for(let j=0; j<factors.length; j++ ) {
            // console.log(`i=${i}, j=${j}, ${factors[j]}`)
            // console.log(factors)
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }
*/
//  return
    for(let i=0; i<N; i++) {
        set[a[i]]++
    }
//  return
    for(let i=2; i<MAX_A; i++) {
         let cnt=0
         for(let j=i; j<MAX_A; j+=i) {
             cnt+=set[j]
         }
        if(cnt>1) {
             isPairCoprime = false
         }
     }

    if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }
     // return
    // setcoprime
    // let gcd = getGCD(a[0], a[1])
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
        // console.log(gcd)
    }

    if(gcd===1) {
        console.log("setwise coprime")
        return
    }

    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


const factorization = (n) => {
    let primes = []
    for(let i=2; i*i<=n; i++) {
        let e=0
        while(n%i===0) {
            e++
            n/=i
        }
        if(e) {
            primes.push(i)
        }
    }
    if(n>1) {
        primes.push(n)
    }
    return primes
}

const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)

    const MAX_A = 10**6+1

    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        //const factors = Object.keys(factorizationBySoE(a[i], primes))
  	    const factors = factorization(a[i])
  	    console.log(`${a[i]}`)
  	    console.log(factors)
        for(let j=0; j<factors.length; j++ ) {
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }

  	if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }

  // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }

    if(gcd===1) {
        console.log("setwise coprime")
        return
    }

    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


const SieveOfEratosthenes = (n) => {
    let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */
    let primes = []/* list of prime numbers */
    for(let i=2; i*i<=n; i++) {
        if(!flg[i]) {
            primes.push(i)
            for(let j=i; j*j<=n; j+=i) {
                flg[j] = 1
            }
        }
    }
    return primes
}

const factorization = (n) => {
    let primes = []
    for(let i=2; i*i<=n; i++) {
        let e=0
        while(n%i===0) {
            e++
            n/=i
        }
        if(e) {
            primes.push({i,e})
        }
    }
    return primes
}

const factorizationBySoE = (n, primes) => {
    //const primes = SieveOfEratosthenes(n)
    let factors = {}
    primes.some(p => {
        if(n < p) return true
        while(n%p===0) {
            if(!factors[p])factors[p]=1
            else factors[p]++
            n/=p
        }
    })
    if(n>1)factors[n]=1
    return factors
}

const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)

    const MAX_A = 10**6+1

    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        //const factors = Object.keys(factorizationBySoE(a[i], primes))
  	    const factors = factorization(a[i])
        for(let j=0; j<factors.length; j++ ) {
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }

  	if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }

  // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }

    if(gcd===1) {
        console.log("setwise coprime")
        return
    }

    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


const SieveOfEratosthenes = (n) => {
    let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */
    let primes = []/* list of prime numbers */
    for(let i=2; i*i<=n; i++) {
        if(!flg[i]) {
            primes.push(i)
            for(let j=i; j*j<=n; j+=i) {
                flg[j] = 1
            }
        }
    }
    return primes
}

const factorizationBySoE = (n, primes) => {
    //const primes = SieveOfEratosthenes(n)
    let factors = {}
    primes.some(p => {
        if(n < p) return true
        if(n%p===0)factors[p]=1
    })
    // primes.some(p => {
    //     if(n < p) return true
    //     while(n%p===0) {
    //         if(!factors[p])factors[p]=1
    //         else factors[p]++
    //         n/=p
    //     }
    // })
    if(n>1)factors[n]=1
    return factors
}

const getGCD = (a,b) => {
    if(b===0)return a
    else if(a===0)return b
    return getGCD(b, a%b)
}

const main = (arg) => {
    const N = Number(arg.split("\n")[0])
    const a = arg.split("\n")[1].split(" ").map(Number)

    const MAX_A = 10**6+1

    //  check if p is in {a} (paircoprime)
    const primes = SieveOfEratosthenes(MAX_A)
    let set = [...new Array(MAX_A)].fill(0)
    isPairCoprime = true
    for(let i=0; i<N; i++) {
        const factors = Object.keys(factorizationBySoE(a[i], primes))
        for(let j=0; j<factors.length; j++ ) {
            // console.log(`i=${i}, j=${j}, ${factors[j]}`)
            // console.log(factors)
            if(set[factors[j]] === 1) {
                isPairCoprime = false
            }
            set[factors[j]] = 1
        }
    }

    // for(let i=0; i<MAX_A; i++) {
    //     set[a[i]] = 1
    // }
    // for(let i=2; i<MAX_A; i++) {
    //     let cnt=0
    //     for(let j=i; j<MAX_A; j+=i) {
    //         cnt+=set[j]
    //     }
    //     if(cnt>1) {
    //         isPairCoprime = false
    //     }
    // }

    if(isPairCoprime) {
        console.log("pairwise coprime")
        return
    }

    // setcoprime
    let gcd = 0
    for(let i=0; i<a.length; i++) {
        gcd = getGCD(gcd, a[i])
    }

    if(gcd===1) {
        console.log("setwise coprime")
        return
    }

    console.log("not coprime")
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func main() {
	sc := NewScanner()

	const MaxA = 1_000_000

	n := sc.ReadInt()
	uniqueN := n
	isPairwise := true
	aHas := make([]bool, MaxA+1)
	for i := 0; i < n; i++ {
		ai := sc.ReadInt()
		if aHas[ai] {
			// dup
			uniqueN--
			if ai > 1 {
				isPairwise = false
			}
		} else {
			aHas[ai] = true
		}
	}

	sieve := make([]bool, MaxA+1)
	for i := 2; i <= MaxA/2; i++ {
		if sieve[i] {
			continue
		}

		count := 0
		for j := i; j <= MaxA; j += i {
			sieve[j] = true
			if aHas[j] {
				count++
			}
		}

		if count > 1 {
			isPairwise = false
		}
		if count >= uniqueN {
			fmt.Println("not coprime")
			return
		}
	}

	if isPairwise {
		fmt.Println("pairwise coprime")
	} else {
		fmt.Println("setwise coprime")
	}
}

// from [my library](https://github.com/ikngtty/go-contestlib)
// -   math/simple

func Abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func Min(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}

	min := values[0]
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}

func Max(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}

	max := values[0]
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}

func Pow(base, exponent int) int {
	if exponent < 0 {
		panic(fmt.Sprintf("exponent (%d) should not be a minus", exponent))
	}

	answer := 1
	for i := 0; i < exponent; i++ {
		answer *= base
	}
	return answer
}

func Ceil(divident, dividor int) int {
	if dividor == 0 {
		panic("dividor should not be 0")
	}

	quo := divident / dividor
	rem := divident % dividor

	if rem != 0 {
		if (divident > 0 && dividor > 0) ||
			(divident < 0 && dividor < 0) {
			return quo + 1
		}
	}
	return quo
}

// -   sortutil

func ReverseInts(a []int) {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
}

func ReverseStrings(a []string) {
	sort.Sort(sort.Reverse(sort.StringSlice(a)))
}

// -   io

type Scanner struct {
	bufScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bufSc := bufio.NewScanner(os.Stdin)
	bufSc.Split(bufio.ScanWords)
	bufSc.Buffer(nil, 100000000)
	return &Scanner{bufSc}
}

func (sc *Scanner) ReadString() string {
	bufSc := sc.bufScanner
	bufSc.Scan()
	return bufSc.Text()
}

func (sc *Scanner) ReadInt() int {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.Atoi(text)
	if err != nil {
		panic(err)
	}
	return num
}

func (sc *Scanner) ReadFloat() float64 {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.ParseFloat(text, 64)
	if err != nil {
		panic(err)
	}
	return num
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scan_init()
	n := scanInt()
	a := make([]int, n)
	max := 0
	for i:= 0; i<n; i++ {
		a[i] = scanInt()
		if max < a[i] {
			max = a[i]
		}
	}
	if boolSosu(a, max) {
		fmt.Println("pairwise coprime")
	} else {
		g := 0
		for i:= 0; i<n;i ++ {
			g = gcd(g,a[i])
		}
		if g == 1 {
			fmt.Println("setwise coprime")
		} else {
			fmt.Println("not coprime")
		}
	}
}
	func gcd(a int, b int) int {
		// aの方が小さくなるように設定する
		// ユークリッドの互除法で最大公約数を出す
		if a>b {
			//swap
			tmp := a
			a = b
			b = tmp
		}
		if a == 0 {
			return b
		}
		r := b % a
		if r != 0 {
			return gcd(r,a)
		} else {
			return a
		}
	}
	func allSosu(max int) map[int]bool{
		// max値までの素数群を返す
		// 計算量logmax*logmax
		output := map[int]bool{}
		furui := make([]int, max+1)
		for i:= 2; i*i<=max; i++ {
			if furui[i] > 0 {
				continue
			}
			for j:=i+i; j<=max; j += i{
				furui[j]++
			}
		}
		for i:=2; i<=max; i++ {
			if furui[i] == 0 {
				output[i] = true
			}
		}
		return output
	}
	func boolSosu(list []int, max int) bool {
			// 与えられた群がすべての要素に対し互いに素の時trueを返す
			furui := make([]int, max+1)
			for i:= 0;i<len(list); i++ {
				furui[list[i]]++
			}
			for i:=2; i<max; i++ {
				cnt := 0
				for j:=i; j<=max; j+= i {
					cnt += furui[j]
				}
				if cnt>1 {
					return false
				}
			}
			return true
		}
var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os"
	"strconv"
)

var DEBUG = true

// -----------------------------------------------------------------------------

// IO helper functions

// Returns next token from input.  It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)

// Holds a buffer for output.  It must be initialized by SetOutput().
// All IO functions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer

// Holds an io.Writer.  It must be initialized by SetOutput()
var OutputWriter io.Writer

// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
	SetUnbufferedInput(r)
	OutputBuffer = nil
	OutputWriter = w
}

// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
	OutputBuffer = bufio.NewWriter(w)
	OutputWriter = OutputBuffer
}

// Flushes OutputBuffer
func Flush() {
	if OutputBuffer != nil {
		OutputBuffer.Flush()
	}
}

// Returns true if c is a white space
func IsSpace(c byte) bool {
	switch c {
	case '\t', '\n', '\v', '\f', '\r', ' ':
		return true
	}
	return false
}

func IsNewLine(c byte) bool {
	switch c {
	case '\n', '\r':
		return true
	}
	return false
}

// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
	buf := new(bytes.Buffer)
	var b []byte

	var i int
	rest := func() ([]byte, error) {
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		return b[j:i], nil
	}
	initial := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextToken = rest
		return rest()
	}
	nextToken = initial

	restLn := func() ([]byte, error) {
		for i < len(b) && IsNewLine(b[i]) {
			i++
		}
		if i == len(b) {
			return nil, io.ErrUnexpectedEOF
		}
		j := i
		for i < len(b) && !IsNewLine(b[i]) {
			i++
		}
		return b[j:i], nil
	}

	initialLn := func() ([]byte, error) {
		io.Copy(buf, r)
		b = buf.Bytes()
		nextLine = restLn
		return restLn()
	}
	nextLine = initialLn
}

// Setup nextToken without input buffer.
func SetUnbufferedInput(r io.Reader) {
	buf := bufio.NewReader(r)
	var b []byte

	var i int
	nextToken = func() ([]byte, error) {
		var err error
		if i == len(b) {
			b, err = buf.ReadBytes('\n')
			if err != nil {
				return nil, err
			}
			i = 0
			j := len(b) - 1
			for 0 <= j && IsSpace(b[j]) {
				j--
			}
			b = b[0 : j+1]
		}
		for i < len(b) && IsSpace(b[i]) {
			i++
		}
		j := i
		for i < len(b) && !IsSpace(b[i]) {
			i++
		}
		if i == j {
			return nil, io.ErrUnexpectedEOF
		}
		return b[j:i], nil
	}
}

// -----------------------------------------------------------------------------

// IO functions

// Reads next token and return it as []byte
func readb() []byte {
	b, err := nextToken()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Reads next token and return it as string
func reads() string {
	return string(readb())
}

// Read next line as []byte.  Trailing '\n' will not be included.
// See also comments on readb()
func readbln() []byte {
	b, err := nextLine()
	if err != nil {
		panic(err)
	}
	return b[:len(b):len(b)]
}

// Read next line as string
func readsln() string {
	return string(readbln())
}

// Reads next token and return it as int64
func readll() int64 {
	i, err := strconv.ParseInt(reads(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// Reads next token and return it as int
func readi() int {
	return int(readll())
}

// Reads next token and return it as float64
func readf() float64 {
	f, err := strconv.ParseFloat(reads(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(OutputWriter, f, args...)
}

// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(OutputWriter, args...)
}

// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

func debugf(f string, args ...interface{}) {
	if !DEBUG {
		return
	}
	fmt.Fprintf(os.Stderr, f, args...)
}

func debug(args ...interface{}) {
	if !DEBUG {
		return
	}
	fmt.Fprintln(os.Stderr, args...)
}

// -----------------------------------------------------------------------------

// Utilities

func sumSlice(a []int) int {
	var res int
	for _, v := range a {
		res += v
	}
	return res
}

func sumSlicell(a []int64) int64 {
	var res int64
	for _, v := range a {
		res += v
	}
	return res
}

func readInts(N int) (int, []int) {
	if N == 0 {
		N = readi()
	}
	a := make([]int, N)
	for i := range a {
		a[i] = readi()
	}
	return N, a
}

func readIntsll(N int) (int, []int64) {
	if N == 0 {
		N = readi()
	}
	a := make([]int64, N)
	for i := range a {
		a[i] = readll()
	}
	return N, a
}

// -----------------------------------------------------------------------------

// Simple math functions

const (
	// big prime
	INF  = 1000000007
	INF2 = 1000000009
	INF3 = 998244353
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func minll(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minf(a, b float64) float64 {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func maxll(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxf(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absll(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func absf(a float64) float64 {
	if a < 0 {
		return -a
	}
	return a
}

// egcd(a, b) returns d, x, y:
//   d is gcd(a,b)
//   x, y are  integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcd(b, a%b)
	return d, y, x - a/b*y
}

func egcdll(a, b int64) (int64, int64, int64) {
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := egcdll(b, a%b)
	return d, y, x - a/b*y
}

func gcd(a, b int) int {
	d, _, _ := egcd(a, b)
	return d
}

func gcdll(a, b int64) int64 {
	d, _, _ := egcdll(a, b)
	return d
}

// set up IO functions
func init() {
	// for non-interactive
	SetInput(os.Stdin)
	SetOutput(os.Stdout)

	// Enable below when interactive.  Its ok to leave above intact.
	SetInteractive(os.Stdout, os.Stdin)
}

func main() {
	defer Flush()
	n := readi()
	_, a := readInts(n)
	answer := solve(n, a)
	println(answer)
}

func solve(n int, a []int) string {
	numbers := make([]int, 1000001)
	for i := 0; i < n; i++ {
		numbers[a[i]]++
	}
	for i := 2; i < 1000001; i++ {
		cnt := 0
		for j := i; j < 1000001; j += i {
			cnt += numbers[j]
		}

		if cnt > 1 {
			goto loopOut
		}
	}
	// mod := 1000000009
	// lcm := LCM(a[0], a[1], a[2:]...) % mod
	// prod := a[0]
	// for i := 1; i < n; i++ {
	// 	prod *= a[i]
	// 	prod %= mod
	// }
	// if prod == lcm {
	// 	return "pairwise coprime"
	// }
	// for i := 0; i < n; i++ {
	// 	for j := i + 1; j < n; j++ {
	// 		if gcd(a[i], a[j]) != 1 {
	// 			goto loopOut
	// 		}
	// 	}
	// }
	return "pairwise coprime"
loopOut:
	res := a[0]
	for i := 1; i < n; i++ {
		res = GCD(res, a[i])
	}
	if res == 1 {
		return "setwise coprime"
	}
	return "not coprime"
}

func LCM(a, b int, integers ...int) int {
	mod := 1000000009
	result := a * b % mod / gcd(a, b)

	for i := 0; i < len(integers); i++ {
		result = LCM(result, integers[i])
	}

	return result
}
func GCD(a, b int) int {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

// func gcd(x, y int) int {
// 	if x < y {
// 		y, x = x, y
// 	}

// 	for y > 0 {
// 		x, y = y, x%y
// 	}
// 	return x
// }


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func NextStr() string {
	scanner.Scan()
	return scanner.Text()
}

func NextInt() int {
	i, _ := strconv.Atoi(NextStr())
	return i
}

func Gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func SqrtInt(x int) float64 {
	float_x := float64(x)
	return math.Sqrt(float_x)
}

func Sieve(n int) []int {
	var isPrime [2000000 + 5 + 1]bool
	D := make([]int, 2000000+5+1)
	for i := 0; i < len(D); i++ {
		D[i] = i
	}

	for i := 0; i <= n; i++ {
		isPrime[i] = true
	}

	isPrime[0] = false
	isPrime[1] = false

	for i := 2; i <= n; i++ {
		if isPrime[i] {

			for j := 2 * i; j <= n; j += i {
				isPrime[j] = false
				D[j] = i
			}
		}
	}
	return D
}

func Contains(n int, A []int) bool {
	for _, e := range A {
		if n == e {
			return true
		}
	}
	return false
}

const MaxA = 1000001

func main() {
	scanner.Split(bufio.ScanWords)
	D := Sieve(MaxA)

	n := NextInt()
	res := NextInt()

	var used [MaxA]bool
	for i := 0; i < MaxA; i++ {
		used[i] = false
	}

	isPC := true

	m := res
	for m > 1 {
		prime := D[m]
		for D[m] == prime {
			used[m] = true
			m /= prime
		}
	}

	for i := 0; i < n-1; i++ {
		Ai := NextInt()
		res = Gcd(res, Ai)
		m := Ai
		for m > 1 {
			prime := D[m]
			if used[m] {
				isPC = false
			}
			for D[m] == prime {
				m /= prime
				used[m] = true
			}

		}
	}

	var ans string
	if res != 1 {
		ans = "not coprime"
	} else if isPC {
		ans = "pairwise coprime"
	} else {
		ans = "setwise coprime"
	}

	fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func NextStr() string {
	scanner.Scan()
	return scanner.Text()
}

func NextInt() int {
	i, _ := strconv.Atoi(NextStr())
	return i
}

func Gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func SqrtInt(x int) float64 {
	float_x := float64(x)
	return math.Sqrt(float_x)
}

func Sieve(n int) []int {
	var isPrime [2000000 + 5 + 1]bool
	D := make([]int, 2000000+5+1)
	for i := 0; i < len(D); i++ {
		D[i] = i
	}

	for i := 0; i <= n; i++ {
		isPrime[i] = true
	}

	isPrime[0] = false
	isPrime[1] = false

	for i := 2; i <= n; i++ {
		if isPrime[i] {

			for j := 2 * i; j <= n; j += i {
				isPrime[j] = false
				D[j] = i
			}
		}
	}
	return D
}

func Contains(n int, A []int) bool {
	for _, e := range A {
		if n == e {
			return true
		}
	}
	return false
}

const MaxA = 1000000

func main() {
	scanner.Split(bufio.ScanWords)
	D := Sieve(MaxA)

	n := NextInt()
	res := NextInt()

	var used [MaxA]bool
	for i := 0; i < MaxA; i++ {
		used[i] = false
	}

	isPC := true

	m := res
	for m > 1 {
		prime := D[m]
		for D[m] == prime {
			used[m] = true
			m /= prime
		}
	}

	for i := 0; i < n-1; i++ {
		Ai := NextInt()
		res = Gcd(res, Ai)
		m := Ai
		for m > 1 {
			prime := D[m]
			if used[m] {
				isPC = false
			}
			for D[m] == prime {
				m /= prime
				used[m] = true
			}

		}
	}

	var ans string
	if res != 1 {
		ans = "not coprime"
	} else if isPC {
		ans = "pairwise coprime"
	} else {
		ans = "setwise coprime"
	}

	fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func NextStr() string {
	scanner.Scan()
	return scanner.Text()
}

func NextInt() int {
	i, _ := strconv.Atoi(NextStr())
	return i
}

func Gcd(x, y int) int {
	if x < y {
		x, y = y, x
	}
	for y > 0 {
		x, y = y, x%y
	}
	return x
}

func SqrtInt(x int) float64 {
	float_x := float64(x)
	return math.Sqrt(float_x)
}

func Sieve(n int) []int {
	var isPrime [2000000 + 5 + 1]bool
	D := make([]int, 2000000+5+1)
	for i := 0; i < len(D); i++ {
		D[i] = i
	}

	for i := 0; i <= n; i++ {
		isPrime[i] = true
	}

	isPrime[0] = false
	isPrime[1] = false

	for i := 2; i <= n; i++ {
		if isPrime[i] {

			for j := 2 * i; j <= n; j += i {
				isPrime[j] = false
				D[j] = i
			}
		}
	}
	return D
}

func PrimeFactorization(n int, D []int) []int {
	var primes []int
	for n > 1 {
		prime := D[n]
		primes = append(primes, prime)
		for D[n] == prime {
			n /= prime
		}
	}
	return primes
}

func Contains(n int, A []int) bool {
	for _, e := range A {
		if n == e {
			return true
		}
	}
	return false
}

const MaxA = 1000000

func main() {

	scanner.Split(bufio.ScanWords)
	D := Sieve(MaxA)

	n := NextInt()
	res := NextInt()

	var AllPrimes []int
	var PrimesCount int
	primes := PrimeFactorization(res, D)
	AllPrimes = append(AllPrimes, primes...)
	PrimesCount += len(primes)

	for i := 0; i < n-1; i++ {
		Ai := NextInt()
		res = Gcd(res, Ai)
		primes := PrimeFactorization(Ai, D)
		PrimesCount += len(primes)
		for _, p := range primes {
			if !Contains(p, AllPrimes) {
				AllPrimes = append(AllPrimes, p)
			}
		}
	}

	var ans string
	if res != 1 {
		ans = "not coprime"
	} else if len(AllPrimes) == PrimesCount {
		ans = "pairwise coprime"
	} else {
		ans = "setwise coprime"
	}

	fmt.Println(ans)
}


END { load __FILE__ unless $stdin.eof? }

require 'prime'

n = gets.to_i
a = gets.split.map!(&:to_i)
b = a.dup

result = true
while b.size > 1
  b = b.each_slice(2).map do |s, t|
    t ||= 1
    break if s.gcd(t) != 1
    s * t
  end

  unless b
    result = false
    break
  end
end

if result
  puts "pairwise coprime"
elsif a.inject(0, :gcd) == 1
  puts "setwise coprime"
else
  puts "not coprime"
end


# frozen_string_literal: true

require 'prime'

n = gets.to_i
a = gets.split.map(&:to_i)

@p = {}

@primes = Prime.each(Math.sqrt(a.max)).to_a

def prime_division(n)
  return @p[n] if @p[n]
  return @p[n] = [n] if n.prime?

  divs = []
  @primes.each do |p|
    break if n == 1

    if n.prime?
      divs.push n
      break
    end
    if (n % p).zero?
      divs.push p
      n /= p while (n % p).zero?
    end
  end
  @p[n] = divs
end

b = Array.new(n + 1, false)
flag = true
a.each do |e|
  prime_division(e).each do |p|
    if b[p]
      flag = false
      break
    end
    b[p] = true
  end
  break unless flag
end

if flag
  puts 'pairwise coprime'
  exit
end

g = a[0]
(1..(n - 1)).each do |i|
  g = g.gcd(a[i])
end

if g == 1
  puts 'setwise coprime'
else
  puts 'not coprime'
end


# frozen_string_literal: true

require 'prime'

n = gets.to_i
a = gets.split.map(&:to_i)

@p = {}

@primes = Prime.each(Math.sqrt(a.max)).to_a

def prime_division(n)
  return @p[n] if @p[n]
  return @p[n] = [n] if n.prime?

  divs = []
  @primes.each do |p|
    break if n == 1

    if n.prime?
      divs.push n
      break
    end
    while (n % p).zero?
      divs.push p
      n /= p
    end
  end
  @p[n] = divs
end

b = Array.new(n + 1, false)
flag = true
a.each do |e|
  prime_division(e).uniq.each do |p|
    if b[p]
      flag = false
      break
    end
    b[p] = true
  end
  break unless flag
end

if flag
  puts 'pairwise coprime'
  exit
end

g = a[0]
(1..(n - 1)).each do |i|
  g = g.gcd(a[i])
end

if g == 1
  puts 'setwise coprime'
else
  puts 'not coprime'
end


n = $stdin.readline.to_i
a = $stdin.readline.chomp.split.map(&:to_i)
m = 10 ** 6
d = Array.new(m + 1)

2.step(m) do |i|
  next if !d[i].nil?

  d[i] = i
  (m / i).times do |j|
    k = (j + 1) * i
    next if !d[k].nil?
    d[k] = i
  end
end

g = a[0]
pc = true
h = Hash.new(true)
n.times do |i|
  g = g.gcd(a[i])
  x = a[i]
  q = []
  while pc && x > 1
    if h[d[x]]
      pc = false
      break
    end

    q << d[x]
    x /= d[x]
  end

  q.uniq.each do |y|
    h[y] = true
  end
end

if pc
  puts "pairwise coprime"
elsif g == 1
  puts "setwise coprime"
else
  puts "not coprime"
end


n = $stdin.readline.to_i
a = $stdin.readline.chomp.split.map(&:to_i)
m = 10 ** 6
d = Array.new(m + 1)

2.step(m) do |i|
  next if !d[i].nil?

  d[i] = i
  (m / i).times do |j|
    k = (j + 1) * i
    next if !d[k].nil?
    d[k] = i
  end
end

g = a[0]
pc = true
h = Hash.new(true)
n.times do |i|
  g = g.gcd(a[i])
  x = a[i]
  q = []
  while pc && x > 1
    if h[d[x]] > 0
      pc = false
      break
    end

    q << d[x]
    x /= d[x]
  end

  q.uniq.each do |y|
    h[y] = true
  end
end

if pc
  puts "pairwise coprime"
elsif g == 1
  puts "setwise coprime"
else
  puts "not coprime"
end


n = $stdin.readline.to_i
a = $stdin.readline.chomp.split.map(&:to_i)
m = 10 ** 6
d = Array.new(m + 1)

2.step(m) do |i|
  next if !d[i].nil?

  d[i] = i
  (m / i).times do |j|
    k = (j + 1) * i
    next if !d[k].nil?
    d[k] = i
  end
end

g = a[0]
pc = true
h = Hash.new(0)
n.times do |i|
  g = g.gcd(a[i])
  x = a[i]
  q = []
  while pc && x > 1
    if h[d[x]] > i + 1
      pc = false
      break
    end

    q << d[x]
    x /= d[x]
  end
  q.uniq.each do |y|
    h[y] += 1
  end
end

if pc
  puts "pairwise coprime"
elsif g == 1
  puts "setwise coprime"
else
  puts "not coprime"
end


#[allow(unused_imports)]
use {
    proconio::{fastout, input, marker::*},
    std::cmp::*,
    std::collections::*,
    std::ops::*,
};

fn gcd(a: usize, b: usize) -> usize {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [usize; n]
    }
    let mut x = a[0];
    for &a in a.iter() {
        x = gcd(x, a);
        if x == 1 {
            break;
        }
    }

    if x != 1 {
        println!("not coprime");
        return;
    }

    let m = *a.iter().max().unwrap();
    let mut exist = vec![false; m + 1];
    for &a in a.iter() {
        if exist[a] && a != 1 {
            println!("setwise coprime");
            return;
        }
        exist[a] = true;
    }

    let mut yet = vec![true; m + 1];
    for i in 2..=m {
        if !yet[i] {
            continue;
        }
        let mut count = 0;
        for j in 1..=m / i {
            yet[i * j] = false;
            if exist[i * j] {
                count += 1;
                if count == 2 {
                    println!("setwise coprime");
                    return;
                }
            }
        }
    }
    println!("pairwise coprime");
}


#![allow(
  non_snake_case,
  unused_variables,
  unused_assignments,
  unused_mut,
  unused_imports,
  unused_macros,
  dead_code
)]
use proconio::fastout;
use proconio::input;
use proconio::marker::*;
use std::cmp::*;
use std::collections::*;
//use std::collections::VecDeque;
macro_rules! debug {
  ($($a:expr),* $(,)*) => {
      #[cfg(debug_assertions)]
      eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
  };
}
#[fastout]
fn main() {
  input! {
    N:usize,
    A:[usize;N]
  }
  let N: usize = N;
  let mut nmax = 1000_000usize;
  let mut h = vec![0usize; nmax + 1];
  for i in 0..N {
    h[A[i]] += 1;
  }
  let mut mx = 0;
  let mut isprime = vec![true; nmax + 1];
  let mut i = 2;
  let mut j = 0;
  let mut f = 0;
  while i <= 1000 {
    if isprime[i] {
      j = i * 2;
      while j <= nmax {
        isprime[j] = false;
        j += i;
      }
    }
    i += 1;
  }
  for i in 2..=nmax {
    if isprime[i] {
      f = 0usize;
      j = i;
      while j <= nmax {
        f += h[j];
        j += i;
      }
      mx = max(mx, f);
    }
  }
  if mx <= 1 {
    println!("pairwise coprime");
    return;
  } else if mx < N {
    println!("setwise coprime");
  } else {
    println!("not coprime")
  }
}


use proconio::input;
extern crate num_integer;

fn usqrt(x: u32) -> u32 {
    (x as f64).sqrt().floor() as u32
}

fn main() {
    input! {
        n: usize,
        a: [u32;n],
    };
    let maxa = *a.iter().max().unwrap();
    let maxp = usqrt(maxa);
    let mut b = Vec::new();
    let mut ps = Vec::new();
    b.push(0);
    b.push(1);
    for i in 2..=maxa {
        let mut x = i;
        for &p in ps.iter() {
            if i % p == 0 {
                x = p;
                break;
            }
        }
        if x == i && x <= maxp {
            ps.push(x);
        }
        b.push(x);
    }
    let mut f = vec![vec![]; n];
    for i in 0..n {
        let mut t = a[i];
        while t != 1 {
            let d = b[t as usize];
            f[i].push(d);
            t /= d;
        }
    }
    let mut pairwise = true;
    for &p in ps.iter() {
        let mut cnt = false;
        for fs in f.iter() {
            if fs.iter().filter(|&&x| p == x).count() >= 1 {
                if cnt {
                    pairwise = false;
                    break;
                } else {
                    cnt = true;
                }
            }
        }
        if !pairwise {
            break;
        }
    }
    if pairwise {
        println!("pairwise coprime");
        return;
    }
    let mut setwise = false;
    let mut g = a[0];
    for i in 1..n {
        g = num_integer::gcd(g, a[i]);
        if g == 1 {
            setwise = true;
            break;
        }
    }
    if setwise {
        println!("setwise coprime");
    } else {
        println!("not coprime");
    }
}


use proconio::input;

fn main() {
    input!(n: usize, a: [usize; n]);

    const AMAX: usize = 1_000_000;

    let mut cnt = vec![0; AMAX + 1];
    for &a in &a {
        cnt[a] += 1;
    }

    let mut seen = vec![false; AMAX + 1];
    let mut max_csum = 0;
    for i in 2..=AMAX {
        if seen[i] {
            continue;
        }
        let mut csum = 0;
        for j in 1..AMAX / i {
            seen[i * j] = true;
            csum += cnt[i * j];
        }
        max_csum = max_csum.max(csum);
    }

    let pairwise = max_csum <= 1;
    let setwise = max_csum < n;

    println!(
        "{}",
        if pairwise {
            "pairwise coprime"
        } else if setwise {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}


use proconio::input;

fn main() {
    input!(n: usize, a: [usize; n]);

    const AMAX: usize = 1_000_000;

    let mut div = vec![0; AMAX + 1];
    for i in 2..=AMAX {
        if div[i] == 0 {
            div[i] = i;
        }
        let j = i + div[i];
        if j <= AMAX && div[j] == 0 {
            div[j] = div[i];
        }
    }

    let mut cnt = vec![0; AMAX + 1];
    for &a in &a {
        cnt[a] += 1;
    }
    for i in (2..=AMAX).rev() {
        if div[i] == i {
            continue;
        }
        let j = i / div[i];
        cnt[j] += cnt[i];
        if div[j] != div[i] {
            cnt[div[i]] += cnt[i];
        }
    }

    let primes = (2..=AMAX).filter(|&i| div[i] == i);
    let pairwise = primes.clone().all(|i| cnt[i] <= 1);
    let setwise = primes.clone().all(|i| cnt[i] < n);

    println!(
        "{}",
        if pairwise {
            "pairwise coprime"
        } else if setwise {
            "setwise coprime"
        } else {
            "not coprime"
        }
    );
}


let N = getInt()
let A = getInts(count: N)

var minFactor = [Int?](repeating: nil, count: Int(1e6)+1)
for i in 2...Int(1e6) {
    guard minFactor[i] == nil else { continue }
    for j in stride(from: i, through: Int(1e6), by: i) {
        minFactor[j] ??= i
    }
}

func gcd(_ a: Int, _ b: Int) -> Int {
    if (b == 0) { return a }
    return gcd(b, a%b)
}

func classify() -> String {
    var allFactors = [Bool](repeating: false, count: Int(1e6)+1)
    var pairwise = true
    outer: for a in A {
        var x = a
        while let f = minFactor[x] {
            if allFactors[f] == true {
                pairwise = false
                break outer
            }
            allFactors[f] = true
            repeat { x /= f } while minFactor[x] == f
        }
    }
    if pairwise == true {
        return "pairwise coprime"
    }
    else if A.reduce(A[0], gcd) == 1 {
        return "setwise coprime"
    }
    else {
        return "not coprime"
    }
}

print(classify())

//=============================================================================
// MARK: - contestIO.swift
// code section by Barry Fam

#if os(Linux)
import Glibc
#else
import Darwin.C
#endif

struct IO {
    static var INPUT = stdin
    fileprivate static var buffer: UnsafeMutablePointer<CChar>?
    fileprivate static var bufferCapacity: Int32 = 0
}

fileprivate func getsToBuffer(size: Int32) -> UnsafeMutablePointer<CChar> {
    if IO.bufferCapacity < size {
        IO.buffer?.deallocate()
        IO.buffer = UnsafeMutablePointer.allocate(capacity: Int(size))
        IO.bufferCapacity = size
    }
    return fgets(IO.buffer!, size, IO.INPUT)
}
fileprivate func getIntFromBuffer(_ ptr: inout UnsafeMutablePointer<CChar>) -> Int {
    var minus = false
    var x: Int?
    while true {
        switch ptr.pointee {
        case 0x2D:
            assert(!minus && x == nil)
            minus = true
        case let d where (0x30...0x39).contains(d):
            x = (x ?? 0)*10 + Int(d)-0x30
        default:
            if x != nil { return minus ? -x! : x! }
            assert(ptr.pointee == 0x20)
        }
        ptr += 1
    }
}

func getString(maxLength: Int) -> String {
    var s = String(cString: getsToBuffer(size: Int32(maxLength + 3)))
    if s.last == "\n" { s.removeLast() }
    if s.last == "\r" { s.removeLast() }
    return s
}
func getInt() -> Int {
    var xPtr = getsToBuffer(size: 24)
    return getIntFromBuffer(&xPtr)
}
func getIntPair() -> (Int, Int) {
    var xPtr = getsToBuffer(size: 2*24)
    let x1 = getIntFromBuffer(&xPtr)
    let x2 = getIntFromBuffer(&xPtr)
    return (x1, x2)
}
func getIntTriplet() -> (Int, Int, Int) {
    var xPtr = getsToBuffer(size: 3*24)
    let x1 = getIntFromBuffer(&xPtr)
    let x2 = getIntFromBuffer(&xPtr)
    let x3 = getIntFromBuffer(&xPtr)
    return (x1, x2, x3)
}
func getIntQuadruplet() -> (Int, Int, Int, Int) {
    var xPtr = getsToBuffer(size: 4*24)
    let x1 = getIntFromBuffer(&xPtr)
    let x2 = getIntFromBuffer(&xPtr)
    let x3 = getIntFromBuffer(&xPtr)
    let x4 = getIntFromBuffer(&xPtr)
    return (x1, x2, x3, x4)
}
func getIntQuintuplet() -> (Int, Int, Int, Int, Int) {
    var xPtr = getsToBuffer(size: 5*24)
    let x1 = getIntFromBuffer(&xPtr)
    let x2 = getIntFromBuffer(&xPtr)
    let x3 = getIntFromBuffer(&xPtr)
    let x4 = getIntFromBuffer(&xPtr)
    let x5 = getIntFromBuffer(&xPtr)
    return (x1, x2, x3, x4, x5)
}
func getIntSextuplet() -> (Int, Int, Int, Int, Int, Int) {
    var xPtr = getsToBuffer(size: 6*24)
    let x1 = getIntFromBuffer(&xPtr)
    let x2 = getIntFromBuffer(&xPtr)
    let x3 = getIntFromBuffer(&xPtr)
    let x4 = getIntFromBuffer(&xPtr)
    let x5 = getIntFromBuffer(&xPtr)
    let x6 = getIntFromBuffer(&xPtr)
    return (x1, x2, x3, x4, x5, x6)
}
func getInts(count: Int) -> [Int] {
    var xPtr = getsToBuffer(size: Int32(count) * 24)
    var a = [Int]()
    a.reserveCapacity(count)
    for _ in 0..<count { a.append(getIntFromBuffer(&xPtr)) }
    return a
}

//=============================================================================
// MARK: - operators.swift
// code section by Barry Fam

infix operator <?= : AssignmentPrecedence
func <?= <T: Comparable>(lhs: inout T, rhs: T) {
    if lhs < rhs { lhs = rhs }
}

infix operator >?= : AssignmentPrecedence
func >?= <T: Comparable>(lhs: inout T, rhs: T) {
    if lhs > rhs { lhs = rhs }
}

infix operator ??= : AssignmentPrecedence
func ??= <T>(lhs: inout T?, rhs: T) {
    if lhs == nil { lhs = rhs }
}


import Foundation

let main: () = {
    let N = nextInt()
    let A = listOfInt()
    let M = 1000005
    var C = IntArray(M)
    A.forEach { C[$0] += 1 }
    var pairwise = true
    for n in 2 ..< M {
        var cnt = 0
        for m in stride(from: n, to: M, by: n) {
            cnt += C[m]
        }
        if cnt > 1 { pairwise = false }
    }
    if pairwise { return print("pairwise coprime") }
    let g = A.reduce(A[0]) { acc, value in gcd(acc, value) }
    if g == 1 { return print("setwise coprime") }
    return print("not coprime")
}()

//----------------------------------

let dx = [1, 0, -1, 0] //[1, 0, -1, 0, -1,  1, -1, 1]
let dy = [0, 1, 0, -1] //[0, 1, 0, -1, -1, -1,  1, 1]

@inlinable func gcd(_ a: Int, _ b: Int) -> Int { (b > 0) ? gcd(b, a % b) : a }
@inlinable func lcm(_ a: Int, _ b: Int) -> Int { a / gcd(a, b) * b }

//----------------------------------

infix operator  =~ : ComparisonPrecedence
infix operator !=~ : ComparisonPrecedence
func =~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { !(right ~= left) }
func =~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { !(right ~= left) }

func =~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { right.contains(left) }
func !=~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { !right.contains(left) }

infix operator /^ : MultiplicationPrecedence
infix operator /^= : AssignmentPrecedence
func /^ <T: FixedWidthInteger>(left: T, right: T) -> T { (left + (right - 1)) / right }
func /^= <T: FixedWidthInteger>(left: inout T, right: T) { left = (left + (right - 1)) / right }

@inlinable func chmax<T: Comparable>(_ m: inout T, _ q: T) { if (m < q) { m = q } }
@inlinable func chmin<T: Comparable>(_ m: inout T, _ q: T) { if (m > q) { m = q } }
@inlinable func chRmax<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m < q) { m = q; return true } else { return false } }
@inlinable func chRmin<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m > q) { m = q; return true } else { return false } }

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T) { (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4], a[5]) }

func printErr(_ str: String, terminator: String = "\n") {
    let s = str + terminator
    FileHandle.standardError.write(s.data(using: .utf8)!)
    FileHandle.standardError.synchronizeFile()
}

@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
@inlinable func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
@inlinable func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
@inlinable func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
@inlinable func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }

extension Int {
    init(s: String) { self.init(s)! }
    var isEven: Bool { self.isMultiple(of: 2) }
    var isOdd: Bool { !self.isEven }
    var isTrue: Bool { self != 0 }
    var isFalse: Bool { !self.isTrue }
    var toString: String { String(self) }
    var toChar: Character { Character(UnicodeScalar(UInt8(self))) }
}
func + (left: Int, right: Bool) -> Int { left + (right ? 1 : 0) }
extension Character {
    var asciiCode: Int { Int(self.asciiValue!) }
    var string: String { String(self) }
}
extension String {
    @inlinable subscript (position: Int) -> Character { self[self.index(self.startIndex, offsetBy: position)] }
    @inlinable func repeate(_ times: Int) -> String { String(repeating: self, count: times) }
    //  @inlinable subscript (n: Int) -> String { String(self[self.index(self.startIndex, offsetBy: n)]) }
    //  @inlinable subscript (n: Int) -> Int { Int(self[self.index(self.startIndex, offsetBy: n)].asciiValue!) }
    var toInt: Int { Int(self)! }
}
extension String { // VB like
    @inlinable func _index(_ position: Int) -> String.Index! {
        if !(0 ..< self.count ~= position) { return nil }
        return self.index(self.startIndex, offsetBy: position)
    }
    @inlinable func mid(from index: Int, length: Int) -> String! {
        if let startPosition = self._index(index) {
            if let endPosition = self._index(index + length - 1) {
                return String(self[startPosition...endPosition])
            } else {
                let endPosition = self.index(before: self.endIndex)
                return String(self[startPosition...endPosition])
            }
        }
        return ""
    }
    @inlinable func left(_ length: Int) -> String { String(self.prefix(length)) }
    @inlinable func right(_ length: Int) -> String { String(self.suffix(length)) }
}

extension Dictionary {
    @inlinable mutating func getOrSet(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored }
        else {
            let newValue = defaultValue()
            self[key] = newValue
            return newValue
        }
    }
    @inlinable mutating func getOrElse(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored } else { return defaultValue() }
    }
    @inlinable func containsKey(_ key: Key) -> Bool { self.keys.contains(key) }
}

extension Set {
    static func += (left: inout Set<Element>, right: Element) { left.insert(right) }
    static func -= (left: inout Set<Element>, right: Element) { left.remove(right) }
}

extension Array {
    static func += (left: inout Array<Element>, right: Element) { left.append(right) }
    init(_ size: Int, _ initValue: ((Int) -> Element)) {
        self = [Element]()
        for index in 0 ..< size {
            let value = initValue(index)
            self.append(value)
        }
    }
    init(_ size: Int, _ initValue: (() -> Element)) {
        self = [Element]()
        for _ in 0 ..< size {
            let value = initValue()
            self.append(value)
        }
    }
}
typealias IntArray = Array<Int>
typealias DoubleArray = Array<Double>
typealias BoolArray = Array<Bool>
typealias StringArray = Array<String>

extension Array where Element == Int {
    init(_ size: Int) {
        self = [Element](repeating: 0, count: size)
    }
}
extension Array where Element == Double {
    init(_ size: Int) {
        self = [Element](repeating: 0.0, count: size)
    }
}
extension Array where Element == Bool {
    init(_ size: Int) {
        self = [Element](repeating: false, count: size)
    }
}
extension Array where Element == String {
    init(_ size: Int) {
        self = [Element](repeating: "", count: size)
    }
}

extension Array {
    @inlinable func count(_ predicate: ((Element) -> Bool)) -> Int {
        var cnt = 0; for e in self { if (predicate(e)) { cnt += 1 } }
        return cnt
    }
    @inlinable func groupBy<K>(_ keySelector: (Element) -> K) -> [K : [Element]] {
        var destination = [K : [Element]]()
        for element in self {
            let key = keySelector(element)
            var list = destination.getOrSet(key) { [Element]() }
            list.append(element)
            destination[key] = list
        }
        return destination
    }
    @inlinable func groupByIndexed<K>(_ keySelector: (Element) -> K) -> [K : [Int]] {
        var destination = [K : [Int]]()
        for element in self.enumerated() {
            let key = keySelector(element.element)
            var list = destination.getOrSet(key) { [Int]() }
            list.append(element.offset)
            destination[key] = list
        }
        return destination
    }
}

extension Array {
    func binarySearch(_ element: Element, by compare: (Element, Element) -> Int, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            let cmp = compare(midVal, element)
            if (cmp < 0) { low = mid + 1 }          //-1
            else if (0 < cmp) { high = mid - 1 }    // 1
            else { return mid } // key found        // 0
        }
        return -(low + 1)  // key not found
    }
}
extension Array where Element : Comparable {
    func binarySearch(_ element: Element, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            if (midVal < element) { low = mid + 1 }
            else if (midVal > element) { high = mid - 1 }
            else { return mid } // key found
        }
        return -(low + 1)  // key not found
    }
}

extension Array where Element == Int {
    @inlinable func distinct() -> [Element] {
        var set = Set<Element>(), ary = [Element]()
        for n in self.indices { if !set.contains(self[n]) { ary.append(self[n]); set.insert(self[n]) } }
        return ary
    }
    @inlinable func any(_ predicate: (Element) -> Bool) -> Bool {
        var any = false; for element in self { if predicate(element) { any = true } }
        return any
    }
    @inlinable func all(_ predicate: (Element) -> Bool) -> Bool {
        self.allSatisfy(predicate)
    }
    @inlinable func sum() -> Element { self.reduce(0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}

extension Array where Element == Double {
    @inlinable func sum() -> Element { self.reduce(0.0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0.0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}
extension Array where Element == String {
    @inlinable func toIntDouble() -> (Int, Double) { (Int(self[0])!, Double(self[1])!) }
    @inlinable func toIntString() -> (Int, String) { (Int(self[0])!, self[1]) }
    @inlinable func toIntIntString() -> (Int, Int, String) { (Int(self[0])!, Int(self[1])!, self[2]) }
}

@inlinable func block( _ action: () -> Void) {
    action()
}
@inlinable func repeate(_ times1: Int, _ action: () -> Void) {
    for _ in 0 ..< times1 { action() }
}
@inlinable func repeate(_ times1: Int, _ action: (Int) -> Void) {
    for index1 in 0 ..< times1 {
        action(index1)
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ action: (Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            action(index1, index2)
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ action: (Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                action(index1, index2, index3)
            }
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ times4: Int, _ action: (Int, Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                for index4 in 0 ..< times4 {
                    action(index1, index2, index3, index4)
                }
            }
        }
    }
}

func measureTimeSeconds(block: (() -> Void)) -> Double {
    let startTime = Date()
    block()
    let duration = -startTime.timeIntervalSinceNow
    return duration
}

struct UnionFind {
    var rank: [Int]
    var par:  [Int]
    var size: [Int]
    init(_ size: Int) {
        self.rank = IntArray(size) { 0 }
        self.par  = IntArray(size) { $0 }
        self.size = IntArray(size) { 1 }
    }
    @discardableResult
    mutating func unite(_ x: Int, _ y: Int) -> Bool {
        var rx = self.root(x)
        var ry = self.root(y)
        if (rx == ry) { return false }
        if (self.rank[rx] < self.rank[ry]) {
            let w = rx
            rx = ry
            ry = w
        } else if (self.rank[rx] == self.rank[ry]) {
            self.rank[rx] += 1
        }
        self.par[ry] = rx
        self.size[rx] += self.size[ry]
        return true
    }
    mutating func find(_ x: Int) -> Int {
        if (self.par[x] == x) { return x }
        else {
            self.par[x] = self.find(self.par[x])
            return self.par[x]
        }
    }
    mutating func isSame(_ x: Int, _ y: Int) -> Bool { self.root(x) == self.root(y) }
    mutating func size(_ x: Int) -> Int { self.size[self.find(x)] }
    mutating func root(_ x: Int) -> Int { self.find(x) }
}


import Foundation

// MARK: READ INPUTS

func readInt() -> Int {
    Int(readLine()!)!
}

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

// MARK: DP

struct DP<Argument: Hashable, Element> {
    var dictionary = [Argument: Element]()

    var expression: (Argument, (Argument) -> Element) -> Element

    init(expression: @escaping (_ argument: Argument, _ note: (Argument) -> Element) -> Element) {
        self.expression = expression
    }

    subscript(_ argument: Argument) -> Element {
        mutating _read {
            if let note = dictionary[argument] {
                yield note
            } else {
                let result = expression(argument) { self[$0] }
                dictionary[argument] = result
                yield result
            }
        }
    }
}

// MARK: SOME EXTENSIONS

extension Dictionary {
    init(_ initialize: (inout Self) -> ()) {
        var dictionary = Self()
        initialize(&dictionary)
        self = dictionary
    }
}

extension SignedNumeric where Self: Comparable {
    var abs: Self {
        return self < .zero ? -self : self
    }
}

extension String {
    init(_ text: String, code: Int) {
        self = "\u{1b}[\(code)m" + text + "\u{1b}[0m"
    }
}

extension Collection {
    func tuple() -> (Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!)
    }
    func tuple() -> (Element, Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!, i.next()!)
    }
    func tuple() -> (Element, Element, Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!, i.next()!, i.next()!)
    }

    func safe(at index: Index) -> Element? {
        self.indices.contains(index) ? self[index] : nil
    }
}

// MARK: MOD

@propertyWrapper
struct Mod {

    let base: Int
    private var store: Int

    var value: Int {
        get { return store }
        set {
            store = newValue % base
            if store < 0 { store += base }
        }
    }

    static var defaultBaseNumber = 1_000_000_007

    init(_ value: Int, base: Int = defaultBaseNumber) {
        self.base = base
        self.store = value % base
        if store < 0 { self.store += base }
    }

    private init(unchecked value: Int, base: Int = defaultBaseNumber) {
        self.store = value
        self.base = base
    }

    init(wrappedValue: Int, base: Int = defaultBaseNumber) {
        self = .init(wrappedValue, base: base)
    }

    var wrappedValue: Int {
        get { return value }
        set { value = newValue }
    }

    var projectedValue: Int { base }
}

extension Mod: ExpressibleByIntegerLiteral {
    init(integerLiteral value: Int) {
        self = .init(value)
    }
}

extension Mod: AdditiveArithmetic, SignedNumeric {

    private static func assert(_ a: Mod, _ b: Mod) {
        Swift.assert(b.base == b.base, "Base should be same number .")
    }

    private static func operate(_ f: @escaping (Int, Int) -> Int) -> (Mod, Mod) -> Mod {
        return { lhs, rhs in
            assert(lhs, rhs)
            let num = f(lhs.value, rhs.value)
            return Mod(num, base: lhs.base)
        }
    }

    static func + (lhs: Mod, rhs: Mod) -> Mod { operate(+)(lhs, rhs) }
    static func - (lhs: Mod, rhs: Mod) -> Mod { operate(-)(lhs, rhs) }
    static func * (lhs: Mod, rhs: Mod) -> Mod { operate(*)(lhs, rhs) }
    static func *= (lhs: inout Mod, rhs: Mod) { lhs = lhs * rhs }

    init?<T>(exactly source: T) where T : BinaryInteger {
        guard let int = Int(exactly: source) else { return nil }
        self = Mod(int)
    }

    var magnitude: Int { value.abs }
}

extension Mod: CustomStringConvertible {
    var description: String {
        let digit = String(base).count
        let string = String(format: "%\(digit)d", value)
        return "Mod(\(string), base: \(base))"
    }
}

extension Mod: Equatable, Comparable {
    static func == (lhs: Mod, rhs: Mod) -> Bool {
        assert(lhs, rhs)
        return lhs.value == rhs.value
    }

    static func < (lhs: Mod, rhs: Mod) -> Bool {
        assert(lhs, rhs)
        return lhs.value < rhs.value
    }
}

extension Mod: Hashable {
    func hash(into hasher: inout Hasher) {
        hasher.combine(base)
        hasher.combine(value)
    }
}

extension Mod: Strideable {
    typealias Stride = Int

    func distance(to other: Mod) -> Int {
        return (other - self).value
    }

    func advanced(by n: Int) -> Mod {
        return self + Mod(n, base: base)
    }
}

// MARK: UNION FIND

struct UnionFind {
    var par: [Int]
    init(n: Int) {
        self.par = Array(0...n)
    }

    mutating func root(_ x: Int) -> Int {
        if par[x] == x { return x }
        par[x] = root(par[x])
        return par[x]
    }

    mutating func unite(_ x: Int, _ y: Int) {
        let rx = root(x), ry = root(y)
        if rx == ry { return }
        par[rx] = ry
    }

    mutating func same(_ x: Int, _ y: Int) -> Bool {
        let rx = root(x), ry = root(y)
        return rx == ry
    }

    mutating func size() -> Int {
        var dic = [Int: Int]()
        for i in par {
            dic[root(i), default: 0] += 1
        }
        return dic.values.max() ?? 0
    }
}

extension UnionFind: CustomStringConvertible {
    var description: String { "UnionFind(\(par))" }
}

// MARK: EUCLID
func euclid(_ x: Int, _ y: Int) -> Int {
    var x = x, y = y
    while y != 0 {
        (x, y) = (y, x%y)
    }
    return x
}

/// - Note: O(n)
func euclid(_ x: Int, _ y: Int, _ others: Int...) -> Int {
    var result = euclid(x, y)
    for i in others {
        result = euclid(result, i)
        if result == 1 { break }
    }
    return result
}

/// - Note: O(n)
func euclid(array: [Int]) -> Int {
    guard let first = array.first else { return 1 }
    var result = first
    for i in array {
        result = euclid(result, i)
        if result == 1 { break }
    }
    return result
}

// MARK: SIEVE of ERATOSTHENES
extension Int {
    /// - NOTE: O(n^2)
    func primeFactors() -> Set<Int> {
        guard self > 1 else { return [] }
        var x = self
        let primes = PrimeStore[x]

        // self.isPrime
        if primes.last ?? 0 == x { return [x] }

        var result = Set<Int>()
        for prime in primes {
            while x.isMultiple(of: prime) {
                result.insert(prime)
                x /= prime
            }
            if x == 1 { break }
        }
        return result
    }

    func isPrime() -> Bool {
        PrimeStore[self].last ?? 0 == self
    }
}

// MARK: PRIME
struct PrimeStore {
    private static var primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
    private static var searched = 100

    /// - NOTE: O(n^2)
    static subscript(_ x: Int) -> [Int] {
        if x <= searched {
            return primes.prefix(while: { $0 <= x })
        }

        var array = Array(searched...x)
        for prime in primes {
            array.removeAll(where: { $0.isMultiple(of: prime) })
        }
        while let prime = array.first {
            primes.append(prime)
            array.removeAll(where: { $0.isMultiple(of: prime) })
        }
        return primes
    }
}

// MARK: -- MAIN

func problem_c(_ an: [Mod]) -> Int {
    var res = Mod(0)
    var sum = an.reduce(0, +)
    for i in an {
        sum -= i
        res += i * sum
    }
    return res.value
}

func heavy_problem_c(_ an: [Mod]) -> Int {
    var res = Mod(0)
    for i in an.indices {
        let under = an[i]
        for j in 0..<i {
            let upper = an[j]
//            print(under.value, "*", upper.value, "=", (under * upper).value)
            res += under * upper
        }
    }
    return res.value
}

func problem_d(n: Int, data: [(Int, Int)]) -> Int {
    var unionFind = UnionFind(n: n)
    for (x, y) in data {
        unionFind.unite(x, y)
    }

    return unionFind.size()
}

enum Coprime: String {
    case pairwise = "pairwise coprime",
         setwise  = "setwise coprime",
         none     = "not coprime"
}

func problem_e(_ an: [Int]) -> Coprime {
    let primes = an.map { $0.primeFactors() }.joined()
    if primes.count == Set(primes).count { return .pairwise }

    // O(n)
    if euclid(array: an) == 1 { return .setwise }

    return .none
}

func heavy_problem_e(_ an: [Int]) -> Coprime {
    let isPairwise = an.map { i in
        an.map { j in i == j || euclid(i, j) == 1 }
    }.joined().allSatisfy { $0 }
    if isPairwise { return .pairwise }
    if euclid(array: an) == 1 { return .setwise }
    return .none
}

func main() {
    let _ = readInt()
    let an = readInts()
    print(problem_e(an).rawValue)
}

func test(_ n: Int = 10) {
    func judge<T: Equatable>(_ answer: T, expected: T) {
        let success = "SUCCESS: \(answer)"
        let failed  = "FAILED:  \(answer) (expected \(expected))"
        print(answer == expected ? success : String(failed, code: 31))
    }
    func readInput(_ text: String) -> [Int] {
        text.split(separator: "\n")[1].split(separator: " ").map { Int($0)! }
    }

    print("\nexample ===================")
    let ex1 = problem_e(readInput("""
        3
        3 4 5
    """))
    judge(ex1, expected: .pairwise)
    let ex2 = problem_e(readInput("""
        3
        6 10 15
    """))
    judge(ex2, expected: .setwise)
    let ex3 = problem_e(readInput("""
        3
        6 10 16
    """))
    judge(ex3, expected: .none)

    print("\nborder ====================")

    print("\nrandom ====================")
    for _ in 0..<n {
//        let ans = problem_c(an)
//        let hev = heavy_problem_c(an)
//        printResult(ans, expected: hev)
    }
}

main()