#![allow(
  non_snake_case,
  unused_variables,
  unused_assignments,
  unused_mut,
  unused_imports,
  unused_macros,
  dead_code
)]
use proconio::fastout;
use proconio::input;
use proconio::marker::*;
use std::cmp::*;
use std::collections::*;
//use std::collections::VecDeque;

macro_rules! debug {
  ($($a:expr),* $(,)*) => {
      #[cfg(debug_assertions)]
      eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
  };
}
#[fastout]
fn main() {
  input! {
    N:usize,
    mut A:[usize;N]
  }
  //A.sort();
  //A.dedup();
  //let isremoved = N > A.len();
  //let N: usize = N;
  //if N == 1 {
  //  println!("not coprime");
  //  return;
  //}
  let nmax = 1000_000usize;
  let mut mx = 0usize;
  let mut isprime = vec![true; nmax + 1];
  let mut devider = vec![0; nmax + 1];
  let mut f = vec![vec![0usize; nmax + 1]; N];
  isprime[0] = false;
  isprime[1] = false;
  let mut i = 2;
  while i * i <= nmax {
    if isprime[i] {
      let mut j = 2;
      devider[i] = i;
      while i * j <= nmax {
        isprime[i * j] = false;
        devider[i * j] = i;
        j += 1;
      }
    }
    i += 1;
  }
  for i in 0..N {
    let mut v = A[i];
    let mut p = devider[v];
    f[i][p] += 1;
    while v > p {
      v /= p;
      p = devider[v];
      f[i][p] = 1;
    }
  }
  for p in 0..=nmax {
    if isprime[p] {
      let mut g = 0;
      for i in 0..A.len() {
        g += f[i][p];
      }
      mx = max(mx, g)
    }
  }
  if mx <= 1 {
    println!("pairwise coprime")
  } else if mx < N {
    println!("setwise coprime");
  } else {
    println!("not coprime")
  }
}
