PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000121. Phân loại nguyên tố cùng nhau (Coprime)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Phân loại nguyên tố cùng nhau (Coprime)

Coprime

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integers a1,…,ana_1,\ldots,a_n, the array is pairwise coprime if gcd⁡(ai,aj)=1\gcd(a_i,a_j)=1 for every i<ji<j. If not pairwise coprime but the GCD of the whole array is 11, it is setwise coprime. Otherwise it is not coprime. Print the corresponding exact phrase.

Input

The first line contains nn, the second nn integers aia_i.

Output

Print exactly one of pairwise coprime, setwise coprime, and not coprime.

Subtasks

  • Subtask 1 (20 points): 2≤n≤602\le n\le 60; 1≤ai≤2001\le a_i\le 200.
  • Subtask 2 (30 points): 2≤n≤20 0002\le n\le 20\,000; 1≤ai≤20 0001\le a_i\le 20\,000.
  • Subtask 3 (50 points): 2≤n≤1 000 0002\le n\le 1\,000\,000; 1≤ai≤1 000 0001\le a_i\le 1\,000\,000.

Examples

Input

3
6 10 15

Output

setwise coprime

Explanation

Since gcd⁡(6,10)=2\gcd(6,10)=2 the array is not pairwise coprime; its overall GCD is 1, so it is setwise coprime.