
import * as fs from 'fs';
import { parse } from 'path';

function calcPrimeList(max: number) {
  const list = [2, 3];
  for (let i = 5; i < max; i += 2) {
    let isPrime = true;
    for (let n of list) {
      if (i % n === 0) {
        isPrime = false;
        break;
      }
    }
    if (isPrime) {
      list.push(i);
    }
  }
  return list;
}

function main(input) {
  input = input.split("\n");
  const N = parseInt(input[0]);
  const AList = input[1].split(' ').map(i => parseInt(i));
  const AMax = 10 ** 6;
  const primeMax = Math.sqrt(AMax);
  const primeList = calcPrimeList(primeMax);
  const primeCheckList = new Array(primeList.length).fill(0);
  for (let n of AList) {
    for (let pidx in primeList) {
      const prime = primeList[pidx];
      if (n % prime === 0) {
        primeCheckList[pidx]++;
      }
    }
  }
  const max = primeCheckList.reduce((prev, current) => prev > current ? prev : current);
  let ans = 'pairwise coprime';
  if (max === N) {
    ans = 'not coprime'
  } else if (max > 1) {
    ans = 'setwise coprime'
  }
  console.log('%s', ans);
}

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