stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define REP(i,p,n) for(ll i=p;i<ll(n);++i)

#define rep(i,n) REP(i,0,n)



using ll = long long;

using pll = pair<ll, ll>;



const ll MAXN = 1000001;

bool P[MAXN];

bool S[MAXN];



template<typename T> T gcdraw(T a, T b) { return a ? gcdraw(b%a, a) : b; }

template<typename T> T gcd(T a, T b)

{

    const auto aa = abs(a), bb = abs(b);

    return aa > bb ? gcdraw(aa, bb) : gcdraw(bb, aa);

}



int main()

{

    ll N;

    cin >> N;



    vector<ll> A(N);

    rep (i, N) { cin >> A[i]; }



    vector<ll> PS = { 1, 2 };

    for (ll i=3;i*i<=MAXN;i+=2) if (!P[i])

    {

        for (ll j=2*i;j<=MAXN;j+=i) { P[j] = true; }

        PS.emplace_back(i);

    }



    bool isPairwise = true;



    ll cur = A[0];



    for (ll i=0;i<N;++i)

    {

        if (isPairwise) for (const auto& p: PS)

        {

            if (A[i] < p * p) { break; }

            if (A[i] % p) { continue; }



            const auto x = p;

            const auto y = A[i] / p;



            if (x != 1 && S[x]) { isPairwise = false; }

            if (y != 1 && S[y]) { isPairwise = false; }



            S[x] = true;

            S[y] = true;

        }



        cur = gcd(cur, A[i]);

    }



    const auto isSetwise = cur == 1;



    if (isPairwise)     { cout << "pairwise coprime" << endl; }

    else if (isSetwise) { cout << "setwise coprime" << endl; }

    else                { cout << "not coprime" << endl; }



    return 0;

}


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

using namespace std;



#define REP(i,p,n) for(ll i=p;i<ll(n);++i)

#define rep(i,n) REP(i,0,n)



using ll = long long;

using pll = pair<ll, ll>;



const ll MAXN = 1000001;

bool P[MAXN];

bool S[MAXN];



template<typename T> T gcdraw(T a, T b) { return a ? gcdraw(b%a, a) : b; }

template<typename T> T gcd(T a, T b)

{

    const auto aa = abs(a), bb = abs(b);

    return aa > bb ? gcdraw(aa, bb) : gcdraw(bb, aa);

}



int main()

{

    ll N;

    cin >> N;



    vector<ll> A(N);

    rep (i, N) { cin >> A[i]; }



    vector<ll> PS = { 1, 2 };

    for (ll i=3;i*i<=MAXN;i+=2) if (!P[i])

    {

        for (ll j=2*i;j*j<=MAXN;j+=i) { P[j] = true; }

        PS.emplace_back(i);

    }



    bool isPairwise = true;



    ll cur = A[0];



    for (ll i=0;i<N;++i)

    {

        if (isPairwise) for (const auto& p: PS)

        {

            if (A[i] < p * p) { break; }

            if (A[i] % p) { continue; }



            const auto x = p;

            const auto y = A[i] / p;



            if (x != 1 && S[x]) { isPairwise = false; }

            if (y != 1 && S[y]) { isPairwise = false; }



            S[x] = true;

            S[y] = true;

        }



        cur = gcd(cur, A[i]);

    }



    const auto isSetwise = cur == 1;



    if (isPairwise)     { cout << "pairwise coprime" << endl; }

    else if (isSetwise) { cout << "setwise coprime" << endl; }

    else                { cout << "not coprime" << endl; }



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);

  sort(A.begin(), A.end());

  bool diff1 = 0;

  for (long i = 1; i < N; i++) {

    if (A.at(i) - A.at(i - 1) == 1) diff1 = 1;

  }



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) B = 0;

      cnt.at(b) += c;

    }

  }

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }



  if (G == 1) return cout << "setwise coprime" << "\n", 0;



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

}


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

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) {

        B = 0;

        goto NG;

      }

      cnt.at(b)++;

    }

  }

  NG:;

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}


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

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);

  sort(A.begin(), A.end());

  bool diff1 = 0;

  for (long i = 1; i < N; i++) {

    if (A.at(i) - A.at(i - 1) == 1) diff1 = 1;

  }



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) B = 0;

      cnt.at(b) += c;

    }

  }

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }



  if (G == 1) return cout << "setwise coprime" << "\n", 0;



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

}


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

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n";

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

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) {

        B = 0;

        goto NG;

      }

      cnt.at(b)++;

    }

  }

  NG:;

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}


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

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n";

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

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);

  sort(A.begin(), A.end());

  bool diff1 = 0;

  for (long i = 1; i < N; i++) {

    if (A.at(i) - A.at(i - 1) == 1) diff1 = 1;

  }



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) B = 0;

      cnt.at(b) += c;

    }

  }

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }



  if (G == 1) return cout << "setwise coprime" << "\n", 0;



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

}


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

using namespace std;



map<long, int> pf(long n) {

  map<long, int> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (int i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }

  if (G >= 2) return cout << "not coprime" << "\n", 0;



  vector<int> V(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (V.at(a)) return cout << "setwise coprime" << "\n", 0;

      else V.at(a)++;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) {

        B = 0;

        goto NG;

      }

      cnt.at(b)++;

    }

  }

  NG:;

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}


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

using namespace std;



map<long, int> pf(long n) {

  map<long, int> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (int i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }

  if (G >= 2) return cout << "not coprime" << "\n", 0;



  vector<int> V(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (V.at(a)) return cout << "setwise coprime" << "\n", 0;

      else V.at(a)++;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}


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

using namespace std;



map<long, int> pf(long n) {

  map<long, int> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (int i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }

  if (G >= 2) return cout << "not coprime" << "\n", 0;



  vector<int> V(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (V.at(a)) return cout << "setwise coprime" << "\n", 0;

      else V.at(a)++;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n";

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

}


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

using namespace std;



map<long, int> pf(long n) {

  map<long, int> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (int i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }

  if (G >= 2) return cout << "not coprime" << "\n", 0;



  vector<int> V(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (V.at(a)) return cout << "setwise coprime" << "\n", 0;

      else V.at(a)++;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);

  sort(A.begin(), A.end());

  bool diff1 = 0;

  for (long i = 1; i < N; i++) {

    if (A.at(i) - A.at(i - 1) == 1) diff1 = 1;

  }



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) B = 0;

      cnt.at(b) += c;

    }

  }

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) {

    G = gcd(G, A.at(i));

  }



  if (G == 1) return cout << "setwise coprime" << "\n", 0;



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

}


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

using namespace std;



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (auto a : A) G = gcd(G, a);

  if (G > 1) return cout << "not coprime" << "\n", 0;



  auto pf = [&](long n) {

    map<long, int> ret;

    for (long i = 2; i * i <= n; i++) {

      while (n % i == 0) ret[i]++, n /= i;

    }

    if (n != 1) ret[n]++;

    return ret;

  };



  vector<bool> B(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (B.at(a)) return cout << "setwise coprime" << "\n", 0;

      else B.at(a) = true;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<long, long> pf(long n) {

  map<long, long> ma;

  for (long i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  long N;

  cin >> N;

  vector<long> A(N);

  for (long i = 0; i < N; i++) cin >> A.at(i);



  bool B = 1;

  vector<long> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) {

        B = 0;

        goto NG;

      }

      cnt.at(b)++;

    }

  }

  NG:;

  if (B) return cout << "pairwise coprime" << "\n", 0;



  long G = 0;

  for (long i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}


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

using namespace std;



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (auto a : A) G = gcd(G, a);

  if (G > 1) return cout << "not coprime" << "\n", 0;



  auto pf = [&](long n) {

    map<long, int> ret;

    for (long i = 2; i * i <= n; i++) {

      while (n % i == 0) ret[i]++, n /= i;

    }

    if (n != 1) ret[n]++;

    return ret;

  };



  vector<bool> B(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (B.at(a)) return cout << "setwise coprime" << "\n", 0;

      else B.at(a) = true;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n", 0;

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

}


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

using namespace std;



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (auto a : A) G = gcd(G, a);

  if (G > 1) return cout << "not coprime" << "\n", 0;



  auto pf = [&](long n) {

    map<long, int> ret;

    for (long i = 2; i * i <= n; i++) {

      while (n % i == 0) ret[i]++, n /= i;

    }

    if (n != 1) ret[n]++;

    return ret;

  };



  vector<bool> B(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (B.at(a)) return cout << "setwise coprime" << "\n", 0;

      else B.at(a) = true;

    }

  }

  cout << "pairwise coprime" << "\n";

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



map<int, int> pf(int n) {

  map<int, int> ma;

  for (int i = 2; i * i <= n; i++) {

    while (n % i == 0) ma[i]++, n /= i;

  }

  if (n != 1) ma[n]++;

  return ma;

}



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  vector<int> cnt(1e6+1);

  for (auto a : A) {

    for (auto [b, c] : pf(a)) {

      if (cnt.at(b)) goto NG;

      cnt.at(b)++;

    }

  }

  return cout << "pairwise coprime" << "\n", 0;

  NG:;

  int G = 0;

  for (int i = 0; i < N; i++) G = gcd(G, A.at(i));

  if (G == 1) cout << "setwise coprime" << "\n";

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

}


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

using namespace std;



int main() {

  cin.tie(nullptr);

  ios_base::sync_with_stdio(false);

  

  int N;

  cin >> N;

  vector<int> A(N);

  for (int i = 0; i < N; i++) cin >> A.at(i);



  int G = 0;

  for (auto a : A) G = gcd(G, a);

  if (G > 1) return cout << "not coprime" << "\n", 0;



  auto pf = [&](long n) {

    map<long, int> ret;

    for (long i = 2; i * i <= n; i++) {

      while (n % i == 0) ret[i]++, n /= i;

    }

    if (n != 1) ret[n]++;

    return ret;

  };



  vector<bool> B(1e6+1);

  for (int i = 0; i < N; i++) {

    for (auto [a, b] : pf(A.at(i))) {

      if (B.at(a)) return cout << "setwise coprime" << "\n", 0;

      else B.at(a) = true;

    }

  }

  cout << "pairwise coprime" << "\n";

}