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

//#pragma gcc optimize("O3,unroll-loop")
//#pragma gcc target("sse,sse2,sse3,ssse3,sse4,avx,avx2,fma,abm,mmx,popcnt,tune=native")
//#define int long long
//#define double long double

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

    int n;
    cin >> n;

    int gcd = 0;
    vector<int> v(n);
    for (int &i : v)
        cin >> i, gcd = __gcd(gcd, i);

    if (gcd != 1)
        cout << "not coprime\n", exit(0);

    int pfac[1001];
    vector<int> prime;
    for (int i = 2; i <= 1000; i++)
        pfac[i] = 1;
    for (int i = 2; i <= 1000; i++)
    {
        if (pfac[i] == 1)
            prime.push_back(i);
        for (int j : prime)
        {
            if (i * j > 1000)
                break;
            pfac[i * j] = j;
            if (i % j == 0)
                break;
        }
    }

    for (int i : prime)
    {
        int cnt = 0;
        for (int &j : v)
            if (j % i == 0)
            {
                cnt++;
                while (j % i == 0)
                    j /= i;
            }

        if (cnt >= 2)
            cout << i << '\n', cout << "setwise coprime\n", exit(0);
    }
    sort(v.begin(), v.end());
    for (int i = 1; i < n; i++)
        if (v[i] == v[i - 1])
            cout << "setwise coprime\n", exit(0);
    cout << "pairwise coprime\n";

    return 0;
}

//      *   *  *****  *   *  *   *   ****  ****    ****     **    **
//     *   *  *      **  *  *   *  *      *   *  *        * *   * *
//    *****  *****  * * *  *   *  *      ****   *       *  *     *
//   *   *      *  *  **  *   *  *      *  *   *       *****    *
//  *   *  *****  *   *   ***    ****  *   *    ****     *   *****

//      *****  *****  *   *  *      *****  *   *  *****  *****
//        *   *   *  *   *  *        *    **  *    *    *   *
//       *   *   *  *****  *        *    * * *    *    *****
//   *  *   *   *    *    *        *    *  **    *    *
//  ****   *****    *    *****  *****  *   *    *    *
