#![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,
    A:[usize;N]
  }
  let N: usize = N;
  let mut nmax = 1000_000usize;
  let mut h = vec![0usize; nmax + 1];
  for i in 0..N {
    h[A[i]] += 1;
  }
  let mut mx = 0;
  let mut isprime = vec![true; nmax + 1];
  let mut i = 2;
  while i * i <= nmax {
    if isprime[i] {
      let mut j = 2;
      while i * j <= nmax {
        isprime[i * j] = false;
        j += 1;
      }
      let mut f = 0usize;
      let mut j = i * 2;
      while j <= nmax {
        f += h[j];
        j += i;
      }
      mx = max(mx, f);
    }
    i += 1;
  }
  let mut pflag = true;
  for p in i + 1..=nmax {
    if isprime[p] {
      let mut f = 0usize;
      let mut j = p * 2;
      while j <= nmax {
        f += h[j];
        j += p;
      }
      mx = max(mx, f);
    }
  }
  if mx <= 1 {
    println!("pairwise coprime");
    return;
  } else if mx < N {
    println!("setwise coprime");
  } else {
    println!("not coprime")
  }
}
