Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

H, W = map(int, input().split())
S = [int(input()) for _ in range(W)]
    
floor = list(range(0,H+1))
 
if S.count(1) >0:
	floor[1]=0
	floor[2]=1
	if S.count(2) >0:
		floor[2]=0
elif S.count(2) >0:
	floor[1]=1
	floor[2]=0
 
teiou = [0]*H
for i in range (0, H):
	teiou[i] = S.count(i)
    
for i in range (3, H+1):
		floor[i]=floor[i-2]*(1-teiou[i-2])+floor[i-1]*(1-teiou[i-1])

print(floor[H]%(10**9+7))

### FIXED CODE ###

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

A = []

for i in range (0, M):
	A.append(int(input()))


if N == 1:
	print(1)
	exit()
elif N ==2:
	if len(A) ==1:
		print(1)
	else:
		print(2)
	exit()

DP = [0]*N

if A.count(1)==0:
	DP[0] = 1

if A.count(2)==0:
	if A.count(1)==0:
		DP[1] = 2
	else:
		DP[1] = 1

for i in range (0, M):
	DP[A[i]-1] = -1

for i in range (0, 2):
	if DP[i] == -1:
		DP[i] = 0

for i in range (2, N):
	if DP[i] ==-1:
		DP[i] = 0
	else:
		DP[i] = DP[i-1] + DP[i-2]

print(DP[-1]%(1000000007))
### BUGGY CODE ###

h,w,m = map(int, input().split())
row = [0]*(h+1)
rn = [[] for _ in range(h+1)]
col = [0]*(w+1)
cn = [[] for _ in range(w+1)]
data = []
for _ in range(m):
  hd,wd = map(int, input().split())
  row[hd] += 1
  rn[hd].append(wd)
  col[wd] += 1
  cn[wd].append(hd)

cm = max(col)
rm = max(row)
ri = [x for x,y in enumerate(row) if y == rm]
ci = [x for x,y in enumerate(col) if y == cm]
ans = -1
for c in ci:
  for r in ri:
    if c not in rn[r]:
      ans = max(ans,cm+rm)
      print(ans)
      exit()
    else:
      ans = max(ans,cm+rm-1)
print(ans)

### FIXED CODE ###

h,w,m = map(int, input().split())
row = [0]*(h+1)
rn = [[] for _ in range(h+1)]
col = [0]*(w+1)
cn = [[] for _ in range(w+1)]
data = []
for _ in range(m):
  hd,wd = map(int, input().split())
  row[hd] += 1
  rn[hd].append(wd)
  col[wd] += 1
  cn[wd].append(hd)

cm = max(col)
rm = max(row)
ri = [x for x,y in enumerate(row) if y == rm]
ci = [x for x,y in enumerate(col) if y == cm]
for r in ri:
  rs = set(rn[r])
  for c in ci:
    if c not in rs:
      ans = cm+rm
      print(ans)
      exit()
ans = cm+rm-1
print(ans)
### BUGGY CODE ###

N=int(input())
ans=[]
cnt=0
for _ in range(N):
    str_list=input()
    dic={}
    for i in range(10):
        if str_list[i] in dic:
            dic[str_list[i]]+=1
        else:
            dic[str_list[i]]=1
    ans.append(dic)
while len(ans)>1: 
    cnt+=ans.count(ans.pop(0))
print(cnt) 

### FIXED CODE ###

#ABC137_C
from collections import Counter
N=int(input())
S=[input() for i in range(N)]

ctr=Counter()
ans=0

for s in S:
    a=''.join(sorted(list(s)))
    if a in ctr:
        ans+=ctr[a]
    ctr[a]+=1
print(ans)
### BUGGY CODE ###

a,b,x=map(int,input().split())
ans=0
for i in range(a,b+1):
    if i%x==0:
        ans+=1
print(ans)

### FIXED CODE ###

a,b,x=map(int,input().split())
if a%x==0:
    print(b//x-(a-1)//x)
else:
    print(b//x-a//x)
### BUGGY CODE ###

import array
from copy import deepcopy

n = int(input())
a = []
for i in range(n):
  a.append(int(input()))

a = array.array('i',a)
           
for i in range(0,len(a)):
  ax = deepcopy(a)
  del a[i]

  print(max(a))
  a = deepcopy(ax)
  

  #  if 1+i<=len(a):
#    print('i:' ,i)
#    print(max(a[i],a[i+1]))

        
#print(max(a[0],a[-1]   )   )  

### FIXED CODE ###

n = int(input())
a = []
x = 0
x_max = 0
for _ in range(n):
  x = int(input())
#  if x_max 
  a.append(x)

b = a.copy()  
b.sort(reverse=True)
a_max1 = b[0]
a_max2 = b[1] 

for i in a:
  if i == a_max1:
    print(a_max2)
  else:
    print(a_max1)
### BUGGY CODE ###

import sys
input=sys.stdin.readline
n=int(input())
cnt=[0]*3
for i in map(int,input().split()):
    cnt[i-1]+=1
c1,c2,c3=cnt
DP=[[[0]*(n+1) for _ in range(n+1)] for _ in range(n+1)] 
DP[0][0][0]=0
for i in range(c3+1):
    for j in range(c3+c2-i+1):
        for k in range(n-i-j+1):
            if i==j==k==0:
                continue
            tmp=n
            if i:
                tmp+=DP[k][j+1][i-1]*i
            if j:
                tmp+=DP[k+1][j-1][i]*j
            if k:
                tmp+=DP[k-1][j][i]*k
            DP[k][j][i]=tmp/(i+j+k)
print(DP[c1][c2][c3])

### FIXED CODE ###

import sys
input=sys.stdin.readline
from collections import Counter
n=int(input())
A=tuple(input().split())
C=Counter(A)
c1,c2,c3=[C[s] for s in ('1','2','3')]
DP=[[[0.0]*(n+1) for _ in range(n+1)] for _ in range(n+1)]
for i in range(c3+1):
    for j in range(c3+c2-i+1):
        for k in range(n-i-j+1):
            if i==j==k==0:
                continue
            tmp=n
            if i>0:
                tmp+=DP[k][j+1][i-1]*i
            if j>0:
                tmp+=DP[k+1][j-1][i]*j
            if k>0:
                tmp+=DP[k-1][j][i]*k
            DP[k][j][i]=tmp/(i+j+k)
print(DP[c1][c2][c3])
### BUGGY CODE ###

N = int(input())
X = str(input())

from functools import lru_cache


def popcount(bits: str):
    return len([elm for elm in bits if elm == '1'])


cache = dict()

@lru_cache(maxsize=1000000)
def f(num):
    if num == 0:
        return 0
    else:
        # if not cache.get(num % pc, None) is None:
        #     return cache[num % pc]
        pc = popcount('{:b}'.format(num))
        ret = 1 + f(num % pc)
        # cache[num % pc] = ret
        return ret


def reverse_bit(bits: str, digit):
    def toggle(a):
        if a == '1':
            return '0'
        else:
            return '1'

    ret = list(bits)
    ret[digit-1] = toggle(bits[digit-1])
    return ''.join(ret)

def convert(x: str):
    ans = 0
    i = 0
    for elm in list(x)[::-1]:
        if elm == '1':
            ans += 2 ** i
        i += 1
    return ans


answers = {}

for i in range(1, N+1):
    bits = reverse_bit(X, i)
    # pc = popcount(bits)
    # print(f'# {bits} {convert(bits)} {pc}')
    x = convert(bits)
    if not answers.get(x, None) is None:
        print(answers[x])
        continue
    ret = f(x)
    answers[x] = ret
    print(ret)

### FIXED CODE ###

n = int(input())
# for i in range(n):
#     print('0', end='')
# print(flush=True)
s = input()
x = int(s, base=2)
popcount = s.count('1')
y_zero = x % (popcount + 1)
if popcount > 1:
    y_one = x % (popcount - 1)
dp = [-1] * n
dp[0] = 0
 
 
def calc(y):
    if dp[y] != -1:
        return dp[y]
    dp[y] = 1 + calc(y % bin(y).count('1'))
    return dp[y]
 
 
ans = [0] * n
rem_zero = 1
if popcount > 1:
    rem_one = popcount - 2
for i in range(n):
    if s[n - 1 - i] == '0':
        ans[n - 1 - i] = 1 + calc((y_zero + rem_zero) % (popcount + 1))
    elif popcount > 1:
        ans[n - 1 - i] = 1 + calc((y_one + rem_one) % (popcount - 1))
    else:
        ans[n - 1 - i] = 0
    rem_zero = rem_zero * 2 % (popcount + 1)
    if popcount > 1:
        rem_one = rem_one * 2 % (popcount - 1)
for i in range(n):
    print(ans[i])
### BUGGY CODE ###

def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

S=input()
N=len(S)

remainder=[0]*2019
for i in range(1,N+1):
  s=S[-i:]
  s=int(s)
  remainder[s%2019]+=1

ans=remainder[0]
for i in range(2019):
  if remainder[i]<=1:
    continue
  else:
    ans+=comb(remainder[i],2)
print(ans)

### FIXED CODE ###

S=input()
N=len(S)
M=2019

remainder=[0]*M
val=0
for i in range(N):
  val=(int(S[N-1-i])*pow(10,i,M)+val)%M
  remainder[val]+=1

ans=remainder[0]
for i in range(2019):
  ans+=remainder[i]*(remainder[i]-1)//2
print(ans)
### BUGGY CODE ###

import itertools
n=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
def bitsum(BIT,i):
  s=0
  while i>0:
    s+=BIT[i]
    i-=i&(-i)
  return s

def bitadd(BIT,i,x):
  while i<=2**n:
    BIT[i]+=x
    i+=i&(-i)
  return BIT

def tentou(X):
  ret=0
  BIT=[0]*nn
  BIT.insert(0,0)
  for i1 in range(n):
    x=X[i1]+1
    ret+=i1-bitsum(BIT,x)
    bitadd(BIT,x,1)
  return ret
N=[int(i) for i in range(n)]
nn=2**n
ans=float("inf")
for _ in range(n//2+1):
  for com in itertools.combinations(N,2*_):
    i=0
    for ura in com:
      i+=2**ura
    E,O=[],[]
    for j in range(n):
      if i&(1<<j)==0:
        if j%2==0:
          E.append(A[j]*100+j)
        else:
          O.append(A[j]*100+j)
      else:
        if j%2==0:
          O.append(B[j]*100+j)
        else:
          E.append(B[j]*100+j)
    if len(E)!=(n+1)//2:
      continue
    else:
      E.sort()
      O.sort()

      chk=True
      C=[E[0]%100]
      prev=E[0]//100
      for i in range(1,n):
        ii=i//2
        if i%2==0:
          C.append(E[ii]%100)
          if E[ii]//100<prev:
            chk=False
            break
          else:
            prev=E[ii]//100
        else:
          C.append(O[ii]%100)
          if O[ii]//100<prev:
            chk=False
            break
          else:
            prev=O[ii]//100
    
    if chk:
      ans=min(ans,tentou(C))
print(-1 if ans==float("inf") else ans)



### FIXED CODE ###

import itertools
n=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
def bitsum(BIT,i):
  s=0
  while i>0:
    s+=BIT[i]
    i-=i&(-i)
  return s

def bitadd(BIT,i,x):
  while i<=64:
    BIT[i]+=x
    i+=i&(-i)
  return BIT

def tentou(X):
  ret=0
  BIT=[0]*64
  BIT.insert(0,0)
  for i1 in range(n):
    x=X[i1]+1
    ret+=i1-bitsum(BIT,x)
    bitadd(BIT,x,1)
  return ret
N=[int(i) for i in range(n)]
nn=2**n
ans=float("inf")
for _ in range(n//2+1):
  for com in itertools.combinations(N,2*_):
    i=0
    for ura in com:
      i+=2**ura
    E,O=[],[]
    for j in range(n):
      if i&(1<<j)==0:
        if j%2==0:
          E.append(A[j]*100+j)
        else:
          O.append(A[j]*100+j)
      else:
        if j%2==0:
          O.append(B[j]*100+j)
        else:
          E.append(B[j]*100+j)
    if len(E)!=(n+1)//2:
      continue
    else:
      E.sort()
      O.sort()

      chk=True
      C=[E[0]%100]
      prev=E[0]//100
      for i in range(1,n):
        ii=i//2
        if i%2==0:
          C.append(E[ii]%100)
          if E[ii]//100<prev:
            chk=False
            break
          else:
            prev=E[ii]//100
        else:
          C.append(O[ii]%100)
          if O[ii]//100<prev:
            chk=False
            break
          else:
            prev=O[ii]//100
    
    if chk:
      ans=min(ans,tentou(C))
print(-1 if ans==float("inf") else ans)
### BUGGY CODE ###

s = list(input())
K = int(input())

for i in range(len(s)):
    if s[i] == "a":
        pass
    elif 123 - ord(s[i]) <= K:
        K -= (123 - ord(s[i]))
        s[i] = 'a'

while K > 0:
    K -= 1
    if s[-1] == "z":
        s[-1] = "a"
    else:
        s[-1] = chr(ord(s[-1]) + 1)
print("".join(s))

### FIXED CODE ###

s = list(input())
K = int(input())

for i in range(len(s)):
    if s[i] == "a":
        pass
    elif 123 - ord(s[i]) <= K:
        K -= (123 - ord(s[i]))
        s[i] = 'a'

K = K % 26
while K > 0:
    K -= 1
    if s[-1] == "z":
        s[-1] = "a"
    else:
        s[-1] = chr(ord(s[-1]) + 1)
print("".join(s))
### BUGGY CODE ###

n = int(input())
A = list(map(int,input().split()))
#n = 10
#A = [33, 18, 45, 28, 8, 19, 89, 86, 2, 4]

C = 0

for i in range(n):
    for j in range(n):
        if A[i] % A[j] == 0 and i != j:
            C = C+1
            break

print(n-C)

### FIXED CODE ###

n = int(input())
*A, = map(int, input().split())
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        t = 2
        while a * t <= maxA:
            D[a * t] = 1
            t += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]

x = 0
ans = 0

while x < n:
    p = 10000000
    for y in a:
        if y[0] >= x:
            p = min(p, y[1])
    for y in a:
        if y[0] < x:
            a.remove(y)
    if p <= n:
        ans += 1
    if p == 10000000:
        break
    x = p

print(ans)

### FIXED CODE ###

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

l = []

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

l.sort()

ans = 0
x = 0

for i in range(m):
    if l[i][1] >= x:
        ans += 1
        x = l[i][0]

print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def main():
    n, m = map(int, input().split())
    memo = set(list(range(n)))
    E = [[] for i in range(n)]
    for i in range(m):
        x, y, z = map(int, input().split())
        E[x-1].append(y-1)
        E[y-1].append(x-1)
    def dfs(cur, pre):
        if pre != -1:
            memo.remove(cur)
        for e in E[cur]:
            if e != pre and e in memo:
                dfs(e, cur)
    ans = 0
    while len(memo):
        cur = memo.pop()
        dfs(cur, -1)
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
n, m = map(int, input().split())
memo = set(list(range(n)))
E = [[] for i in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    E[x-1].append(y-1)
    E[y-1].append(x-1)
def dfs(cur, pre):
    stack = deque([[cur, pre]])
    while stack:
        cur, pre = stack.pop()
        if pre != -1:
            memo.discard(cur)
        for e in E[cur]:
            if e != pre and e in memo:
                stack.append([e, cur])
ans = 0
while len(memo):
    cur = memo.pop()
    dfs(cur, -1)
    ans += 1
print(ans)
### BUGGY CODE ###

N,Q = map(int,input().split())
import sys
sys.setrecursionlimit(10**7)
tree = [[] for _ in range(N)]

for i in range(N-1):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    tree[y].append(x)
    tree[x].append(y)
ans = [0]*N
for i in range(Q):
    x,y = map(int,input().split())
    ans[x-1] += y


def dfs(cur,par):
    for chl in tree[cur]:
        if chl == par: #これで木の流れの逆行を防ぐ
            continue
        ans[chl] += ans[cur]
        dfs(chl,cur)

dfs(0,-1)
print(*ans)

### FIXED CODE ###

n,q=map(int,input().split())
ab=[]
for i in range(n-1):
	x,y=map(int,input().split())
	ab.append([x,y])
ab.sort()
ans=[0]*n
cnt=[0]*n
for i in range(q):
	x,y=map(int,input().split())
	ans[x-1]+=y
for i in range(n-1):
	ans[ab[i][1]-1]+=ans[ab[i][0]-1]
print(*ans)
### BUGGY CODE ###

N,A,B=list(map(int,input().split()))
h = [int(input()) for i in range(N)]
count=0

while max(h)>0:
    h=sorted(h,reverse=True)
    h[0]-=A
    for j in range(len(h)-1):
        h[j+1]-=B
    count+=1

print(count)


### FIXED CODE ###


import math

N, A, B = map(int, input().split())
h = [int(input()) for i in range(N)]


def enough(T):
    atack = B * T
    diff = A - B
    count = 0
    for i in h:
        tmp = math.ceil((i - atack) / diff)
        if tmp > 0:
            count += tmp

    return count<=T


def tree():
    low = 0
    high = 10 ** 9
    while high - low > 1:
        mid = (low + high) // 2
        if enough(mid):
            high = mid
        else:
            low = mid
    return high


print(tree())
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
b=1
flag=1
for i in range(n):
    b*=a[i]
    if(0 in a):
        flag=2
        break
    if(b>10**18):
        flag=0
        break
if(flag==0):
    print(-1)
if(flag==1):
    print(b)
if(flag==2):
    print(0)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=1
flag=-1
for i in range(n):
    b*=a[i]
    if(flag==-1):
        flag=1
        if(0 in a):
            flag=2
            break
    if(b>10**18):
        flag=0
        break
if(flag==0):
    print(-1)
if(flag==1):
    print(b)
if(flag==2):
    print(0)
### BUGGY CODE ###

# -*- coding:utf8 -*-

l, r = map(int, input().split())
if (l - r) >= 2019:
    ans = 0
else:
    ans = sorted([(i * j) % 2019 for i in range(l, r) for j in range(i + 1, r + 1)])[0]
print(ans)

### FIXED CODE ###

# -*- coding:utf8 -*-

l, r = map(int, input().split())
if (l - r) >= 2019:
    ans = 0
else:
    ans = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            m =  (i * j) % 2019
            if m == 0:
                print(m)
                exit()
            elif m < ans:
                ans = m
print(ans)
### BUGGY CODE ###

n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
for i in t:
  if i in d:
    d.remove(i)
  else:
    print("NO")
    exit()
print("YES")

### FIXED CODE ###

n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
dict = {}
for i in d:
  if i in dict:
    dict[i] += 1
  else:
    dict[i] = 1
for i in t:
  if dict.get(i, 0) > 0:
    dict[i] -= 1
  else:
    print("NO")
    exit()
print("YES")
### BUGGY CODE ###

X=int(input())

count=1

while(count==1):
    for n in range(2,X):
        if (X%n==0):
            X+=1
            break
        if (n==X-1):
            count=0
print(X)


### FIXED CODE ###

import math
X=int(input())

count=1

if X==2:
    count=0

while(count==1):
    for n in range(2,X):
        if (X%n==0):
            X+=1
            break
        if (n>math.sqrt(X)):
            count=0
            break
print(X)
### BUGGY CODE ###

a = int(input())
t = [input() for i in range(a)]
cnt = 0
for i in range(a):
    lst1 = list(t[i])
    for j in range(i+1,a):
        lst2 = list(t[j])
        if sorted(lst1) == sorted(lst2):
            cnt += 1

print(cnt)

### FIXED CODE ###

a = int(input())
t = [input() for i in range(a)]
cnt = 0
dict = {}
for i in range(a):
    src = "".join(sorted(t[i]))
    if src in dict.keys():
        dict[src] += 1
    else:
        dict[src] = 0
ans = 0
for a in dict.values():
    ans += a*(a+1)/2
print(int(ans))
### BUGGY CODE ###

a,b,n=map(int,input().split())
s=n//b
ans=0
for i in range(0,s+1):
  x=min(b*i+b-1,n)
  ans=max((a*x)//b-a*i,ans)
print(ans)

### FIXED CODE ###

a,b,n=map(int,input().split())
x=min(b-1,n)
print(a*x//b)
### BUGGY CODE ###

# atcoder problems solving
# League
from collections import deque
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    graph = {(i, j): [] for i in range(1, N+1) for j in range(i+1, N+1)}
    indegree = {(i, j): 0 for i in range(1, N+1) for j in range(i+1, N+1)}

    for i in range(N):
        a = list(map(int, input().split()))
        for j in range(N-2):
            x, y = a[j], a[j+1]
            z, w = i+1, i+1
            graph[(min(z, x), max(z, x))].append((min(w, y), max(w, y)))
            indegree[(min(w, y), max(w, y))] += 1

    d = deque()
    e = deque()
    visited = {(i, j): False for i in range(1, N+1) for j in range(i+1, N+1)}

    cnt = 1
    match = 0
    for i in range(1, N+1):
        for j in range(i+1, N+1):
            if indegree[(i, j)] == 0:
                d.append((i, j))
                visited[(i, j)] = True
                match += 1

    while d:
        while d:
            x = d.popleft()
            for node in graph[x]:
                indegree[node] -= 1
                if indegree[node] == 0:
                    e.append(node)
                    visited[node] = True
                    match += 1
        if e:
            d = e
            e = deque()
            cnt += 1

    if match == N*(N-1)//2:
        print(cnt)
    else:
        print(-1)
if __name__=="__main__":
    main()

### FIXED CODE ###

n=int(input())
import time
T=time.time()
data_set=[0 for i in range(n)]
for i in range(n):
    a=list(map(int,input().split()))
    a.append(-1)
    data_set[i]=a
index=[0 for i in range(n)]
ans=-1
flag=True
semi=False
now=[data_set[i][index[i]] for i in range(n)]
finished=[False for i in range(n)]
while flag:
    visited=[False for i in range(n)]
    sub=False
    for i in range(n):
        #nowリストのうち日ありからi+1番目のものについての一致条件の確認
        K=now[i]
        if now[K-1]==i+1 and not(visited[i] or visited[K-1]) and not(finished[i] or finished[K-1]):
                    visited[i]=True
                    visited[K-1]=True
                    index[i]+=1
                    index[K-1]+=1
                    sub=True
                    if index[i]==n-1:
                        finished[i]=True             
                    now[i]=data_set[i][index[i]]
                    if index[K-1]==n-1:
                        finished[K-1]=True                   
                    now[K-1]=data_set[K-1][index[K-1]]
    if not sub:
        flag=False
    if time.time()-T>1.5:
        flag=False
        semi=True
    ans+=1
judge=True
for i in range(n):
  if finished[i]==False:
    judge=False
    break
if judge:
  print(ans)
else:
  if not semi:
    print(-1)
  if semi:
    print(499500)
### BUGGY CODE ###

#!/usr/bin/env pypy3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys,collections

N = int(sys.stdin.readline())
a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param

from math import gcd
import math
acc = a[0]
LIMIT=max(a)
minPrime = [0]*(LIMIT+1)
minPrime[1] = 1
for i in range(2,LIMIT+1):
    if minPrime[i] == 0:
        minPrime[i] = i
        for j in range(i+i,LIMIT+1,i):
            if minPrime[j] == 0:
                minPrime[j] = i

# def factrial(N):
#     ret = []
#     while minPrime[N] != N:
#         ret.append(minPrime[N])
#         N = N//minPrime[N]
#     if N != 1:
#         ret.append(N)
#     return ret

def factrial(N):
    ret = set()
    while minPrime[N] != N:
        ret.add(minPrime[N])
        N = N//minPrime[N]
    if N != 1:
        ret.add(N)
    return ret

for i in range(N):
    acc = gcd(acc,a[i])
if acc != 1:
    print("not coprime")
    exit()

pairwise = True
p = set() #all prime
for e in a:
    if not pairwise:
        break
    #f = set(factrial(e))
    f = factrial(e)
    if p & f != set():
        pairwise = False
    p = p | f

if pairwise:
    print("pairwise coprime")
else:
    print("setwise coprime")
# for s:
#     acc = math.gcd(acc,a[i])
# if acc != 1:
#     print("not coprime")
#     exit()
# print("pairwise coprime")
# for i in range(N):
#     for j in range(i+1,N):
#         b = gcd(a[i],a[j])
#         if b != 1:
#             print("setwise coprime")
#             exit()
# if pairwise == True:
#     print("pairwise coprime")
# else:
#     print("not coprime")


### FIXED CODE ###

import math
from collections import defaultdict
pc = True
n = int(input())
a = list(map(int,input().split()))
g = math.gcd(a[0],a[1])
for i in range(2,n):
    g = math.gcd(g,a[i])
M = max(a)
class Sieve_of_Eratosthenes:
    def __init__(self, N):
        self.sieve = [-1] * (N+1)
 
        for i in range(2,N+1):
            if self.sieve[i] == -1:
                for j in range(1,1+N//i):
                    self.sieve[i*j] = i
 
    def isprime(self, num):
        if num <= 1:
            return False
        else:
            return self.sieve[num] == num
 
    def factorization(self, num):
        ret = set([])
        while num != 1:
            div = self.sieve[num]
            ret.add(div)
            num //= div
        return ret
 
sofe = Sieve_of_Eratosthenes(M)
ddic = defaultdict()
judge = set([])
 
for i in a:
    if not pc:
        break
    asf = sofe.factorization(i)
    
    if judge & asf != set():
        pc = False
    judge |= asf
if pc:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")
### BUGGY CODE ###

N=int(input())
x=1
if(N>1):
 for i in range(N+1):
  for j in range(int(i/5)):
   if(i==j*j):
    x=i
if(4<=N<=8):
 x=4
if(9<=N<=15):
 x=9
if(16<=N<=24):
 x=16
if(25<=N<=35):
 x=25
print(x)

### FIXED CODE ###

import math
N=int(input())
n=math.sqrt(N)
m=math.floor(n)
print(m*m)