Harryxun/stf_run huggingface dataset:
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
sys.setrecursionlimit(10**6)

from fractions import Fraction

mod = 10**9+7

n = ni()
a = na()
b,c = 1,0

def lcm(m,n):
    return (m*n)//Fraction.gcd(m,n)

for i in a:
    b=lcm(b,i)

for i in a:
    c+=b//i

print(c%mod)

### FIXED CODE ###

import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
sys.setrecursionlimit(10**6)
from fractions import gcd

mod = 10**9+7

n = ni()
a = na()
b,c = 1,0

def lcm(m,n):
    return (m*n)//gcd(m,n)

for i in a:
    b=lcm(b,i)

for i in a:
    c+=b//i

print(c%mod)
# encoding:utf-8
import math

def main():
	N, K = list(map(int, input().split()))
	nums = list(map(int, input().split()))

	max_num = max(nums)
	min_num = min(nums)

	# 最大値が越えてたらだめ
	if K > max_num:
		return("IMPOSSIBLE")

	gcd_val = gcdList(nums)

	if K % gcd_val > 0:
			return("IMPOSSIBLE")
	else:
		return("POSSIBLE")

def gcdList(nums):
	tmp = nums[0]
	for x in nums[1:]:
		tmp = math.gcd(tmp, x)
	return(tmp)

if __name__ == '__main__':
	print(main())

### FIXED CODE ###

import functools as ft

def gcd(a,b):
    while b > 0:
        a, b = b, a % b
    return a

def main():
	N, K = list(map(int, input().split()))
	nums = list(map(int, input().split()))

	max_num = max(nums)
	g = ft.reduce(lambda x, y: gcd(x, y), nums)

	if K <= max_num and K % g == 0:
		print("POSSIBLE")
	else:
		print("IMPOSSIBLE")

if __name__ == '__main__':
	main()
import math
n=int(input())
l=[0]
b=0
for i in range(1,n,1):
  if n%i==0 and n/i>=i:
    a=i+(n/i)
    l.append(a)
  else:
    b+=1
    
c=min(l)  
print(c-2)

    
    
    


### FIXED CODE ###

a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print("-1")
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
if x=2 or y=2:
  print("No")
for v in a:
  if x=v:
    for w in a:
      if w =y:
        print("Yes")
for v in b:
  if x=v:
    for w in b:
      if w =y:
        print("Yes")
else:
  print("No")
    

### FIXED CODE ###

x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
if (x in a) and (y in a):
  print("Yes")
elif (x in b) and (y in b):
  print("Yes")
elif (x in c) and (y in c):
  print("Yes")
else:
  print("No")
n=int(input())
for i in range(n//4+1):
    for j in range(n//7+1):
        if 4*i+7*j==n:
            ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
d=0
for i in range(n//4+1):
    for j in range(n//7+1):
        if 4*i+7*j==n:
            d+=1
print("Yes" if d!=0 else "No")
import math

def make_divisors(n):
	divisors = []
	for i in range(1, int(n**0.5)+1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n//i)
	return divisors

num = int(input())
print(make_divisors(math.factorial(num)) % (pow(10,9) + 7))

### FIXED CODE ###

import math
import collections

def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    factor.append(n)
    return factor

n = int(input())
c = collections.Counter([])
for num in range(2, n+1):
  prime_list = trial_division(num)
  c.update(prime_list)
res = 1
for prime, count in c.most_common():
  if(prime > 1):
    res = res * (count + 1)
print(res % (pow(10,9) + 7))
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

signed main(){
    ll A,B,C,D;cin>>A>>B>>C>>D;
    //i番目はi個の列or行を選んでる
    vector<map<pair<ll,ll>,ll>> dp((D+C)-(B+A)+1);
    dp[0][MP(A,B)]=1;
    //dp[1][MP(A+1,B)]=B;
    //dp[1][MP(A,B+1)]=A;
    REP(i,(D+C)-(B+A)){
        for(auto j=dp[i].begin();j!=dp[i].end();j++){
            ll a,b;a=j->F.F;b=j->F.S;
            dp[i+1][MP(a,b+1)]+=(dp[i][MP(a,b)]*(a));
            dp[i+1][MP(a+1,b)]+=(dp[i][MP(a,b)]*(b));
            //cout << a << " " << b << " " << j->S << endl;
        }
        #if 1
        if(i==0)continue;
        for(auto j=dp[i+1].begin();j!=dp[i+1].end();j++){
            ll a,b;a=j->F.F;b=j->F.S;
            if(a!=A and b!=B){
                dp[i+1][MP(a,b)]-=(dp[i-1][MP(a-1,b-1)]*(a-1)*(b-1));
            }
        }
        #endif
    }
    cout<<dp[(D+C)-(B+A)][MP(C,D)]<<endl; 
    #if 0
    REP(i,(D+C)-(B+A)+1){
        for(auto j=dp[i].begin();j!=dp[i].end();j++){
            ll a,b;a=j->F.F;b=j->F.S;
            cout << a << " " << b << " " << j->S << endl;
        }
    }
    #endif
}

### FIXED CODE ###

a,b,c,d=map(int,input().split());x=range(c+d);D=[[0]*6011for _ in[0]*6011];D[a][b]=1
for i in x:
 for j in x:D[i+1][j+1]+=(D[i+1][j]*(i+1)+D[i][j+1]*(j+1)-D[i][j]*i*j)%998244353
print(D[c][d])
n,x,m=map(int,input().split())
a=list()
ans=0
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
for i in range(s, len(a)):
    sum+=a[i]

ans+=sum*(((n-s)//(len(a)-s))-1)

z=(n-s)%(len(a)-s)
for i in range(z):
    ans+=a[s+i]
print(ans)


### FIXED CODE ###

n,x,m=map(int,input().split())
a=list()
ans=0
s=n
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
if s!=n:
    for i in range(s, len(a)):
        sum+=a[i]   

if len(a)>s:
    ans+=sum*(((n-s)//(len(a)-s))-1)

    z=(n-s)%(len(a)-s)
    if z!=0:
        for i in range(z):
            ans+=a[s+i]
print(ans)
L = []
for i in range(5):
    L.append(int(input()))

L1 = [x for x in L if x%10 == 0]
L2 = [x for x in L if x%10 != 0]
L3 = [(x%10,x//10) for x in L2]

ans = sum(L1)
L3.sort(reverse = True)

for i in range(len(L3)-1):
    ans += (L3[i][1]+1)*10
ans += L3[-1][1]*10+L3[-1][0]
print(ans) 

### FIXED CODE ###

L = []
for i in range(5):
    L.append(int(input()))

L1 = [x for x in L if x%10 == 0]
L2 = [x for x in L if x%10 != 0]
L3 = [(x%10,x//10) for x in L2]

ans = sum(L1)
if len(L3)>0:
  L3.sort(reverse = True)
  for i in range(len(L3)-1):
    ans += (L3[i][1]+1)*10
  ans += L3[-1][1]*10+L3[-1][0]
print(ans)
nums = input().spilt(" ")
num1 = int(nums[0])
num2 = int(nums[1])
if num2 % num1 == 0:
  print(num1+num2)
else:
  print(num2-num1)

### FIXED CODE ###

nums = input().split(" ")
num1 = int(nums[0])
num2 = int(nums[1])
if num2 % num1 == 0:
  print(num1+num2)
else:
  print(num2-num1)
n, k = map(int, input().split())
h = list(map(int, [input() for i in range(n)]))
h.sort()
res = 10**10
for i in range(k-1, n):
    res = min(res, h[i]-[i-k+1])
print(res)

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, [input() for i in range(n)]))
h.sort()
res = 10**10
for i in range(k-1, n):
    res = min(res, h[i]-h[i-k+1])
print(res)
map(input, N)
sum = lambda i :sum+i for i in str(N)
if sum/9 print "Yes" else "No"

### FIXED CODE ###

def sum_i(N):
    return sum(list(int(i) for i in str(N)))


print("No") if sum_i(input()) % 9 else print("Yes")
a,b=map(int,input().split())
L=[[] for i in range(a)]
u=0
# i番目の県の情報（[i，年，入力順]）をLのi番目に入れる
for i in range(b):
    u+=1
    c=list(map(int,input().split()))
    c.append(u)
    L[int(c[0])-1].append(c)
# Lの要素を年でソート
for i in L:
    i.sort(key=lambda x:x[1])
#　ソートしたので、要素ごとに何番目にできたかを末尾に付け加えておく
for i in L:
    e=0
    for j in i:
        e+=1
        j.append(e)
q=[]
for w in L:
   q.extend(w) #flatten
q.sort(key=lambda x:x[2])　#入力順に並べ替えて、入力した順に出力できるようにする
for r in range(b):
        print(str(q[r][0]).zfill(6)+str(q[r][3]).zfill(6))　#zfill

### FIXED CODE ###

a,b=map(int,input().split())
L=[[] for i in range(a)]
u=0
for i in range(b):
    u+=1
    c=list(map(int,input().split()))
    c.append(u)
    L[int(c[0])-1].append(c)
for i in L:
    i.sort(key=lambda x:x[1])
for i in L:
    e=0
    for j in i:
        e+=1
        j.append(e)
q=[]
for w in L:
   q.extend(w) 
q.sort(key=lambda x:x[2])
for r in range(b):
        print('0'*(6-len(str(q[r][0])))+str(q[r][0])+'0'*(6-len(str(q[r][3])))+str(q[r][3]))
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

c = Counter(A)
hen = [(key, val) for key, val in c.items() if val > 1]

l = max(hen) if hen else 0
if l != 0:
    if c[l] > 3:
        s = l
    else:
        hen.remove(l)
        s = max(hen) if hen else 0
else:
    s = 0

print(l * s)


### FIXED CODE ###

from collections import Counter

N = int(input())
A = list(map(int, input().split()))

c = Counter(A)
hen = [key for key, val in c.items() if val > 1]

l = max(hen) if hen else 0
if l != 0:
    if c[l] > 3:
        s = l
    else:
        hen.remove(l)
        s = max(hen) if hen else 0
else:
    s = 0

print(l * s)
def abc175c_walking_takahashi():
    x, k, d = map(int, input().split())
    x = -x if x < 0 else x
    num = math.ceil(x / d)
    if num > k:
        print(x-k*d)
        return
    else:
        k -= num
        x -= num*d
        if k % 2 == 0:
            print(abs(x))
        else:
            print(x+d)
abc175c_walking_takahashi()

### FIXED CODE ###

import math

def abc175c_walking_takahashi():
    x, k, d = map(int, input().split())
    x = -x if x < 0 else x
    num = math.ceil(x / d)
    if num > k:
        print(x-k*d)
        return
    else:
        k -= num
        x -= num*d
        if k % 2 == 0:
            print(abs(x))
        else:
            print(x+d)
abc175c_walking_takahashi()
"x,y,z" = map(int,input(),split())
print(z,y,x)

### FIXED CODE ###

a, b, c = map(int, input().split())
print(c, a, b)
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(M)]

connect_list = [set() for _ in range(N)]    #繋がっているリスト
root_list = [0]*N
root_list[0] = "Yes"


def do_ranking(now_set):
    global connect_list, root_list
    if len(now_set) == 0:
        return 0
    next_set = set()
    for j in list(now_set):
        if j-1 >= N:
            break
        for i in list(connect_list[j-1]):
            if i-1 >= N:
                break
            if root_list[i-1] == 0:
                root_list[i-1] = j
                next_set.add(i)
    do_ranking(next_set)


for A, B in AB:
    connect_list[A-1].add(B)
    connect_list[B-1].add(A)
    
for i in list(connect_list[0]):
    root_list[i-1] = 1
do_ranking(connect_list[0])   #道しるべ作成

for i in root_list:
    print(i)

### FIXED CODE ###

N, M = map(int, input().split())
connect_list = [set() for _ in range(N)]    #繋がっているリスト
for _ in range(M):
    A, B = map(int, input().split())
    connect_list[A-1].add(B)
    connect_list[B-1].add(A)

root_list = [0]*N
root_list[0] = "Yes"

for i in list(connect_list[0]):
    root_list[i-1] = 1
now_set = connect_list[0]
while len(now_set) != 0:
    for j in list(now_set):
        for i in list(connect_list[j-1]):
            if root_list[i-1] == 0:
                root_list[i-1] = j
                now_set.add(i)
        now_set.remove(j)

for i in root_list:
    print(i)
# https://atcoder.jp/contests/abc075/tasks/abc075_c
class UnionFind():
    def __init__(self, N):
        self._root = [-1 for _ in range(N)]

    def find(self, x):
        if self._root[x] < 0: return x
        self._root[x] == self.find(self._root[x])
        return self._root[x]

    def unite(self, x, y):
        gx = self.find(x)
        gy = self.find(y)
        if gx == gy: return False
        if self._root[gx] > self._root[gy]:
            gx, gy = gy, gx
        self._root[gx] += self._root[gy]
        self._root[gy] = gx
        return True

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -(self._root[self.find(x)])

    def roots(self):
        return [i for i in self._root) if i < 0]


n, m = map(int, input().split())

nodes = []
for _ in range(m):
    a, b = map(int, input().split())
    nodes.append((a, b))

cnt = 0
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i == j: continue
        uf.unite(nodes[j][0]-1, nodes[j][1]-1)
    cnt += (len(uf.roots()) != 1)
print(cnt)

### FIXED CODE ###

# https://atcoder.jp/contests/abc075/tasks/abc075_c
class UnionFind():
    def __init__(self, N):
        self._root = [-1 for _ in range(N)]

    def find(self, x):
        if self._root[x] < 0: return x
        self._root[x] = self.find(self._root[x])
        return self._root[x]

    def unite(self, x, y):
        gx = self.find(x)
        gy = self.find(y)
        if gx == gy: return False
        if self._root[gx] > self._root[gy]:
            gx, gy = gy, gx
        self._root[gx] += self._root[gy]
        self._root[gy] = gx
        return True

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -(self._root[self.find(x)])

    def roots(self):
        return [i for i in self._root if i < 0]


n, m = map(int, input().split())

nodes = []
for _ in range(m):
    a, b = map(int, input().split())
    nodes.append((a, b))

cnt = 0
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i != j:
          uf.unite(nodes[j][0]-1, nodes[j][1]-1)
    cnt += (len(uf.roots()) != 1)
print(cnt)
import math

N = int(input())
memo = [0]*(N+1)
memo[0] = 0

for i in range(1,N+1):
	memo[i] = memo[i-1]+1
	for j in range(1,iny(math.log(i,6))+1):
		memo[i] = min(memo[i],memo[i-pow(6,j)]+1)
	for j in range(1,int(math.log(i,9))+1):
		memo[i] = min(memo[i],memo[i-pow(9,j)]+1)

print(memo[-1])


### FIXED CODE ###

import math

N = int(input())
memo = [0]*(N+1)
memo[0] = 0

for i in range(1,N+1):
	memo[i] = memo[i-1]+1
	j = 1
	while pow(6,j) <= i:  
		memo[i] = min(memo[i],memo[i-pow(6,j)]+1)
		j += 1
	j = 1
	while pow(9,j) <= i:
		memo[i] = min(memo[i],memo[i-pow(9,j)]+1)
		j += 1

print(memo[-1])
def resolve():
    H, W = map(int, input().split())
    A, white = [], []
    for i in range(H):
        A.append(list(input()))
        if '.' in A[i]:
            for j in range(W):
                if A[i][j] == '.':
                    white.append([i, j])

    dy = [0, 1, 0, -1]
    dx = [1, 0, -1, 0]
    cnt = 0

    # 各白マスから黒マスまでの最短距離を探索し，その最大値を出力
    for sy, sx in white:
        dis = [[float('inf')] * W for _ in range(H)]
        dis[sy][sx] = 0
        q = deque([(sy, sx)])
        update = False
        while q:
            y, x = q.popleft()
            for i in range(4):
                ny = y + dy[i]
                nx = x + dx[i]
                if (1
                        and 0 <= ny < H
                        and 0 <= nx < W
                        and dis[ny][nx] == float('inf')):
                    dis[ny][nx] = dis[y][x] + 1
                    q.append((ny, nx))
                    if A[ny][nx] == '#':
                        cnt = max(dis[ny][nx], cnt)
                        update = True
            if update:
                break
    print(cnt)


if __name__ == "__main__":
    resolve()

### FIXED CODE ###

from collections import deque


def resolve():
    H, W = map(int, input().split())
    A, q = [], deque([])
    for i in range(H):
        A.append(list(input()))
        if '#' in A[i]:
            for j in range(W):
                if A[i][j] == '#':
                    q.append((i, j))

    dy = [0, 1, 0, -1]
    dx = [1, 0, -1, 0]
    cnt = -1

    # 1回目で各黒マスを拡張して，2回目以降は拡張した黒マスから拡張してく
    nq = deque([])
    while q:
        y, x = q.popleft()
        for i in range(4):
            ny = y + dy[i]
            nx = x + dx[i]
            if 0 <= ny < H and 0 <= nx < W and A[ny][nx] == '.':
                nq.append((ny, nx))
                A[ny][nx] = '#'
        if q == deque([]):
            q = nq
            nq = deque([])
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    resolve()
root = [i for i in range(N + 1)]
size = [1] * (N + 1)
 
def find(x):
  y = root[x]
  if x == y:
    return x
  else:
    z = find(y)
    root[x] = z
    return z

def union(x, y):
  rx = find(x)
  ry = find(y)
  sx = size[rx]
  sy = size[ry]
  if rx == ry:
    return 0
  else:
    if sx >= sy:
      root[ry] = rx
      size[rx] = sx + sy
    else:
      root[rx] = ry
      size[ry] = sx + sy
    return sx * sy

### FIXED CODE ###

N = int(input())

print(-(-N // 2))
#標準入力
H, W = map(int, input().split())
grid = []
for i in range(H):
    tmp = input()
    grid.append(tmp)

#グリッドの縦横を別々に調べる
import numpy
grid_int = [[0] * W for i in range(H)]
grid_int = np.array(grid_int)
for i in range(H):
    count = 0
    for j in range(W):
        if grid[i][j] == '.':
            count += 1
            if j == W - 1:
                for l in range(count):
                    grid_int[i][j-l] = count
        elif grid[i][j] == '#':
            if j == 0:
                continue
            for k in range(count):
                grid_int[i][j- k - 1] = count
            count = 0


for j in range(W):
    count = 0
    for i in range(H):
        if grid[i][j] == '.':
            count += 1
            if i == H - 1:
                for m in range(count):
                    grid_int[i - m][j] += count
        elif grid[i][j] == '#':
            if i == 0:
                continue
            for k in range(count):
                grid_int[i-k-1][j] += count
            count = 0

ans = 0
for i in range(H):
    tmp_max = max(grid_int[i]) - 1
    if ans < tmp_max:
        ans = tmp_max
print(ans)

### FIXED CODE ###

#import sys
#input = sys.stdin.buffer.readline
import numpy as np

def main():
    H,W = map(int,input().split())
    S = np.array([list(input()) for _ in range(H)]) == '.' #'.'に一致するならTrueしなければFalse

    up = np.zeros((H,W), dtype=int)
    down = np.zeros((H,W), dtype=int)
    left = np.zeros((H,W), dtype=int)
    right = np.zeros((H,W), dtype=int)
    
    for i in range(H-1):
        up[i+1,:] = (up[i,:] + 1) * S[i,:] #npの変数名[k,l]でk行l列を取り出す
    for i in range(H-1):                   #:なら全部をそれぞれについて見ていく
        down[H - 2 - i,:] = (down[H - 1 - i,:] + 1) * S[H - 1 - i,:]
    for i in range(W-1):
        left[:,i+1] = (left[:,i] + 1) * S[:,i]
    for i in range(W-1):
        right[:,W - 2 - i] = (right[:,W - 1 - i] + 1) * S[:,W - 1 - i]
        
    print(((up+down+left+right)*S).max()+1) #カケザンデ要素ごとの掛け算可能
    
if __name__ == "__main__":
    main()
a,b=map(int,raw_input().split())

if a<b:
  print 'a < b'
else if a>b:
  print 'a > b'
else:
  print 'a == b'

### FIXED CODE ###

a,b=map(int,raw_input().split())

if a>b:
  print 'a > b'
elif a<b:
  print 'a < b'
else:
  print 'a == b'
import sys

N, M = map(int, input().split())

S = []
C = []
for m in range(M):
  s, c = map(int, input().split())
  S.append(s)
  C.append(c)

for i in range(10**(N-1)-1, 10**N):
  tes = str(i)
  flag = True
  for s, c in zip(S, C):
    if tes[s-1] != str(c):
      flag = False
  if flag:
    print(tes)
    sys.exit()

print(-1)

### FIXED CODE ###

import sys
N, M = map(int, input().split())

A = [-1] * N

for i in range(M):
  s, c = map(int, input().split())
  if A[s-1] != c and A[s-1] != -1:
    print(-1)
    sys.exit()
  else:
    A[s-1] = c
  
if N >= 2 and A[0] == 0:
  print(-1)
  sys.exit()

res = 0

for i in range(N):
  if A[i] == -1:
    if i == 0 and N >= 2:
      A[i] = 1
    else:
      A[i] = 0
  res += A[i] * 10 ** (N-i-1)

print(res)
import math as mt
n=int(input())
l=list(map(int,input().split()))
gd=l[0]
sv=[0]*(10**6+1)
for i in range(2,len(sv)+1):
  if not sv[i]:
    sv[i]=i
    for j in range(2*i,len(sv),i):
      sv[j]=i
an="not coprime"
for i in range(n):
      gd=mt.gcd(gd,l[i])
if gd!=1:
	print(an)
else:
    an="setwise coprime"
    pos=1
    vis=[0]*(10**6+2)
    for i in range(n):
      cr=l[i]
      while cr>1:
          dv=sv[cr]
          if vis[dv]:
            pos=0;break
          while cr%dv==0:
            cr//=dv
          vis[dv]=1
    if pos:
      an="pairwise coprime"
    print(an)


### FIXED CODE ###

import math as mt
n=int(input())
l=list(map(int,input().split()))
gd=l[0]
sv=[0]*(10**6+1)
for i in range(2,len(sv)):
  if not sv[i]:
    sv[i]=i
    for j in range(2*i,len(sv),i):
      sv[j]=i
an="not coprime"
for i in range(n):
      gd=mt.gcd(gd,l[i])
if gd!=1:
	print(an)
else:
    an="setwise coprime"
    pos=1
    vis=[0]*(10**6+2)
    for i in range(n):
      cr=l[i]
      while cr>1:
          dv=sv[cr]
          if vis[dv]:
            pos=0;break
          while cr%dv==0:
            cr//=dv
          vis[dv]=1
    if pos:
      an="pairwise coprime"
    print(an)
# coding: utf-8

def linecheck(x1, y1, x2, y2, xp, yp):
	if yp - y1 > (xp - x1) * (y2 - y1) / (x2 - x1):
		return 1
	elif yp - y1 < (xp - x1) * (y2 - y1) / (x2 - x1):
		return -1

while True:
	try:
		x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split())
		if x1 == x2:
			if (x1 < xp and xp < x3) or (x1 > xp and xp > x3):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x3, y3, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		elif x2 == x3:
			if (x1 < xp and xp < x3) or (x1 > xp and xp > x3):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x1, y1, x3, y3, xp, yp)
		elif x3 == x1:
			if (x1 < xp and xp < x2) or (x1 > xp and xp > x2):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		else:
			judge = linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x1, y1, x3, y3, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		if judge > 0:
			print("YES")
		elif judge < 0:
			print("NO")
	except EOFError:
		break

### FIXED CODE ###

# coding: utf-8

while True:
	try:
		x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split())
#		print(x1)
#		print(x2)
#		print(x3)
#		print(y1)
#		print(y2)
#		print(y3)

		xg = 1./3 * (x1 + x2 + x3)
		yg = 1./3 * (y1 + y2 + y3)
#		print("xg = {:}, yg = {:}".format(xg, yg))
		
		def line(xi, yi, xj, yj, x, y):
			return (yi-yj)*x/(xi-xj) + (xi*yj-xj*yi)/(xi-xj)
		
		if x1 != x2:
			def line12(x, y):
				if y < line(x1, y1, x2, y2, x, y):
#					print("2")
					return 2
				elif y > line(x1, y1, x2, y2, x, y):
#					print("3")
					return 3
				else:
#					print("0")
					return 0
		else:
			def line12(x, y):
				if x1 < x:
#					print("2")
					return 2
				elif x1 > x:
#					print("3")
					return 3
				else:
#					print("0")
					return 0

		if x2 != x3:
			def line23(x, y):
				if y < line(x2, y2, x3, y3, x, y):
#					print("5")
					return 5
				elif y > line(x2, y2, x3, y3, x, y):
#					print("7")
					return 7
				else:
#					print("0")
					return 0
		else:
			def line23(x, y):
				if x2 < x:
#					print("5")
					return 5
				elif x2 > x:
#					print("7")
					return 7
				else:
#					print("0")
					return 0

		if x1 != x3:
			def line13(x, y):
				if y < line(x1, y1, x3, y3, x, y):
#					print("11")
					return 11
				elif y > line(x1, y1, x3, y3, x, y):
#					print("13")
					return 13
				else:
#					print("0")
					return 0
		else:
			def line13(x, y):
				if x1 < x:
#					print("11")
					return 11
				elif x1 > x:
#					print("13")
					return 13
				else:
#					print("0")
					return 0

		if line12(xp, yp)*line23(xp, yp)*line13(xp, yp) == line12(xg, yg)*line23(xg, yg)*line13(xg, yg):
			print("YES")
		else:
			print("NO")

	except EOFError:
		break