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

N = input()
data = list(map(lambda x :int(x)%2,input().strip().split()))
res = sum(data)
if res >=1:
  print(0)
else:
  data.sort()
  tmp = data[0]
  cnt = 0
  while tmp!=1:
    tmp/=2
    cnt+=1
  print(cnt)

### FIXED CODE ###

N = input()
data = list(map(lambda x :int(x),input().strip().split()))
data.sort()
tmp = data[0]
cnt =0
while tmp >1:
    if sum(list(map(lambda x:x%(2**(cnt+1)), data))) >= 1:break
    tmp//=2
    cnt+=1
print(cnt)
### BUGGY CODE ###

from heapq import heappush, heappop
from collections import defaultdict
import sys
input = sys.stdin.readline

N, M, L = map(int, input().split())
inf = 10**15
d = defaultdict(list)

for _ in range(M):
    A, B, C = map(int, input().split())
    if C>L:continue
    d[A-1].append((B-1, C))
    d[B-1].append((A-1, C))

charged_dict = [[(inf,inf)]*N for _ in range(N)]
for j in range(N):
    charged_dict[j][j] = (0, 0)
    q = [(0, 0, j)]
    while q:
        charged, used, u = heappop(q)
        if (charged, used) > charged_dict[j][u]:
            continue
        for v, next_cost in d[u]:
            c = (charged+1, next_cost) if used+next_cost>L else (charged, used+next_cost)
            if charged_dict[j][v] > c:
                charged_dict[j][v] = c
                heappush(q, c+(v,))

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    ans = charged_dict[s-1][t-1][0]
    print(ans if ans!=inf else -1)

### FIXED CODE ###

from heapq import heappush, heappop
import sys
input = sys.stdin.readline

N, M, L = map(int, input().split())
inf = 10**15
V = [[] for _ in range(N)]

for _ in range(M):
    A, B, C = map(int, input().split())
    if C>L:continue
    V[A-1].append((B-1, C))
    V[B-1].append((A-1, C))

dists = []
for i in range(N):
    dist = [(inf,inf)] * N
    dist[i] = (0, 0)
    u = [False] * N
    for _ in range(N):
        (charged, used), j = min([(dist[i], i) for i in range(N) if not u[i]])
        u[j] = True
        for k, next_cost in V[j]:
            if j==k: continue
            c = (charged+1, next_cost) if used+next_cost>L else (charged, used+next_cost)
            if dist[k] > c:
                dist[k] = c
    dists.append(dist)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    ans = dists[s-1][t-1][0]
    print(ans if ans!=inf else -1)
### BUGGY CODE ###

k, s = list(map(int, input().split()))
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                count += 1
            elif x + y + z > s:
                break
        if x + y > s:
            break
    if x > s:
        break
print(count)

### FIXED CODE ###

k, s = list(map(int, input().split()))
count = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if z >= 0 and z <= k:
            count += 1
print(count)
### BUGGY CODE ###

from itertools import permutations
from math import ceil
D, G = map(int, input().split())
prob = [tuple(map(int, input().split())) for _ in range(D)]
perms = [i for i in range(D)]
ans = 10 ** 100
for p in permutations(perms):
    point = 0
    manip = 0
    for i in range(D):
        if point + (p[i] + 1) * 100 * (prob[p[i]][0] - 1) >= G:
            manip += ceil((G - point) / ((p[i] + 1) * 100))
            ans = min(ans, manip)
            break
        else:
            point += (p[i] + 1) * 100 * prob[p[i]][0] + prob[p[i]][1]
            manip += prob[p[i]][0]
            if point >= G:
                ans = min(ans, manip)
                break
print(ans)

### FIXED CODE ###

from itertools import permutations
from math import ceil
D, G = map(int, input().split())
prob = [tuple(map(int, input().split())) for _ in range(D)]
perms = [i for i in range(D)]
ans = 10 ** 100
for p in permutations(perms):
    point = 0
    manip = 0
    for i in range(D):
        if point + (p[i] + 1) * 100 * (prob[p[i]][0] - 1) >= G:
            manip += ceil((G - point) / ((p[i] + 1) * 100))
            ans = min(ans, manip)
            break
        else:
            point += (p[i] + 1) * 100 * prob[p[i]][0] + prob[p[i]][1]
            manip += prob[p[i]][0]
            if point >= G:
                ans = min(ans, manip)
                break
print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
re = 1
for i in A:
    re *= i
if re > 10**18:
    print(-1)
else:
    print(re)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
result = 1
if 0 in A:
    print(0)
else:
    for i in range(N):
        result *= A[i]
        if result > 10**18:
            print(-1)
            quit()
    print(result)
### BUGGY CODE ###

from fractions import gcd
 
def primeNum(n):
  prime=[1]
  while n % 2 == 0:
    prime.append(2)
    n = n // 2
  for k in range(3, n+1, 2):
    while n % k == 0:
      prime.append(k)
      n = n // k
  return set(prime)
 
a,b = list(map(int, input().split()))
n=gcd(a,b)
print(len(primeNum(n)))

### FIXED CODE ###

from fractions import gcd
 
def primeNum(n):
  ans = 1
  if n == 1:
    return ans
  if n % 2 == 0:
    ans += 1
    while n % 2 == 0:
      n = n // 2
  for k in range(3, int(n**0.5)+1, 2):
    if n % k == 0:
      ans += 1
      while n % k == 0:
        n = n // k
    if n == 1:
      return ans
  if n != 1:
    ans += 1
  return ans
  
a,b = list(map(int, input().split()))
n=gcd(a,b)
print(primeNum(n))
### BUGGY CODE ###

n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x+1 and y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)

### FIXED CODE ###

n=int(input())
L=list(map(int,input().split()))
L.sort()
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    x=j+1
    y=n-1
    while y!=x+1 and y!=x:
      if L[i]+L[j]>L[(x+y)//2]:
        x=(x+y)//2
      else:
        y=(x+y)//2
    p=y if L[i]+L[j]>L[y] else x
    if L[i]+L[j]<=L[p]:
      count+=0
    else:
      count+=p-j
print(count)
### BUGGY CODE ###

n,q = map(int, input().split())
link = [[] for _ in range(n)]
for i in range(n-1):
    tmp = list(map(int,input().split()))
    link[tmp[0]-1].append(tmp[1]-1)
    link[tmp[1]-1].append(tmp[0]-1)

from collections import defaultdict
d = defaultdict(int)
for i in range(q):
    tmp = list(map(int,input().split()))
    d[tmp[0]-1]+=tmp[1]

from collections import deque
ans =[0]*n
finish  = {0}
Q = deque()
Q.append([0,0])
while Q:
    node= Q.popleft()
    finish.add(node[0])

    val = node[1] + d[node[0]]
    ans[node[0]]+=val

    for nxt in link[node[0]]:
        if nxt in finish:
            pass
        else:
            Q.append([nxt,val])

print(*ans)

### FIXED CODE ###

import sys
input=sys.stdin.readline

n,q = map(int, input().split())
link = [[] for _ in range(n)]
for i in range(n-1):
    tmp = list(map(int,input().split()))
    link[tmp[0]-1].append(tmp[1]-1)
    link[tmp[1]-1].append(tmp[0]-1)

from collections import defaultdict
d = defaultdict(int)
for i in range(q):
    tmp = list(map(int,input().split()))
    d[tmp[0]-1]+=tmp[1]

from collections import deque
ans =[0]*n
finish  = {0}
Q = deque()
Q.append([0,0])
while Q:
    node= Q.popleft()
    finish.add(node[0])

    val = node[1] + d[node[0]]
    ans[node[0]]+=val

    for nxt in link[node[0]]:
        if nxt in finish:
            pass
        else:
            Q.append([nxt,val])

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

N, x = map(int, input().split())
a = list(map(int, input().split()))

ans = float("INF")
b = [float("INF")]*N
for k in range(N):
    temp_ans = k*x
    for i in range(N):
        b[i] = min(b[i],a[i-k])
        temp_ans += b[i]
    ans = min(ans,temp_ans)
print(ans)


### FIXED CODE ###

N, x = map(int, input().split())
a = list(map(int, input().split()))

ans = float("INF")
b = [[float("INF")]*N for _ in range(N)]
b[0] = a
for k in range(N):
    for i in range(N):
        b[k][i] = min(b[k-1][i],a[i-k])
    ans = min(ans, sum(b[k])+k*x)

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

N = int(input())
A = list(map(int,input().split()))
ans = 1
for i in A:
    ans = ans * i

if ans > 10**18:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

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

# d
n = int(input())
print(sum(i%(i%n+1) for i in range(1, n+1)))

### FIXED CODE ###

# d
n = int(input())
print(n*(n-1)//2)
### BUGGY CODE ###

# coding: utf-8
S = input()
Q = int(input())
cnt = 0
for i in range(Q):
    q = input().split()
    if q[0] == "1":\
        cnt += 1
    else:
        if (int(q[1]) + cnt) % 2 == 1:
            S = q[2] + S
        else:
            S += q[2]
print(S if cnt % 2 == 0 else S[::-1])

### FIXED CODE ###

# coding: utf-8
from collections import deque
S = deque(input())
Q = int(input())
cnt = 0
for i in range(Q):
    q = input().split()
    if q[0] == "1":
        cnt += 1
    else:
        if (int(q[1]) + cnt) % 2 == 1:
            S.appendleft(q[2])
        else:
            S.append(q[2])
ans = "".join(S)
print(ans if cnt % 2 == 0 else ans[::-1])
### BUGGY CODE ###

import sys

input = sys.stdin.readline

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

l_first, r_first = map(int, input().split())

answer_set = {value for value in range(l_first, r_first + 1)}

for _ in range(m - 1):
    l_current, r_current = map(int, input().split())
    current_set = {value for value in range(l_current, r_current + 1)}
    answer_set.intersection_update(current_set)

print(len(answer_set))


### FIXED CODE ###

import sys

input = sys.stdin.readline

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

l_list = []
r_list = []

for _ in range(m):
    l, r = map(int, input().split())
    l_list.append(l)
    r_list.append(r)

l_maybe_answer = max(l_list)
r_maybe_answer = min(r_list)

if l_maybe_answer <= r_maybe_answer:
    print(min(r_list) - max(l_list) + 1)
else:
    print(0)
### BUGGY CODE ###

from functools import lru_cache
import sys
import numpy as np

sys.setrecursionlimit(10**8)

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

@lru_cache(maxsize=None)
def dp(*x):
    xnum = np.array(x)
    x_seki = xnum.prod()
    result = 0
    while x_seki % 1 == 0:
        x_seki /= 2
        result += 1
    return result - 1
print(dp(*X))



### FIXED CODE ###

N = input()
xs = map(int, input().split())
cnt = lambda n: bin(n)[::-1].find('1')
print(sum(cnt(x) for x in xs))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
dic = {}
ans = {}
for item in a:
    if item in dic.keys():
        dic[item] += 1
    else:
        dic[item] = 1

for key in dic.keys():
    tmp = 0
    for key2 in dic.keys():
        if key == key2:
            tmp += (dic[key2]-1) * (dic[key2]-2) // 2
        else:
            tmp += (dic[key2]) * (dic[key2]-1) // 2
    ans[key] = tmp

for i in range(n):
    print(ans[a[i]])


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
dic = {}
ans = {}
for item in a:
    if item in dic.keys():
        dic[item] += 1
    else:
        dic[item] = 1

all_ans = sum([item * (item - 1) // 2 for item in dic.values()])

for i in range(n):
    print(all_ans - dic[a[i]] + 1)
### BUGGY CODE ###

q=int(input())
for i in range(q):
    x,d,n=map(int,input().split())
    ans=1
    for i in range(1,n+1):
        m=x+(d*(i-1))
        ans*=m
    print(ans%1000003)

### FIXED CODE ###

q=int(input())
m=10**6+3
f=[1]
for i in range(1,m):
    f.append(f[-1]*i%m)
for i in range(q):
    x,d,n=map(int,input().split())
    if d==0:
        print(pow(x,n,m))
    else:
        t=x*pow(d,m-2,m)%m
        if t==0 or t+n-1>=m:
            print(0)
        else:
            print(f[t+n-1]*pow(f[t-1],m-2,m)*pow(d,n,m)%m)
### BUGGY CODE ###

H, W = map(int, input().split())

data = [[0]*W for i in range(H)]
c = 0
for i in range(H):
    s = input()
    for j in range(W):
        if s[j] == '#':
            data[i][j] = 1
            c += 1

if c == H*W:
    print(0)
    exit()

ans = 0

while True:
    ans += 1
    for h in range(H):
        for w in range(W):
            if data[h][w] == ans:
                if 0 < h:
                    data[h-1][w] = ans + 1
                if h < H-1:
                    data[h+1][w] = ans + 1
                if 0 < w:
                    data[h][w-1] = ans + 1
                if w < W-1:
                    data[h][w+1] = ans + 1

    c = 0
    for h in range(H):
        for w in range(W):
            if data[h][w] > 0:
                c += 1
    if c == H*W:
        break
print(ans)


### FIXED CODE ###

H, W = map(int, input().split())

data = [[-W]*W for i in range(H)]

for i in range(H):
    s = input()
    x = -(2*W)
    for j in range(W):
        if s[j] == '#':
            x = 0
        data[i][j] = x
        x += 1
    x = -(2*W)
    for j in range(W):
        if data[i][W-j-1] == 0:
            x = 0
        elif data[i][W-j-1] < 0:
            data[i][W-j-1] = x
        else:
            if x > 0:
                x = min(x, data[i][W-j-1])
            else:
                x = data[i][W-j-1]
            data[i][W-j-1] = x
        x += 1


for w in range(W):
    x = -(2*H)
    for h in range(H):
        if data[h][w] == 0:
            x = 0
        elif data[h][w] > 0:
            if x > 0:
                x = min(x, data[h][w])
            else:
                x = data[h][w]
            data[h][w] = x
        else:
            data[h][w] = x
        x += 1
    x = -(2*H)
    for h in range(H):
        if data[H-h-1][w] == 0:
            x = 0
        elif data[H-h-1][w] > 0:
            if x > 0:
                x = min(x, data[H-h-1][w])
            else:
                x = data[H-h-1][w]
            data[H-h-1][w] = x
        else:
            data[H-h-1][w] = x
        x += 1

ans = 0
for d in data:
    ans = max(ans, max(d))
print(ans)
### BUGGY CODE ###

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

lis = []

for _ in range(M):
    i, j = input().split()
    i = int(i)
    lis.append((i, j))


cnt_AC = []
cntsAC = 0

inc = [i for i in range(1, N + 1)]
zeros = [0 for _ in range(N)]

flags = dict(zip(inc, zeros))
flags_forWA = dict(zip(inc, zeros))

cntsWA = 0

for k, v in lis:
    if k not in cnt_AC:
        if v == "AC":
            cnt_AC.append(k)
            cntsAC += 1
            flags[k] = 1
        else:
            cnt_AC.append(k)
    else:
        if v == "AC" and flags[k] == 0:
            cntsAC += 1
            flags[k] = 1


for k, v in lis:
    if flags[k] == 1 and v == "WA" and flags_forWA[k] == 0:
        cntsWA += 1
    elif v == "AC":
        flags_forWA[k] = 1

print(cntsAC, cntsWA, sep=" ")

### FIXED CODE ###

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

lis = []

for _ in range(M):
    i, j = input().split()
    i = int(i)
    lis.append((i, j))


cntsAC = 0

inc = [i for i in range(1, N + 1)]
zeros = [0 for _ in range(N)]

flags = dict(zip(inc, zeros))
flags_forAC = dict(zip(inc, zeros))
flags_forWA = dict(zip(inc, zeros))

cntsWA = 0

for k, v in lis:
    if flags_forAC[k] == 0:
        if v == "AC":
            flags_forAC[k] = 1
            cntsAC += 1
            flags[k] = 1
        else:
            flags_forAC[k] = 1
    else:
        if v == "AC" and flags[k] == 0:
            cntsAC += 1
            flags[k] = 1


for k, v in lis:
    if flags[k] == 1 and v == "WA" and flags_forWA[k] == 0:
        cntsWA += 1
    elif v == "AC":
        flags_forWA[k] = 1

print(cntsAC, cntsWA, sep=" ")
### BUGGY CODE ###


N = int(input())
hists = []
for n in range(N):
	line = input()
	h = [0]*27
	for i in range(len(line)):
		h[ord(line[i])-ord('a')] += 1
	hists.append(h)

ans = 0
for n in range(len(hists)):
	for m in range(n+1,len(hists)):
		for i in range(27):
			if hists[n][i]!=hists[m][i]:
				break
		else:
			ans += 1
print(ans)


### FIXED CODE ###


N = int(input())

data = {}
for n in range(N):
	s0 = input()
	s = ''.join(sorted(s0))
	if s in data:
		data[s] += 1
	else:
		data[s] = 1

ans = 0
for n in data.values():
	ans += (n-1)*n//2
print(ans)
### BUGGY CODE ###

N, K = map(int,input().split())
P = []
for i in range(N):
    a, b = map(int,input().split())
    p = [a] * b
    P += p
P.sort()
print(P[K-1])

### FIXED CODE ###

N, K = map(int,input().split())
P = [list(map(int,input().split())) for _ in range(N)]
p = 0
P.sort()
for i in range(N):
    p += P[i][1]
    if p >= K:
        ans = P[i][0]
        break
print(ans)
### BUGGY CODE ###

inputs = input().strip().split()

N = int(inputs[0])
K = int(inputs[1])

inputs = input().strip().split()
problem = list(map(lambda x: int(x), inputs))

ans = 10000000000000

if N == K:
    left = problem[0]
    right = problem[K - 1]
    if left * right >= 0:
        if abs(right) > abs(left):
            if ans > abs(right):
                ans = abs(right)
        else:
            if ans > abs(left):
                ans = abs(left)
    else:
        if abs(right) > abs(left):
            if ans > (2 * abs(left) + abs(right)):
                ans = (2 * abs(left) + abs(right))
        else:
            if ans > 2*abs(right)+abs(left):
                ans = 2*abs(right)+abs(left)
else:
    for i in range(N - K):
        part = problem[i:i+K]
        left = part[0]
        right = part[K - 1]
        if left * right >= 0:
            if abs(right) > abs(left):
                if ans > abs(right):
                    ans = abs(right)
            else:
                if ans > abs(left):
                    ans = abs(left)
        else:
            if abs(right) > abs(left):
                if ans > (2 * abs(left) + abs(right)):
                    ans = (2 * abs(left) + abs(right))
            else:
                if ans > 2*abs(right)+abs(left):
                    ans = 2*abs(right)+abs(left)

print(ans)

### FIXED CODE ###

inputs = input().strip().split()

N = int(inputs[0])
K = int(inputs[1])

inputs = input().strip().split()
problem = list(map(lambda x: int(x), inputs))

ans = 10000000000000000000000000

if N == K:
    left = problem[0]
    right = problem[K - 1]
    if left * right >= 0:
        if abs(right) > abs(left):
            if ans > abs(right):
                ans = abs(right)
        else:
            if ans > abs(left):
                ans = abs(left)
    else:
        if abs(right) > abs(left):
            if ans > (2 * abs(left) + abs(right)):
                ans = (2 * abs(left) + abs(right))
        else:
            if ans > 2*abs(right)+abs(left):
                ans = 2*abs(right)+abs(left)
else:
    for i in range(N - K + 1):
        left = problem[i]
        right = problem[i+K-1]
        if left * right >= 0:
            if abs(right) > abs(left):
                if ans > abs(right):
                    ans = abs(right)
            else:
                if ans > abs(left):
                    ans = abs(left)
        else:
            if abs(right) > abs(left):
                if ans > (2 * abs(left) + abs(right)):
                    ans = (2 * abs(left) + abs(right))
            else:
                if ans > 2*abs(right)+abs(left):
                    ans = 2*abs(right)+abs(left)

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

N = int(input())
A = [int(i) for i in input().split()]

def getSadness(A,b):
    ret = 0
    for i in range(N):
        ret += abs(A[i]-(b+i+1))
    return ret

sad0 = getSadness(A,0)
sad1 = getSadness(A,1)

min = min(sad0,sad1)
new = min

i=1
while True:
    if sad0<sad1:
        new = getSadness(A,-i)
    else:
        new = getSadness(A,i+1)
    if new<min:
        min = new
    else:
        break
    i += 1

print(min)
    


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
B = [A[i]-i-1 for i in range(N)]
B.sort()
b = N//2
ans = sum([abs(B[i]-B[b]) for i in range(N)])
print(ans)
### BUGGY CODE ###

MOD=998244353
N,M,K=map(int,input().split())

def powmod(a,p):
  if p==0:
    return 1
  else:
    pow2=powmod(a,p//2)
    if p%2==0:
      return (pow2**2)%MOD
    else:
      return (a*pow2**2)%MOD
def invmod(a):
  return powmod(a,MOD-2)
def comb_mod(n,r):
  r=min(r,n-r)
  nPr=1
  fact_r=1
  for i in range(r):
    nPr*=n-i
    nPr%=MOD
    fact_r*=r-i
    fact_r%=MOD  
  return (nPr*invmod(fact_r))%MOD

if M==1 and K<N-1:
  print(0)
else:
  answer=0
  term2=1
  for i in range(K+1):
    ans_k=M
    term1=powmod(M-1,N-i-1)
    answer+=(ans_k*term1*term2)%MOD
    answer%=MOD
    term2=term2*(N-i-1)*invmod(i+1)%MOD
    
  print(answer)

### FIXED CODE ###

MOD=998244353
N,M,K=map(int,input().split())

inv_table = [0]+[1]
for i in range(2,K+2):
  inv_table.append(-(MOD//i)*inv_table[MOD%i]%MOD)

def powmod(a,p):
  if p==0:
    return 1
  else:
    pow2=powmod(a,p//2)
    if p%2==0:
      return (pow2**2)%MOD
    else:
      return (a*pow2**2)%MOD
def invmod(a):
  return powmod(a,MOD-2)

if M==1 and K<N-1:
  print(0)
elif K==N-1:
  print(powmod(M,N))
else:
  ans=0
  term1=powmod(M-1,N-1)
  term2=1
  inv_M1=invmod(M-1)
  for i in range(K+1):
    ans+=term1*term2
    ans%=MOD
    term1=term1*inv_M1%MOD
    term2=term2*(N-i-1)*inv_table[i+1]%MOD
    
  answer=M*ans%MOD
  print(answer)
### BUGGY CODE ###

import sys,random
from math import gcd
input=sys.stdin.readline
n=int(input())
*a,=map(int, input().split())
random.shuffle(a)
tmp=a[0]
for i in range(1,n):
    tmp=gcd(tmp,a[i])
if tmp>1:
    print('not coprime')
    exit()

# pairwize coprime なら素因数が2度現れることはない

def f(x):
    res=set()
    for i in range(2,int(x**(1/2))+3):
        if x%i==0:
            while x%i==0:
                x//=i
            res.add(i)
    if x>1:
        res.add(x)
    return res
tmp=set()
for ai in a:
    for p in tmp:
        if ai%p==0:
            print('setwise coprime')
            exit()
    pp=f(ai)
    tmp|=pp 
print('pairwise coprime')



### FIXED CODE ###

import sys,random
from math import gcd
input=sys.stdin.readline
n=int(input())
*a,=map(int, input().split())
random.shuffle(a)
tmp=a[0]
for i in range(1,n):
    tmp=gcd(tmp,a[i])
if tmp>1:
    print('not coprime')
    exit()

# pairwize coprime なら素因数が2度現れることはない

def f(x):
    res=set()
    for i in range(2,int(x**(1/2))+3):
        if x%i==0:
            while x%i==0:
                x//=i
            res.add(i)
    return res,x
tmp=set()
tmp2=set()
for ai in a:
    for p in tmp:
        if ai%p==0:
            print('setwise coprime')
            exit()
    pp,x=f(ai)
    tmp|=pp 
    if x>1 and x in tmp2:
        print('setwise coprime')
        exit()
    tmp2.add(x)
    
        
print('pairwise coprime')
### BUGGY CODE ###

import sys; sys.setrecursionlimit(50000)
input = sys.stdin.readline

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

result = []
for x in range(X):
    for y in range(Y):
        for z in range(Z):
            if x * y * z > K: break
            result.append(A[x]+B[y]+C[z])
result.sort(reverse=True)
for i in range(K):
    print(result[i])


### FIXED CODE ###

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

import itertools
AB = [a + b for a, b in itertools.product(A,B)]
AB.sort(reverse=True)
ABC = [ab + c for ab, c in itertools.product(AB[:3000],C)]
ABC.sort(reverse=True)
for i in range(K):
    print(ABC[i])
### BUGGY CODE ###


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

An = list(map(int, input().split()))

An = [0]+An

#print(An)

for i in range(n):
    An[i+1] += An[i]

#print(An)

ans = 0
for i in range(n):
    for j in range(i, n): 
#        print((i,j))
        t = An[j+1]-An[i]

        ans += 1 if t%m == 0 else 0


print(ans)

### FIXED CODE ###



from collections import Counter

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

An = list(map(int, input().split()))

Bn = [0]+An



for i in range(n):
    Bn[i+1] = An[i] + Bn[i] 

#print(Bn)



mp = []

for i in range(n+1):
    r = Bn[i] % m
    mp.append(r)

nlist = Counter(mp).most_common()

ans = 0
for i in range(len(nlist)):
    t = nlist[i][1]
    if t <= 1:
        break

    ans += t*(t-1)//2

print(ans)