use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [usize; n]
    };

    let mut a: Vec<usize> = a;
    let mut not_prime_count = 0;
    a.sort();

    let mut flag = true;

    for i in 0..n {
        if !(prime(a[i])) {
            not_prime_count += 1;
            if not_prime_count >= 2 {
                flag = false;
                break;
            }
        }

        if i < n - 1 {
            if a[i] == a[i + 1] && a[i] != 1 {
                flag = false;
            }
        }
    }

    if flag {
        println!("pairwise coprime");
    } else {
        let mut g = gdg(a[0], a[1]);
        if n >= 2 {
            for i in 2..n {
                g = gdg(g, a[i]);
            }
        }

        if g == 1 {
            println!("setwise coprime");
        } else {
            println!("not coprime");
        }
    }
}

fn gdg(a: usize, b: usize) -> usize {
    let mut a = a;
    let mut b = b;

    if a > b {
        let tmp = a;
        a = b;
        b = tmp;
    }

    let mut r = a % b;

    while r != 0 {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

fn prime(a: usize) -> bool {
    if a < 2 {
        true
    } else if a % 2 == 0 {
        false
    } else {
        let sqrt_a = ((a as f64).sqrt()) as usize + 1;
        let mut flag = true;

        let mut i = 3;
        while i <= sqrt_a {
            if a % i == 0 {
                flag = false;
                break;
            }
            i += 2;
        }

        if flag {
            true
        } else {
            false
        }
    }
}
