Harryxun/stf_run huggingface dataset:
import numpy as np
h, w, d = map(int, input().split())
a = np.array([list(map(int, input().split())) for _ in range(h)])
q = int(input())
num = h * w
mass = np.array([[0, 0] for _ in range(num + 1)])
mp = []
for i in range(h):
    for j in range(w):
        a_ij = a[i][j]
        mass[a_ij] = [i, j]
for i in range(d):
    mass_sort = mass[1+i::d]
    mp_i = np.sum(abs(mass_sort[:-1] - mass_sort[1:]), axis=1)
    mp.append(mp_i.cumsum())
for _ in range(q):
    l, r = map(int, input().split())
    n = (r - l) // d
    u = l % d
    index = (l - (d - u)) // 2
    if index == 0:
        print(mp[u-1][index+n-1])
    else:
        print(mp[u-1][index+n-1]-mp[u-1][index-1])


### FIXED CODE ###

import sys
input = sys.stdin.readline
h, w, d = map(int, input().split())
num = h * w
x = [0] * (num + 1)
y = [0] * (num + 1)
mp = [0] * (num + 1)
for i in range(h):
    for j, a in enumerate(map(int, input().split())):
        x[a], y[a] = [i+1, j+1]
for i in range(d+1, num+1):
    mp[i] = mp[i-d] + abs(x[i] - x[i-d]) + abs(y[i] - y[i-d])
q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    print(mp[r]-mp[l])
A = int(input())
B = int(input())
C = int(input())

if A+B+C == 17 and A >= 5 and B >= 5 and C >= 5:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

from sys import stdin

A,B,C = [int(x) for x in stdin.readline().rstrip().split()]

if A + B + C == 17 and A >= 5 and B >= 5 and C >= 5:
        print("YES")
else:
        print("NO")
n=input()
a=list(map(int,input().split()))
b=a.sorted
c=(b[0]+b[1])/2
for i in range(3,n+1):
  c=(c+b[i])/2
print(c)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=(b[0]+b[1])/2
for i in range(2,n):
  c=(c+b[i])/2
print(c)
# coding:UTF-8
import sys
from math import factorial

MOD = 10 ** 9 + 7
INF = 10000000000

# 約数　倍数
def gcb(a, b):
    if b == 0:
        return a
    else:
        return gcb(b, a % b)

def lcm(a, b):
    d = gcb(a, b)
    return int(a / d * b)

def divisorList(a):
    l = []
    for i in range(1, int(a**0.5)+1):
        if a % i == 0:
            l.append(i)
            ii = a / i
            if i != ii:
                l.append(ii)
    return sorted(l)

def primeNumList(a):
    if a <= 1:
        return []
    else:
        multiple_list = [2]
        serial_number_list = [r for r in range(2, a + 1) if r % 2 != 0]

        # 5. 連番リストの先頭が、入力値の平方根以上で終了
        while len(serial_number_list) > 0:
            multiple_list.append(serial_number_list[0])
            for serial_number in range(serial_number_list[0], serial_number_list[- 1] + 1, serial_number_list[0]):
                if serial_number in serial_number_list:
                    serial_number_list.remove(serial_number)

        return multiple_list

def main():
    # ------ 入力 ------#
    n = int(input())    # 数字
    aList = list(map(int, input().split()))     # スペース区切り連続数字

    # ------ 処理 ------#
    amax = max(aList)
    pl = primeNumList(amax)
    countList = [0] * len(pl)
    for a in aList:
        for i in range(len(pl)):
            if a % pl[i] == 0:
                countList[i] += 1

    # ------ 出力 ------#
    m = max(countList)
    if m == len(aList):
        print("not coprime")
    elif m >= 2:
        print("setwise coprime")
    else:
        print("pairwise coprime")


if __name__ == '__main__':
    main()


### FIXED CODE ###

# coding:UTF-8
import sys
from math import factorial

MOD = 10 ** 9 + 7
INF = 10000000000

# 素数列挙
def primeNumList(n):
    d = [d for d in range(0, n+1)]
    if n < 2:
        return [[],d]
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
            d[j] = i
    return [[i for i in range(n + 1) if is_prime[i]], d]

def main():
    # ------ 入力 ------#
    n = int(input())    # 数字
    aList = list(map(int, input().split()))     # スペース区切り連続数字

    # ------ 処理 ------#
    amax = max(aList)
    pl = primeNumList(amax)
    countList = [0] * (amax+1)

    if pl[0] != []:
        for a in aList:
            at = a
            sl = []
            while at != 1:
                s = pl[1][at]
                sl.append(s)
                at = int(at / s)
            sl2 = list(set(sl))
            for s in sl2:
                countList[s] += 1
        m = max(countList)
    else:
        m = 0

    # ------ 出力 ------#
    if m == len(aList):
        print("not coprime")
    elif m >= 2:
        print("setwise coprime")
    else:
        print("pairwise coprime")


if __name__ == '__main__':
    main()
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
pay=o
p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)

### FIXED CODE ###

import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
pay=0
p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)
def make_divisors(n):
    divisors = []
    for i in range(1, n):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    # divisors.sort()
    return divisors
A, B, K=map(int,input().split())
dA = make_divisors(A)
dB = make_divisors(B)
D = list(set(dA)&set(dB))
print(D[-K])

### FIXED CODE ###

a,b,k=map(int,input().split())
check=0
m=min(a,b)
for i in range(m,0,-1):
    if a%i==0 and b%i==0:
        check+=1
        if check==k:
            print(i)
            break
for i in range(n):
    x,y=map(int,input().split())
    l.append([x,y])

l=sorted(l,key=lambda x:x[1])
t=0
ans='Yes'
for i in range(n):
    if t+l[i][0]<=l[i][1]:
        t+=l[i][0]
    else:
        ans='No'
print(ans)

### FIXED CODE ###

n=int(input())
l=[]
for i in range(n):
    x,y=map(int,input().split())
    l.append([x,y])

l=sorted(l,key=lambda x:x[1])
t=0
ans='Yes'
for i in range(n):
    if t+l[i][0]<=l[i][1]:
        t+=l[i][0]
    else:
        ans='No'
print(ans)
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')


### FIXED CODE ###

n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
import sys
from collections import deque
from collections import Counter
s = deque(map(str, input().rstrip()))

if "".join(s) == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    sys.exit()

s = [ord(x) for x in s]

if len(s) == 26:
    maxlen = True
    s = s[::-1]
    x = s[0]
    for i, w in enumerate(s):
        if x > w:
            break

    s = s[::-1]
    s = s[:-i - 1]

can_use = set(range(97, 123)) - set(s)
if maxlen:
    s = s + [min(can_use) + 1]
else:
    s = s + [min(can_use)]

s = [chr(x) for x in s]

print("".join(s))

### FIXED CODE ###

import sys
from collections import deque
s = deque(map(str, input().rstrip()))

if "".join(s) == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    sys.exit()

s = [ord(x) for x in s]

if len(s) < 26:
    can_use = set(range(97, 123)) - set(s)
    s = s + [min(can_use)]

else:
    add = []
    s = s[::-1]
    prev = s[0]
    add.append(prev)

    if prev == 122:
        s[1] = 122
        s = s[::-1]
        s = s[:-1]

    else:
        for i in range(1, len(s)):
            if prev > s[i]:
                add = [x for x in add if x > s[i]]
                s[i] = (min(add))
                s = s[::-1]
                s = s[:-i]
                break
            prev = s[i]
            add.append(prev)

s = [chr(x) for x in s]

print("".join(s))
n = int(input())
sn = [input() for _ in range(n)]
m = int(input())
sm = [input() for _ in range(m)]

List = []
for i in range(len(list(set(n)))):
    List.append(n.count(list(set(n))[i]) - m.count(list(set(n))[i]))
    
print(max(List))

### FIXED CODE ###

n = int(input())
sn = [input() for _ in range(n)]
m = int(input())
sm = [input() for _ in range(m)]

List = []
for i in range(len(list(set(sn)))):
    List.append(sn.count(list(set(sn))[i]) - sm.count(list(set(sn))[i]))
    
print(max(max(List), 0))
a,b=map(raw_input().split())

if abs(a-b)<=1:
	print a+b
else:
	print a+b+1


### FIXED CODE ###

a,b=map(int,raw_input().split())
x=max(a,b)
y=min(a,b)
if x-y>1:
	print x+x-1
else:
	print x+y
a, b = [int(i) for i in input().split()]

if a < b:
   print("a < b")


elif a > b:
     print("a > b")


else:
  print("a == b")

### FIXED CODE ###

a, b = [int(i) for i in input().split()]

if a < b:
   print("a < b")


elif a > b:
     print("a > b")


else:
  print("a == b")
N,T = map(int, input().split())

ans = []

for i in range(N):
    c,t = map(int, input().split())
    if T > t[i]:
        ans.appned(c[i])
    

if len(ans) == 0:
    print("TLE")
else:
    print(min(ans))    

### FIXED CODE ###

N, T = map(int,input().split())
c = []
t = []

for i in range(N):
  c1, t1 = map(int,input().split())
  c.append(c1)
  t.append(t1)
  
ans = []

for i in range(N):
  if t[i] <= T:
    ans.append(c[i])

if len(ans) == 0:
  print("TLE")
else:
  print(min(ans))
import sys

VALUE = 500

num = int(sys.argv[1])
if 1 < num > 100:
    assert False, 'Invalid value'

threshold = int(sys.argv[2])
if 1 < threshold > 10**5:
    assert False, 'Invalid value'

result = 'Yes' if num * VALUE >= threshold else 'No'
print(result)


### FIXED CODE ###

#!/usr/bin/env python

VALUE = 500

stdin = input()
args = stdin.split(' ')

num = int(args[0])
if num < 1 or num > 100:
    assert False, 'Invalid value'

threshold = int(args[1])
if threshold < 1 or threshold > 10**5:
    assert False, 'Invalid value'

result = 'Yes' if num * VALUE >= threshold else 'No'
print(result)
s = input()
t = input()

ans = 0
for i in len(s):
  if s[i] == t[i]:
    ans += 1
print ans

### FIXED CODE ###

s = input()
t = input()
ans = 0
for i in range(len(s)):
  if s[i] == t[i]:
    ans += 1
print(ans)
import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j]==b[k]:
                a[i][j]="x"


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1

if c!=0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j]==b[k]:
                a[i][j]="x"


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1
    if a[z][0]==a[z][1]==a[z][2]=="x":
        c+=1
if c!=0:
    print("Yes")
else:
    print("No")
#!/usr/bin/env python
#coding: UTF-8
import math

line = []
for l in open('text.txt', 'r'):
    for i in l.split(' '):
    	line.append(float(i))
a = (line[0]-line[2])**2+(line[1]-line[3])**2
print math.sqrt(a)

### FIXED CODE ###

import math

x1,y1,x2,y2 = map(float,raw_input().split())
a = math.sqrt((x1-x2)**2+(y1-y2)**2)
print '%f'%a
n,m = map(int, input().split())
ans = 0
def kx(t):
  return int(t)%m
a = list(map(kx, input().split()))
b = [0]*(n+1)
for i in range(1,n+1):
  a[i] = a[i-1] + b[i-1]
f = [0]*m
for i in b:
  f[i] += 1
for i in f:
  ans += i*(i-1)//2
print(ans)

### FIXED CODE ###

from collections import defaultdict as dd
d = dd(int)
d[0] = 1
n,m = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
f = 0
for i in range(1,n+1):
  f = (f + a[i-1])%m
  d[f] += 1
for i in d:
  ans += d[i]*(d[i]-1)//2
print(ans)
A,B,C,D= map(int, input().split())
L=A+B
R=C+D
if L>R:
  print('Left')
elif L=R:
  print('Balanced')
else :
  print('Right')


### FIXED CODE ###

a , b, c ,d = map(int,input().split(' '))
L=a+b
R=c + d
if L> R:
    print('Left')
elif L<R:
    print('Right')
else:
    print('Balanced ')
import numpy as np

n, k, q = map(int, input().split())

arr = np.array([k] * n)

for i in range(q):
    q_i = int(input())
    arr = arr - 1
    arr[q_i - 1] += 1

arr_evaluate = arr > 0

for go_or_not in arr_evaluate:
    if go_or_not:
        print("Yes")
    else:
        print("No")



### FIXED CODE ###

n, k, q = map(int, input().split())
q_list = [int(input()) for i in range(q)]

arr = [k - q] * n

for q_i in q_list:
    arr[q_i - 1] += 1

for go_or_not in arr:
    if go_or_not > 0:
        print("Yes")
    else:
        print("No")
m=1000
while(2**i<m):
    i+=1
m=2**i
print(m)

### FIXED CODE ###

a,b = map(int, input().split())
if a<=b:
    print(a)
else:
    print(a-1)
import math
n = int(input())
a = list(map(int,input().split()))
l = len(a)
b = [a[i]-(i+1) for i in range(n)]
b = sorted(b)
if l%2==1:
    mid = b[l//2+1]
    sum = 0
    for i in range(n):
        sum += abs(a[i] - mid - (i+1))
else:
    mid = (b[l//2] + b[l//2+1]) / 2
    sum1 = 0
    sum2 = 0
    for i in range(n):
        sum1 += abs(a[i] - math.floor(mid) - (i+1))
        sum2 += abs(a[i] - math.ceil(mid) - (i+1))
    sum = min(sum1, sum2)
print(sum)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
l = len(a)
b = [a[i]-(i+1) for i in range(n)]
b = sorted(b)
mid = b[l//2]
sum = 0
for i in range(n):
    sum+=abs(a[i]-(mid+(i+1)))
print(sum)
A,B,K = map(int,input().split())

l = list(range(A,B+1))
res = []
for i in range(len(l)):
    if i < K:
        res.append(l[i])
    if B-A+1-K <= i:
        res.append(l[i])

for i in set(res):
    print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
import numpy as np
 
N,H = map(int,input().split())
ab = np.asarray([list(map(int,input().split())) for _ in range(N)])
 

#bのうち大きなものから引いていく
#b[i]のうち、max(a)が大きければ、以降max(a)で攻撃し続ける

max_a = np.max(ab[:,0])
b_sort = np.sort(ab[:,1])[::-1] #降順

ans = 0

b_sort = b_sort[np.where(b_sort > max_a)]

#b_sortの中で大きいのから順に引いていく
for i in range(len(b_sort)):
  H -= b_sort[i]
  i += 1
  if H <= 0:
    print(i)
    exit()

#bをすべて引いてもH>0ならaで攻撃
if H % max_a == 0:
  i += H // max_a
else:
  i += H // max_a + 1

print(i)

### FIXED CODE ###

import numpy as np
 
N,H = map(int,input().split())
ab = np.asarray([list(map(int,input().split())) for _ in range(N)])
 
 
#bのうち大きなものから引いていく
#b[i]のうち、max(a)が大きければ、以降max(a)で攻撃し続ける
 
max_a = np.max(ab[:,0])
b_sort = np.sort(ab[:,1])[::-1] #降順
 
ans = 0
 
b_sort = b_sort[np.where(b_sort > max_a)]
 
#b_sortの中で大きいのから順に引いていく
for i in range(len(b_sort)):
  H -= b_sort[i]
  ans += 1
  if H <= 0:
    print(ans)
    exit()
 
#bをすべて引いてもH>0ならaで攻撃
if H % max_a == 0:
  ans += H // max_a
else:
  ans += H // max_a + 1
 
print(ans)
#!/usr/bin/env python3
from math import isinf

V, E, r = map(int, input().split())
vertices = [float('inf')] * V
vertices[r] = 0
edges = []
for i in range(E):
    s, t, d = map(int, input().split())
    edges.append((s, t, d))

for i in range(V - 1):
    for s, t, d in edges:
        if vertices[t] > vertices[s] + d:
            vertices[t] = vertices[s] + d

for s, t, d in edges:
    if vertices[t] > vertices[s] + d:
        neg = True
        print("NEGATIVE CYCLE")

if not neg:
    for v in vertices:
        print('INF' if isinf(v) else v)

### FIXED CODE ###

#!/usr/bin/env python3
from math import isinf


def main():
    V, E, r = map(int, input().split())
    vertices = [float('inf')] * V
    vertices[r] = 0
    edges = []
    for i in range(E):
        s, t, d = map(int, input().split())
        edges.append((s, t, d))

    for i in range(V - 1):
        for s, t, d in edges:
            if vertices[t] > vertices[s] + d:
                vertices[t] = vertices[s] + d

    for s, t, d in edges:
        if vertices[t] > vertices[s] + d:
            print("NEGATIVE CYCLE")
            return

    for v in vertices:
        print('INF' if isinf(v) else v)

main()
N,M=map(int,input().split())
a=[]
b=[0]*N
for i in range(M):
    a.append(int(input()))
if M==0:
    j=-1
else:
    j=0
if M>0 and a[0]==1:
    b[0]=0
    b[1]=1
elif M>0 and a[0]==2:
    b[0]=1
    b[1]=1
else:
    b[0]=1
    b[1]=2
for i in range(N-2):
    if j==M-1 or (j>=0 and (i+2)!=a[j] and (i+1)!=a[j]):
        b[i+2]=b[i+1]+b[i]
    if j>0 and a[j]==a[j-1]+1:
        b[N-1]=0
    if j+1<M and a[j+1]==a[j]+1:
        b[N-1]=0
    elif j>=0 and (i+2)==a[j]:
        b[i+2]=b[i]
    elif j>=0 and j+1<M and (i+1)==a[j]:
        j+=1
        b[i+2]=b[i+1]
    elif j>=0 and (i+1)==a[j]:
        b[i+2]=b[i+1]
print(b[N-1]%1000000007)

### FIXED CODE ###

N,M=map(int,input().split())
a=[]
b=[0]*N
for i in range(M):
    a.append(int(input()))
if M==0:
    j=-1
else:
    j=0
if N==1:
    b[0]=1
elif M>0 and a[0]==1:
    b[0]=0
    b[1]=1
elif M>0 and a[0]==2:
    b[0]=1
    b[1]=1
else:
    b[0]=1
    b[1]=2
for i in range(N-2):
    if j==M-1 or (j>=0 and (i+2)!=a[j] and (i+1)!=a[j]):
        b[i+2]=b[i+1]+b[i]
    if j>0 and a[j]==a[j-1]+1:
        b[N-1]=0
    if j+1<M and a[j+1]==a[j]+1:
        b[N-1]=0
    elif j>=0 and (i+2)==a[j]:
        b[i+2]=b[i]
    elif j>=0 and j+1<M and (i+1)==a[j]:
        j+=1
        b[i+2]=b[i+1]
    elif j>=0 and (i+1)==a[j]:
        b[i+2]=b[i+1]
print(b[N-1]%1000000007)
A = input()
B = input()
C = B[:len(B)]
if A == C:
  D = "Yes"
  else:
    D = "No"
print(D)

### FIXED CODE ###

A = input()
B = input()
C = B[:len(B)-1]
if A == C:
  D = "Yes"
else:
  D = "No"
print(D)
N = int(input())
A = list(map(int, input().split()))

S = sorted(A)
MAXS = max(A)

for i in range(N):
    if A[i] == MAXS:
        print(S[-2])
    else:
        print(S[-1])



### FIXED CODE ###

# N = int(input())
# A = list(map(int, input().split()))
# 
# S = sorted(A)
# MAXS = max(A)
# 
# for i in range(N):
#     if A[i] == MAXS:
#         print(S[-2])
#     else:
#         print(S[-1])
# 


n = int(input())
a = list()
for i in range(n):
    a.append(int(input()))
c = a.index(max(a))
m = max(a)
a.sort()
d = a[-2]
for i in range(n):
    if i == c:
        print(d)
    else:
        print(m)
n = int(raw_input())
i =0
while i <=n:
 if i%3==0
print'i'

### FIXED CODE ###

n = input()
x = 1
print '',
while True:
    if x > n:
        break
    if (x % 3 == 0) or ('3' in str(x)):
        print x,
    x += 1
import numpy as np
from numba import jit

@jit('i2[:](i2,i2,i2[:])',cashe=True)
def solve(n,k,A):
    l,r=0,0
    for i in range(k):
        B=np.zeros(n+1,dtype=np.int64)
        for x,y in enumerate(list(A)):
            l=max(0,x-y)
            r=min(n,x+y+1)
            B[l]+=1
            B[r]-=1
        A=np.cumsum(B[:-1])
        if A[A==n].size==n:
            break
    return A
n,k=map(int,input().split())
a=list(map(int,input().split()))
A=np.array(a)
X=solve(n,k,A)
print(*X,sep=' ')

### FIXED CODE ###

import numpy as np
from numba import jit
@jit(cache = True)
def solve(n,k,A):
    l,r=0,0
    for i in range(k):
        B=np.zeros(n+1,dtype=np.int64)
        for x,y in enumerate(list(A)):
            l=max(0,x-y)
            r=min(n,x+y+1)
            B[l]+=1
            B[r]-=1
        A=np.cumsum(B[:-1])
        if A[A==n].size==n:
            break
    return A
n,k=map(int,input().split())
a=list(map(int,input().split()))
A=np.array(a)
X=solve(n,k,A)
print(*X,sep=' ')
n = int(input())
k =[]*n
a = list(map(int, input().split()))

for i in range(n-1):
    k[a[i-1]] += 1

for i in range(k):
    print(k[i])

### FIXED CODE ###

n = int(input())
k =[0]*n
a = list(map(int, input().split()))

for i in range(n-1):
    k[a[i]-1] += 1

for i in range(len(k)):
    print(k[i])
while True:
    N,Q=map(int,raw_input().split())
    if N==Q==0:break
    T=[0]*51
    for i in range(N):
        L=map(int,raw_input().split())
        for j in L[1:]:
            T[j]+=1
    m=max(T)
    print 0 if m<Q else T.index(m)

### FIXED CODE ###

while True:
    N,Q=map(int,raw_input().split())
    if N==Q==0:break
    T=[0]*101
    for i in range(N):
        L=map(int,raw_input().split())
        for j in L[1:]:
            T[j]+=1
    m=max(T)
    print 0 if m<Q else T.index(m)
#!/usr/bin/env python3
    #
    # FILE: 2138-AtCoDeer_and_Paint_Cans.py
    #
    # @author: Arafat Hasan Jenin <opendoor.arafat[at]gmail[dot]com>
    #
    # LINK: https://abc046.contest.atcoder.jp/tasks/abc046_a?lang=en
    #
    # DATE CREATED: 17-06-18 00:09:52 (+06)
    # LAST MODIFIED: 17-06-18 00:19:32 (+06)
    #
    # VERDICT: Accepted
    #
    # DEVELOPMENT HISTORY:
    # Date         Version     Description
    # --------------------------------------------------------------------
    # 17-06-18     1.0         Deleted code is debugged code.
    #
    #               _/  _/_/_/_/  _/      _/  _/_/_/  _/      _/
    #              _/  _/        _/_/    _/    _/    _/_/    _/
    #             _/  _/_/_/    _/  _/  _/    _/    _/  _/  _/
    #      _/    _/  _/        _/    _/_/    _/    _/    _/_/
    #       _/_/    _/_/_/_/  _/      _/  _/_/_/  _/      _/
    #
    ##############################################################################
     
    print(len(set(map(int, input().split()))))

### FIXED CODE ###

l = list(map(int, input().split()))
s = set(l)

print(len(s))
i = list(map(int, input().split()))
H=i[0]
W=i[1]
x=H*W 
elif H==1 or W==1:
    print(1)
elif x%2==0:
    print(x//2)
else:
    print((x+1)//2)

### FIXED CODE ###

i = list(map(int, input().split()))
H=i[0]
W=i[1]
x=H*W 
if H==1 or W==1:
    print(1)
elif x%2==0:
    print(x//2)
else:
    print((x+1)//2)
import numpy as np

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())

s = np.array(s)
t = np.array(t)

s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
for i,ch_s in enumerate(s[0]):
  ans_tmp = s[1][i]
  for j,ch_t in enumerate(t[0]):
    if ch_s == ch_t:
      ans_tmp -= t[1][j]
  if ans_tmp > ans:
    ans = ans_tmp
print(int(ans))


### FIXED CODE ###

import numpy as np

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())

s = np.array(s)
t = np.array(t)
s_uni = np.unique(s)

ans = 0
for i,ch_s in enumerate(s_uni):
  ans_tmp = (s==ch_s).sum()
  ans_tmp -= (t==ch_s).sum()
  if ans_tmp > ans:
    ans = ans_tmp
print(int(ans))
a,b=int(input().split())
if (a%3==0) || (b%3==0) || ((a+b)%3==0):
  print("Possible")
else:
  print("Impossible")

### FIXED CODE ###

a,b=map(int,input().split())
if (a%3==0) or (b%3==0) or ((a+b)%3==0):
  print("Possible")
else:
  print("Impossible")