#include <bits/stdc++.h>
using namespace std;
void Print2DVector(vector<vector<int>>& v) {
  unsigned long long i, j;
  for (i = 0; i < v.size(); i++) {
    for (j = 0; j < v[i].size(); j++) {
      cout << v[i][j];
      if (j == v[i].size() - 1) {
        cout << endl;
      } else {
        cout << " ";
      }
    }
  }
}
void PrintVector(vector<int>& v) {
  unsigned long long i;
  for (i = 0; i < v.size(); i++) {
    cout << v[i];
    if (i == v.size() - 1) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
}
void PrintArr(int* a, unsigned long long N) {
  unsigned long long i;
  for (i = 0; i < N; i++) {
    cout << a[i];
    if (i == N - 1) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
}
void PreProcessTables() {
  unsigned long long i, j;
  for (i = 0; i < 0; i++) {
    for (j = 0; j < 0; j++) {
      break;
    }
    break;
  }
}
int find(int* st, int a) {
  if (a == st[a]) {
    return a;
  } else {
    st[a] = find(st, st[a]);
    return st[a];
  }
}
void unite(int* st, int* sz, int a, int b) {
  a = find(st, a);
  b = find(st, b);
  if (a == b) {
    return;
  }
  if (sz[a] < sz[b]) {
    int t = a;
    a = b;
    b = t;
  }
  st[b] = a;
  sz[a] += b;
  sz[b] = 0;
}
void TC(int t) {
  int N;
  cin >> N;
  int A[N];
  vector<int> primes;
  map<int, vector<int>> m;
  {
    bool sieve[1000001] = {
        false,
    };
    for (int i = 2; i < 1000001; i += (i > 2) ? 2 : 1) {
      if (!sieve[i]) {
        primes.push_back(i);
        for (int j = 2 * i; j < 1000001; j += i) {
          sieve[j] = true;
        }
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int mn = 1, mx = 1;
  for (int i = 0; i < N; i++) {
    for (int j : primes) {
      if (j > A[i] || A[i] == 1) {
        break;
      }
      if (A[i] % j == 0) {
        if (m.find(j) == m.end()) {
          m[j] = {i};
        } else {
          mx = 0;
          m[j].push_back(i);
          if (m[j].size() == N) {
            mn = 0;
          }
        }
        while (A[i] % j == 0) {
          A[i] /= j;
        }
      }
    }
  }
  if (mx == 1) {
    cout << "pairwise coprime" << endl;
  } else if (mn == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
}
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  PreProcessTables();
  int T = 1, t;
  for (t = 1; t <= T; t++) {
    TC(t);
  }
  return 0;
}
