peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#!/usr/bin/env python3
from math import sqrt

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

sum = 0

for i in range(N):
    for j in range(N):
            sum += ((A[i][0] - A[j][0]) ** 2 + (A[i][1] - A[j][1]) ** 2) ** 0.5

print(sum/N)
# Judge status: Accepted
def int_(num_str):
    return int(num_str) - 1


N, M = map(int, input().split())
graph = [set() for _ in range(N)]
for _ in range(M):
    a, b = map(int_, input().split())
    graph[a].add(b)
    graph[b].add(a)
for i in range(1, N-1):
    if (0 in graph[i]) and (N-1 in graph[i]):
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")
# Judge status: Wrong Answer
li = list(map(int,input().split()))

print('Yes' if (li[0] * 100 + li[1] * 10 + li[2]) % 4 == 0 else 'No')
# Judge status: Wrong Answer
import math

def permutations(a,b):
    return math.factorial(a)//math.factorial(a-b)

n, m = map(int, input().split())
if abs(n-m)>2:
    print(0)
elif abs(n-m)==1:
    print(permutations(n,n)*permutations(m,m)%(10**9+7))
else:
    print(permutations(n,n)*permutations(m,m)*2%(10**9+7))
# Judge status: Accepted
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    S, T = read_str_list()
    A, B = read_int_list()
    U = read_str()
    if U == S:
      res = A - 1, B
    elif U == T:
      res = A, B - 1
    print(res[0], res[1])


main()
# Judge status: Wrong Answer
n=int(input())
print(1111 if n==999 else 111*(n//111) if n<111*(n//111) else 111*(n//111+1))
# Judge status: Accepted
X, Y = map(int, input().split())
if X % Y != 0:
    print(X)
elif X*2%Y != 0:
    print(X*2)
else:
    print(-1)
# Judge status: Wrong Answer
n,m=map(int,input().split())
x=list(map(int,input().split()))
x=sorted(x)

if n>=m:
    print(0)
    exit()

l=[]
for i in range(m-1):
    l+=[x[i+1]-x[i]]

l=sorted(l)
print(sum(l)-sum(l[:-(n-1)]))
# Judge status: Accepted
n, m = map(int, input().split())
j = [True]*(n + 1)
l = [1] + [0]*(n - 1)
jud = True
for i in range(m):
    s, c = map(int, input().split())
    if s == 1 and c == 0 and n != 1:
        jud = False
    if j[s]:
        l[s - 1] = c
        j[s] = False
    else:
        if l[s - 1] != c:
            jud = False
if not jud:
    print(-1)
elif n == 1 and m == 0:
    print(0)
else:
    print("".join(list(map(str, l))))
# Judge status: Accepted
n, m = map(int, input().split())
l = [list(map(int,input().split())) for i in range(n)]

d = [0 for i in range(10**5)]

for i in range(n):
    d[l[i][0]-1] += l[i][1]

cnt = 0
for i in range(10**5):
    cnt += d[i]
    if cnt >= m:
        print(i+1)
        exit()
# Judge status: Accepted
K,X = map(int,input().split(" "))
print("Yes" if 500*K>=X else "No")
# Judge status: Accepted
n = int(input())
s = input()

for i in range(1, n):
    if s[0] == s[i] and s[:i] == s[i:]:
        print("Yes")
        break
else:
    print("No")
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=b-a
print(c+1)
# Judge status: Wrong Answer
N=int(input())
x=N*800
y=200*(N%15)
ans=x-y
print(ans)
# Judge status: Accepted
n,k=[int(input()) for i in range(2)]
print(min(n,k)*int(input()) + max(n-k,0)*int(input()))
# Judge status: Accepted
N = int(input())
H = list(map(int,input().split()))

dp = [float("inf")]*N
dp[0] = 0

for i in range(1,N):
    if i == 1:
        dp[i] = min(dp[i],dp[i-1] + abs(H[i]-H[i-1]))
    else:
        dp[i] = min(dp[i],dp[i-1]+abs(H[i]-H[i-1]),dp[i-2]+abs(H[i]-H[i-2]))

print(dp[N-1])
# Judge status: Wrong Answer
a,b = map(int,input().split())
print('Possible' if (a+b)%3==0 else 'Impossible')
# Judge status: Accepted
import math
import decimal
a,b=input().split()
print(math.floor(int(a)*decimal.Decimal(b)))
# Judge status: Accepted
n= int(input())
a = list(map(int, input().split()))
m = a[0]
j = 0
k = 1
for i in range(1,n):
    if a[i] <= m:
        m = a[i]
        k += 1
        j = i
print(k)
# Judge status: Accepted
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

n = int(input())

if n == 1:
    print(1)
    exit()

a = 2
b = 1
now = 3
count = 2
for i in range(2, n):
    a = b
    b = now
    now = a+b

print(now)
# Judge status: Accepted
N,M = map(int,input().split())
A = list(map(int,input().split()))
if sum(A)>N:
    print(-1)
else:
    print(N-sum(A))
# Judge status: Accepted
[N,K]=list(map(int, input().split()))
h=list(map(int, input().split()))

dp=[[0 for i in range(K+1)] for j in range(N)]

for i in range (1,min(N,K)):
    for j in range (0,i):
        dp[i][j]=dp[i-j-1][K]+abs(h[i-j-1]-h[i])
    dp[i][K]=min(dp[i][0:i])

for i in range (K,N):
    for j in range (0,K):
        dp[i][j]=dp[i-j-1][K]+abs(h[i-j-1]-h[i])
    dp[i][K]=min(dp[i][0:K])

print(dp[N-1][K])
# Judge status: Wrong Answer
import fractions

n = int(input())
a_lst = list(map(int,input().split()))
gcd_lst = []

for i in range(n):
    b_lst = a_lst.copy()
    del b_lst[i]
    max_gcd = b_lst[0]

    for j in range(n-2):
        b1 = b_lst[j]
        b2 = b_lst[j+1]
        max_gcd = fractions.gcd(b1,b2)

    gcd_lst.append(max_gcd)

answer = max(gcd_lst)
print(answer)
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
ans = 10**10
for a in A:
    tmp = 0
    while(a%2 == 0):
        a = a//2
        tmp += 1
    ans = min(ans,tmp)
print(ans)
# Judge status: Accepted
from collections import Counter

N = int(input())
S = input()

MOD = 10**9 + 7
cnt = Counter(S)
ans = 1
for i in cnt.values():
    ans *= (i + 1)
    ans %= MOD
print(ans-1)
# Judge status: Accepted
import functools

K=int(input())
 
if K%2==0:
    print(-1)
    exit(0)

mod=0

for i in range(1,pow(10,6)):
    mod=(mod*10+7)%K
    if mod==0:
        print(i)
        exit(0)
        
print(-1)
# Judge status: Accepted
n=int(input())
mod=10**9+7
ans=pow(10,n,mod)-(2*pow(9,n,mod)-pow(8,n,mod))
print(ans%mod)
# Judge status: Wrong Answer
n,r = list(map(int,input().split()))
ans = 0
if(n < 10):
    ans = r
if(n >= 10):
    ans = r+100*(10-n)
print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
alist=list(map(int,input().split()))

cnt=0
while cnt<K:
  blist=[0]*(N+1)
  for i in range(N):
    l=max(0,i-alist[i])
    r=min(N-1,i+alist[i])
    blist[l]+=1
    blist[r+1]-=1
  
  alist[0]=blist[0]
  for i in range(1,N):
    alist[i]=alist[i-1]+blist[i]
  cnt+=1
  
  #print(alist,blist)
  if min(alist)==N:
    break
  
#print(cnt)
print(*alist)
# Judge status: Accepted
a, b = map(int, input().split())

if a > 9 or b > 9:
  print(-1)
else:
  print(a * b)
# Judge status: Accepted
n,q = map(int,input().split())
s = str(input())

t = [0]
for i in range(n-1):
        if s[i:i+2] == "AC":
                t.append(t[-1]+1)
        else:
                t.append(t[-1])

for i in range(q):
        l,r = map(int,input().split())
        print(t[r-1]-t[l-1])
# Judge status: Accepted
print("ARC" if input()=="ABC" else "ABC")
# Judge status: Wrong Answer
l = list(map(int, input().split(sep='/')))

if l[0] > 2019:
    print('TBD')
else:
    if l[1] > 5:
        print('TBD')
    else:
        print('Heisei')
# Judge status: Accepted
N = input()
ans = 'No'
for i in N:
  if i == '9':
    ans = 'Yes'
print(ans)
# Judge status: Wrong Answer
#Coding:Utf-8

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

check=[0 for i in range(N)]
M=0
b=[]
for j in reversed(range(N)):
    total=0
    for k in range(1,int(N/(j+1))):
        total+=check[int((j+1)/k)-1]
    if a[j]!=total:
        M+=1
        check[j]=1
        b.append(j+1)

print(M)
for l in range(len(b)):
    print(b[l],end='')
else:
    print()
# Judge status: Accepted
X = int(input())
fhun = X//500
amari = X % 500
fiv = amari//5
ure = fhun*1000 + fiv*5

print(ure)
# Judge status: Accepted
n = int(input())
s = input()

res = 0
for i in range(1, n):
    res = max(res, len(set(s[0:i]) & set(s[i:])))
print(res)
# Judge status: Accepted
nums = list(map(int,input().split()))
A = nums[0]
B = nums[1]
if abs(A-B) % 2 != 0:
  print("IMPOSSIBLE")
else:
  mini = min(A,B)
  print((A+B)//2)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
m = max(a)
r = -1
for i in a:
  if i != m and abs(m - 2 * i) < abs(m - 2 * r):
    r = i
print(m, r)
# Judge status: Wrong Answer
n = int(input())
if n in range(400, 599):
    print(8)
elif n in range(600, 799):
    print(7)
elif n in range(800, 999):
    print(6)
elif n in range(1000, 1199):
    print(5)
elif n in range(1200, 1399):
    print(4)
elif n in range(1400, 1599):
    print(3)
elif n in range(1600, 1799):
    print(2)
elif n in range(1800, 1999):
    print(1)
# Judge status: Accepted
import math
def resolve():
    x = int(input())
    sqrt_x = int(math.sqrt(x))
    al = list()
    for i in range(2, 10):
        for j in range(sqrt_x, 0, -1):
            if j**i <= x:
                al.append(j**i)
                break
    al = sorted(al)
    print(al[-1])
resolve()
# Judge status: Accepted
a,b=map(int,input().split())

print((a+b)%24)
# Judge status: Accepted
x,n=map(int,input().split())
p=list(map(int,input().split()))
q=list(range(-1,200))
for i in range(n):
    q.remove(p[i])
ans=-100
for i in q:
    if abs(x-i)==abs(x-ans):
        ans=min(i,ans)
    elif abs(x-i)<abs(x-ans):
        ans=i
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())

print('Yes' if a + b >= c else 'No')
# Judge status: Wrong Answer
N=int(input())
W=[]
li=[]
flag=True
flag2=True
for i in range(N):
  W.append(str(input()))
for i in range(N):
  if not(W[i] in li):
    li.append(W[i])
  else:
    print('No')
    flag=False
    flag2=False
if flag:
  for i in range(1,N-1):
    if li[i-1][-1]!=li[i][0] and li[i][-1]!=li[i+1][0]:
      print('No')
      flag2=False
      break
if flag2:
  print('Yes')
# Judge status: Accepted
def main():
    N = int(input())

    orda = ord('a')
    ans = ''
    
    while N:
        N -= 1
        N, Nmod = divmod(N, 26)
        ans = chr(orda + Nmod) + ans

    print(ans)


if __name__ == '__main__':
	main()

exit()
# Judge status: Accepted
k,a,b=map(int,input().split())
print(max(a+(b-a)*((k-a+1)//2)+(k-a+1)%2,1+k))
# Judge status: Wrong Answer
a=int(input())
 
if a%2 == 0:
  print(-1)
else:
  ans = 1
  div = 0
  
  for i in range(10**6):
    div += 7*10**i
    if a%div == 0:
      break
    else:
      ans +=1
  
  print(ans)
# Judge status: Accepted
line_num = input()
line = line_num.split(" ")
a = line[0]
b = line[1]
c = line[2]
print(c+" "+a+ " "+b)
# Judge status: Wrong Answer
s = input()

if int(s[6])<4:
    ans = "Heisei"
elif int(s[6]) == 4:
    if int(s[8])<3:
        ans = "Heisei"
    else:
        ans = "TBD"
else:
    ans = "TBD"

print(ans)
# Judge status: Wrong Answer
N,R=list(map(int,input().split()))

if N>=10:
  A=R
else:
  A=100*(10-N)
print(A)
# Judge status: Accepted
A = [input().split() for _ in range(3)]
N = int(input())
B = [input() for _ in range(N)]

for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            A[i][j] = 0

if A[0][0] == A[1][1] == A[2][2] or A[0][2] == A[1][1] == A[2][0]:
    print('Yes')
    exit()

for n in range(3):
    if A[0][n] == A[1][n] == A[2][n] or A[n][0] == A[n][1] == A[n][2]:
        print('Yes')
        exit()

print('No')
# Judge status: Accepted
N = int(input())

if N == 1:
  print(1)
elif N % 2 == 0:
  print(0.5)
else:
  print(-(-N//2) / N)
# Judge status: Wrong Answer
N,K = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [0] * N
if K*N >= 10**7:
    ans = [min(N,K)] * N
    for i in range(N):
        print(ans[i],end=" ")
        exit()
for i in range(K):
    for j in range(N):
        b[j] = a[j]
    a = [0] * N
    for j in range(N):
        for k in range(max(0,j-b[j]),min(j+b[j],N-1)+1):
            a[k] += 1
for i in range(N):
    print(a[i],end=" ")
# Judge status: Accepted
s=input()
k='keyence'
if k in s:
    exit(print('YES'))

for i in range(len(k)):
    #print(s[:i], s[len(k)-i:])
    if s[:i]+s[len(s)-len(k)+i:] == k:
        exit(print('YES'))
print('NO')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
s=[0]
for i in range(n):
    s.append(s[i]+a[i])
ans=10**9+10**9+1
for i in range(1,n):
    ans=min(ans,abs(s[n]-s[i]-s[i]))
print(ans)
# Judge status: Wrong Answer
a = int(input())
s = input()
if a >= 3200:
  print("red")
else:
  print(s)
# Judge status: Accepted
n = int(input())
s = input()
t = input()

cw = 0
c = 1
while len(t) >= c:
    if s[len(s)-c:] == t[:c]:
        cw = c
    c += 1

print(max(n, len(s)+len(t)-cw))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
d = 10000
for i in range(n):
  s1 = sum(l[0:i])
  s2 = sum(l)-s1
  b = abs(s2-s1)
  d = min(d,b)
print(d)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())

if 22 <= a*b+c:
    print("bust")
else:
    print("win")
# Judge status: Accepted
a,b = map(int, input().split())
if max(a, b) > 8:
  print(":(")
else:
  print("Yay!")
# Judge status: Wrong Answer
D, N = map(int,input().split())
if N != 100:
    print(str(N)+"0"*(D*2))
else:
    print(int(str(N)+"0"*(D*2))+1)
# Judge status: Accepted
NM = input().split() #N 個の展望台 M本の道
N = int(NM[0])
M = int(NM[1])

H = [] #展望台の高さ
H = input().split()

R =[True]*(N+1)
R[0]=False


for i in range(M):
  tmp = input().split()
  tmp_int = [0,0]
  tmp_int[0] = int(tmp[0])
  tmp_int[1] = int(tmp[1])
  if  int(H[tmp_int[0]-1]) >= int(H[tmp_int[1]-1]):
    R[tmp_int[1]]=False
  if int(H[tmp_int[0]-1]) <= int(H[tmp_int[1]-1]):
    R[tmp_int[0]]=False
    
print(R.count(True))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**6)

def dfs(n):
    if n > 3234566667:
        return
    ans.append(n)
    if n % 10 != 0:
        dfs(n * 10 + (n % 10) - 1)
    dfs(n * 10 + (n % 10))
    if n % 10 != 9:
        dfs(n * 10 + (n % 10) + 1)

N = int(input())
ans = []
for i in range(1, 10):
    dfs(i)
ans.sort()
print(ans[N - 1])
# Judge status: Wrong Answer
input()
print(['No War','War'][sorted([int(i) for i in input().split()])<sorted([int(i) for i in input().split()])])
# Judge status: Wrong Answer
import math

N, K = map(int, input().split())
A_list = list(map(int, input().split()))

ans = (N-1)//(K-1) + 1
if K != N:
    print(ans)
else:
    print(1)
# Judge status: Accepted
n, m = map(int, input().split())
ans = 0
amari = 0
ncc = int(m / (2 * n))
if ncc >= 1:
    ans += n
    amari = m - 2 * n
    ans += int(amari / 4)
else:
    ans += int(m / 2)


print(ans)
# Judge status: Wrong Answer
from collections import Counter
N=int(input())
A=list(map(int ,input().split()))
D=Counter(A)
#print(D.items())
L=[]
for num, v in D.items():
    if v>=4:
        L.append((num,4))
    elif v>=2:
        L.append((num, 2))

L=sorted(L, reverse=True)
ans=0
for i,t in enumerate(L):
    num,v=t
    if v==4:
        ans=num*num
        break
    else:
        if ans==0:
            ans=1
        ans*=num
    if i==1:
        break
print(ans)
# Judge status: Accepted
#!/usr/bin/env pypy3
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    N=I()
    ans=1
    for i in range(10**5):
        a=i*i
        if a>N:
            ans=(i-1)*(i-1)
            break
    print(ans)

main()
# Judge status: Wrong Answer
A = {i-97:chr(i) for i in range(97,123)}
B = {v:k for k,v in A.items()}
s = list(input().strip())
K = int(input())
for i in range(len(s)-1):
    if K>=26-B[s[i]]:
        K -= (26-B[s[i]])
        s[i]="a"
k = K%26
ind = (B[s[-1]]+k)%26
s[-1] = A[ind]
print("".join(s))
# Judge status: Wrong Answer
import math
N,D=map(int,input().split())
X=[list(map(int,input().split()))for i in range(N)]
ans=0
dist=0.0
for i in range(N):
    for j in range(i+1,N):
        dist=0.0
        for k in range(D):
            dist+=(X[i][k]-X[j][k])**2
        print(dist.is_integer())
        if dist.is_integer() is True:
            ans+=1
print(ans)
# Judge status: Wrong Answer
X = int(input())
if X > 30:
  ans = 'No'
else:
  ans = 'Yes'
print(ans)
# Judge status: Wrong Answer
string_list = [input() for i in range(3)]

a = int(string_list[0])
b = int(string_list[1])
h = int(string_list[2])

answer = (a+b)*h/2

print(answer)
# Judge status: Accepted
import heapq


N, M = [int(x) for x in input().split()]
A = [-int(x) for x in input().split()]

heapq.heapify(A)
for i in range(M):
    a = -heapq.heappop(A)
    a //= 2
    heapq.heappush(A, -a)

print(-sum(A))
# Judge status: Wrong Answer
import sys
readline = sys.stdin.readline
INF = 10**9


def main():
  n = int(readline())
  A = list(map(int, readline().split()))
  A.sort()
  if A[1]%A[0] == 0:
    print(A[0])
  else:
    print(0)
  
  
  
  
if __name__ == "__main__":
  main()
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
h = h[::-1]
count = 0
for i in range(1, n):
    if h[i]-h[i-1]==1:
        h[i]+=-1
    elif h[i]-h[i-1]>=2:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
N = input()
answer = int(N)*(int(N)+1)//2
print(answer)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

mem = [0]*(n)
for i in range(n-1):
    mem[a[i]-1] += 1

for i in mem:
    print(i)
# Judge status: Accepted
n = int(input())
S = input()
new_S = ''
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for d in range(len(S)):
    for p in alp:
        if S[d] == p:
            i = int(alp.index(p))
            i = i + n
            if i >= 26:
                i = i - 26
            new_S += alp[i]
print(new_S)
# Judge status: Accepted
L=[int(x) for x in input().split()]
A=L[0]
B=L[1]
K=L[3]
if K%2==0:
  d=A-B
else:
  d=B-A
if d>10**18:
  print('Unfair')
else:
  print(d)
# Judge status: Accepted
a=int(input())
if a<30:
    print('No')
if a>=30:
    print('Yes')
# Judge status: Accepted
h = int(input())
c = 0
while True :
    h = h // 2
    c += 1
    if h == 0 :
        break
print(2**c-1)
# Judge status: Wrong Answer
import collections
n=int(input())
s=[]
for _ in range(n):
	s.append(input())
c=collections.Counter(s)
m=int(input())
for _ in range(m):
	t=input()
	c[t] -= 1
print(max(c.values()))
# Judge status: Accepted
N = int(input())

if N % 2 == 1:
    print(0)
else:
    ans = 0
    N //= 2
    while N:
        ans += N // 5
        N //= 5
    print(ans)
# Judge status: Wrong Answer
N = int(input())
p_list = list(map(int, input().split()))

count = 0 # p_j > p_i である回数
for i in range(len(p_list)):
    flag = True
    for j in  p_list[:i+1:-1]:
        if i>j:
            flag = False
            break
    if flag:
        count = count + 1

print(count)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
ans = 0 
for i in range(n):
    if p[i] != i+1:
        ans += 1
    if ans >= 3:
        print("NO")
        exit()
print("YES")
# Judge status: Wrong Answer
b = list(input())
num = 0
for i in b:
    if i == "9":
        num += 1
        break
if num == 1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
def mi():return map(int,input().split())
import math
a,b,c=mi()

if c-a-b-2*math.sqrt(a*b)>0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(10000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

if __name__ == "__main__":
    n = int(input())
    ans = 0
    for i in range(int(n**0.5)+1):
        ans = i
    print(ans)
# Judge status: Wrong Answer
N=int(input())
S=input()
ans=0
for i in range(N-1):
  A=set(S[:i+1])
  B=set(S[i:])
  cnt=0
  for j in A:
    if (j in B):
      cnt+=1
  ans=max(ans,cnt)
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
for _ in range(k):
    if c<=b or c<=a:
        c*=2
    elif b<=a:
        b*=2
    else:
        c*=2
print("Yes" if c>b and b>a else "No")
# Judge status: Accepted
n,d = map(int,input().split())
print (-(-n//((d*2)+1)))
# Judge status: Wrong Answer
a,b = map(int, input().split())
print(((a+b)//2))
# Judge status: Accepted
INF=1000000007
N,M=map(int,input().split())
A=[]
B=[]
for i in range(N):
  a,b=list(map(int,input().split()))
  A.append([a,b])
for i in range(M):
  c,d=list(map(int,input().split()))
  B.append([c,d])
for i in A:
  m=INF
  p=0
  for j in range(M):
    d=abs(i[0]-B[j][0])+abs(i[1]-B[j][1])
    if m>d:
      m=d
      p=j+1
  print(p)
# Judge status: Wrong Answer
def main():
    A, B, C = map(int, input().split())

    ans = 0
    if (2 * A - B - C) == 0 and (2 * B - A - C) == 0 and (2 * C - A - B) == 0:
        print(-1)
    else:
        for i in range(10**7):
            if A % 2 == 1 or B % 2 == 1 or C % 2 == 1:
                print(ans)
                exit()

            A, B, C = (B + C)//2, (A + C)//2, (A + B)//2
            ans += 1

if __name__ == "__main__":
    main()
# Judge status: Accepted
n,k,s=map(int,input().split())
a=[s]*k
b=[3]*(n-k)+[s]*k
p=max(s//2-1,1)
for i in range(n-k):
    if i%p==0:
        a.append(s-1)
    else:
        a.append(2)
if s!=2 and s!=1:
    print(*a)
else:
    print(*b)
# Judge status: Accepted
#https://note.nkmk.me/python-gcd-lcm/
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n = int(input())
a = list(map(int,input().split()))

print(gcd_list(a))
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())

print(n//max(h,w)+1)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n):
    ans += (n-1)//i
print(ans)
# Judge status: Wrong Answer
N,Q = [int(x) for x in input().split()]
s = input()
l = list(s)
rui = [0] * (N+1)
for i in range(2,len(l)+1):
    if l[i-2] == "A" and l[i-1] == "C":
        rui[i] = rui[i-1] + 1
    else:
        rui[i] = rui[i-1]
for i in range(Q):
    a,b = [int(x) for x in input().split()]
    print(rui[b]-rui[a])
print(rui)
# Judge status: Wrong Answer
K,X=input().split()
if 500 * K >= X:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
S = input()
ok=1
for i in range(len(S)-1):
  if S[i] == S[i+1]:
    ok=0
    break
    
if ok:
  print("Good")
else:
  print("Bad")
# Judge status: Wrong Answer
A, B = map(int, input().split())

x = int(A * (100/8))
y = int(B * (100/10))

if x == y:
    print(x)
elif int(x * (10/100)) == A:
    print(x)
elif int(y * (8/100)) == A:
    print(y)
else:
    print(-1)
# Judge status: Accepted
x,y = [int(x) for x in input().split()]

if x % y == 0:
    print(-1)
else:
    print(x)
# Judge status: Accepted
import collections

n = int(input())
s = list(input() for i in range(n))
s = sorted(s)
c = collections.Counter(s)
p = max(c.values())
s = sorted(list(set(s)))

for i in range(len(s)):
    if c[s[i]] == p:
        print(s[i])
# Judge status: Wrong Answer
L = sorted(list(map(int,input().split())))
s1 = L[2] -L[0]
s2 = L[2] -L[1]
if s1 * s2 % 2 == 0:
  print((s1+s2)//2)
elif s2 % 2 == 0:
  print(s1//2+s2//2+1)
elif s1 % 2 == 0:
  print(s1//2+s2//2+1)
else:
  print(s1//2+s2//2-1)
# Judge status: Wrong Answer
n,m=map(int,input().split())

if n==1:
  print(m-2)
  exit()
if m==1:
  print(n-2)
  exit()

if n==2 or m==2:
  print(0)
  exit()

print((n-2)*(m-2))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
for i in range(n):
    ans += b[a[i]-1]
    if i <= n-2 and a[i]+1 == a[i+1]:
        ans += c[a[i]-1]
print(ans)
# Judge status: Accepted
S = input()

rst = 0
for i in range(0,3):
  cnt = 0
  if S[i] == "R":
    cnt += 1
    for j in range(i+1,3):
      if S[j] == "R":
        cnt+= 1
      else:
        break
  rst = max(rst,cnt)
print(rst)
# Judge status: Wrong Answer
N = int(input())
X = list(map(int, input().split()))
sum_min = 10**5

for i in range(min(X), max(X)+1):
    s = 0
    for j in range(N):
        s += (X[j] - i)**2
    
    if s < sum_min:
        sum_min = s

print(sum_min)
# Judge status: Accepted
O=input()
E=input()

ans=""  
for i in range(len(O)):
  if len(O)-len(E)==0:
    ans=ans+(O[i]+E[i])
  elif len(O)-len(E)==1:
    if i<=len(E)-1:
      ans=ans+(O[i]+E[i])
    else:
      ans=ans+O[i]
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
print(x if not x % y == 0 else -1)