// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <iostream>

using namespace std;

const int maxn = 1e6 + 5;

int vis[maxn], prime[maxn], notPrime[maxn], num[maxn];

int total, n, maxx = 0, ans = 0, tmp;

void getPrime(int sum) {

    for (int i = 2; i <= sum; i++) {

        if (!notPrime[i]) {

            prime[++total] = i;

        }

        for (int j = 1; prime[j] * i <= sum; j++) {

            notPrime[i * prime[j]] = prime[j];

            if (i % prime[j] == 0)

                break;

        }

    }

}



void getInit() {

    memset(vis, 0, sizeof(vis));

    memset(notPrime, 0, sizeof(notPrime));

    memset(vis, 0, sizeof(vis));

}



int main() {

    getInit();

    scanf("%d", &n);

    for (int i = 1; i <= n; i++) {

        scanf("%d", &num[i]);

        maxx = max(maxx, num[i]);

    }

    getPrime(maxx);

    for (int i = 1; i <= n; i++) {

        while (notPrime[num[i]]) {

            tmp = notPrime[num[i]];

            vis[tmp]++;

            ans = max(ans, vis[tmp]);

            while (num[i] % tmp == 0)

                num[i] /= tmp;

        }

        if (num[i] != 1) {

            vis[num[i]]++;

            ans = max(ans, vis[num[i]]);

        }

    }

    if (ans <= 1)

        printf("pairwise coprime\n");

    else if (ans < n)

        printf("setwise coprime\n");

    else

        printf("not coprime\n");

    getchar();

    getchar();

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 9.284844007329603x):
    #include <bits/stdc++.h>

    using namespace std;

    typedef long long ll;

    #define FAST ios_base::sync_with_stdio(false);cin.tie(0);

    const double EPS = 1e-9;

    const double PI = acos(-1);

    const int knightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};

    //const int dx[]={0,0,0,1,1,1,-1,-1,-1};

    //const int dy[]={-1,0,1,-1,0,1,-1,0,1};

    const int dx[] = {0 , 1 , 0 , -1};

    const int dy[] = {1 , 0 , -1 , 0};

    //#define MOD         1000000007LL

    #define MAX         1000005

    const ll MOD = 1000000000 + 7;

    int arr[MAX] , n ;

    int fact[MAX];

    

    bool pairwise()

    {

        

        for(int i = 0 ; i < n ; i++)

        {

            int x = arr[i];

            for(int j = 1 ; j * j <= x ; j++)

            {

                if(x % j == 0)

                {

                    fact[j]++;

                    if(j > 1 && fact[j] >= 2)return false;

                    if(x / j != j)

                    {

                        fact[x / j]++;

                        if(fact[x / j] >= 2)return false;

                    }

                }

            }

        }

        

        return true;

    }

    

    bool setwise()

    {

        int ans = arr[0];

        

        for(int i = 1 ; i < n ; i++)

        {

            ans = __gcd(ans , arr[i]);

            

        }

        if(ans != 1)return false;

        return true;

    }

    

    int main()

    {

        FAST

        int t;

        t = 1;



        while(t--)

        {

           

           cin >> n;

           

           for(int i = 0 ;  i < n ; i++)cin >> arr[i];

        

           if(pairwise())cout << "pairwise coprime\n";

           else if(setwise())cout << "setwise coprime\n";

           else cout << "not coprime\n";

        }

    }