peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
C = [list(map(int,input().split())) for _ in range(3)]
if C[0][0]-C[0][1]==C[1][0]-C[1][1]==C[2][0]-C[2][1] and C[0][1]-C[0][2]==C[1][1]-C[1][2]==C[2][1]-C[2][2] \
    and C[1][0]-C[0][0]==C[1][1]-C[0][1]==C[1][2]-C[0][2] and C[2][0]-C[1][0]==C[2][1]-C[1][1]==C[2][2]-C[1][2]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, A, B = map(int, input().split())

Sum = 0
for i in range(N):
  a = (i+1)//1000
  b = (i+1)%1000//100
  c = (i+1)%100//10
  d = (i+1)%10
  e= a+b+c+d
  if e >= A and e <= B:
    Sum = Sum + (i+1)

print(Sum)
# Judge status: Accepted
a = list(map(int, input().split()))
if a[0] == a[1]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
from sys import stdin

n, m, k = map(int, stdin.readline().rstrip().split())

a = list(map(int, stdin.readline().rstrip().split()))
b = list(map(int, stdin.readline().rstrip().split()))

A,B = [0],[0]

for i in range(n):
    A.append(A[i]+a[i])

for i in range(m):
    B.append(B[i]+b[i])

ans = 0
j = m
for i in range(n + 1):
    if A[i] > k:
        break
    while A[i]  > k- B[j]:
        j -= 1
    ans = max(ans, i + j)

print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
a = [0]*n
ac = 0
wa = 0
for i in range(m):
    p,s = map(str,input().split())
    p = int(p)
    if s == "AC" and a[p-1] != -1:
        ac +=1
        wa += a[p-1]
        a[p-1] = -1
    elif s == "WA" and a[p-1] != -1:
        a[p-1] += 1
print(ac,wa)
# Judge status: Accepted
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])
# Judge status: Wrong Answer
s=input()
if len(s)==3 or len(s)==0:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
A,B = map (int, input ().split ())
p = 0
for i in range (2):
  if A > B:
    p += A
  else:
    p += B
print (p)
# Judge status: Wrong Answer
import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n,m = (int(x) for x in input().split())
a = list(map(int, input().split()))

lc = int(lcm_list(a) // 2)
if lc > m: print(0)
else: print(int((m / lc) // 2 + 1))
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]


n = int(input())

print(n*800 - n//15*200)
# Judge status: Wrong Answer
a,b,c = input().split('/')
if int(a) <= 2019 and int(b) <= 4 and int(c) <=30:
    print('heisei')
else:
    print('TBD')
# Judge status: Accepted
#138_C
import heapq
n = int(input())
v = list(map(int, input().split()))
heapq.heapify(v)

for _ in range(n-1):
    x = heapq.heappop(v)
    y = heapq.heappop(v)
    heapq.heappush(v, (x+y)/2)
print(heapq.heappop(v))
# Judge status: Accepted
a=list(map(int,input().split()))
if(sum(a)>=22):
    print("bust")
else:
    print("win")
# Judge status: Accepted
n,x,t = map(int,input().split())
a = n / x +0.99999999999
print(int(a)*t)
# Judge status: Wrong Answer
K = int(input())
A,B = input().split()
A = int(A)
B = int(B)

if K > B:
    print("NG")

if A <= K and K <=B:
    print("OK")

if K < B-A+1:
    print("OK")
else:
    print("NG")
# Judge status: Accepted
N,K = map(int, input().split())
h = list(map(int, input().split()))

dp = [0] + [1000000000000]*(N-1)

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

print(dp[-1])
# Judge status: Accepted
n = int(input())
klist = list(map(int,input().split()))
hlist = klist[::-1]
for i in range(n-1):
  if hlist[i]+1 < hlist[i+1]:
    print('No')
    break

  if hlist[i]+1 == hlist[i+1]:
    hlist[i+1] -= 1
else:print('Yes')
# Judge status: Accepted
a,b= map(int,input().split())
if a<=8 and b<=8: print('Yay!')
else: print(':(')
# Judge status: Wrong Answer
def main():
    line = input()
    A, B = [int(n) for n in line.split()]
    if A <= 8:
        print('Yay!')
    else:
        print(':(')
main()
# Judge status: Wrong Answer
x, y = map(int, input().split())

print(x+y/2)
# Judge status: Accepted
from itertools import combinations

n, x, y = map(int, input().split())

cnt = [0] * n
for i, j in combinations(range(n), 2):
    i, j = i + 1, j + 1
    dist = min(abs(j - i), abs(i - x) + abs(j - y) + 1,
               abs(i - y) + abs(j - x) + 1)
    cnt[dist] += 1

for i in range(1, n):
    print(cnt[i])
# Judge status: Accepted
n, k, q = map(int,input().split())
a = [input() for _ in range(q)]
b = [k for i in range(n)]
import numpy as np
np_b = np.array(b)
np_b -= q
np_backed_b = np_b.tolist()
for i in range(q):
  np_backed_b[int(a[i])-1] +=1
for i in range(n):
  if np_backed_b[i]<=0:
    print('No')
  else:
    print('Yes')
# Judge status: Accepted
l=list((map(int,input().split())))
ls=sorted(l,reverse=True)
print(ls[0]*10+ls[1]+ls[2])
# Judge status: Accepted
import math
import re
import copy
import sys

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

for i in range(n):
    c += min(a[i],b[i])
    if a[i] < b[i]:
        c += min(a[i+1],b[i]-a[i])
        a[i+1] -= min(a[i+1],b[i]-a[i])

print(c)
# Judge status: Accepted
a=sorted(list(map(int, input().split())))
b=0
while(True):
    if a[0]==a[1] and a[1]==a[2]:
        print(b)
        exit()
    elif a[0]==a[1]:
        a[0]+=1
        a[1]+=1
    else:
        a[0]+=2
    b+=1
    a=sorted(a)
# Judge status: Wrong Answer
n = input()

if int(n[1:]) % 111 == 0 or int(n[:-1]) % 111 == 0:
  print("Yes")
else:
  print("NO")
# Judge status: Accepted
# D - Summer Vacation

import heapq

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

w = [[0] for _ in range(m+1)] 

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

ans = 0
hq = []
for i in range(1, m+1):
    for j in w[i]:
        heapq.heappush(hq, -j)
    ans += heapq.heappop(hq)

print(ans * -1)
# Judge status: Accepted
D = input()
DL = [D[i] for i in range(3)]

print(DL.count('1'))
# Judge status: Accepted
n = int(input())
a = [int(x) for x in input().split()]

if n % 2 == 0:
    b = a[n - 1 : 0 : -2] + a[0 : n - 1 : 2]
else:
    b = a[n - 1 : : -2] + a[1 : n - 1 : 2]

print(*b)
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))

ac = 0
wa = 0

temp = -1
is_ac = False
temp_wa = 0
for i in range(M):
  s = input().split()
  no = int(s[0])
  result = s[1]

  if temp != no:
    temp = no
    temp_wa = 0
    is_ac = False
  
  if (not is_ac) and result == 'AC':
    is_ac = True
    ac += 1
    wa += temp_wa
  elif (not is_ac) and result == 'WA':
    temp_wa += 1

print(str(ac) + " " +  str(wa))
# Judge status: Accepted
a,b  = map(int, input().split())
print((a+b+1)//2)
# Judge status: Accepted
def main():
    a, b, c, d = [int(e) for e in input().split()]

    if d <= a or b <= c:
        print(0)
    elif a <= c and d <= b:
        print(d - c)
    elif c <= a and d <= b:
        print(d - a)
    elif a <= c and b <= d:
        print(b - c)
    elif c <= a and b <= d:
        print(b - a)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def main(A, B):
  A, B = list(map(int,input().split()))
  print(lcm(A, B))
# Judge status: Accepted
from itertools import product
from math import gcd

k = int(input())

result = 0
for a, b, c in product(range(1, k+1), repeat=3):
    result += gcd(a, gcd(b, c))

print(result)
# Judge status: Wrong Answer
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solve():
    l, r = MI()
    mod = 2019

    lst = []
    for i in range(0, min(pow(2019, 2), r-l)+1):
        t = (l + i) % mod
        lst.append(t)
        # print(t)
    lst.sort()
    print(lst[0] * lst[1])


if __name__ == '__main__':
    solve()
# Judge status: Accepted
n,a,b=map(int,input().split())
#整数の数はb-a+1
#最小の１つと最大の1つを除いたn-2個について考える
if n==1 and a!=b:
    print(0)
    exit()
elif n==1 and a==b:
    print(1)
    exit()
elif a>b:
    print(0)
    exit()
elif a==b:
    print(1)
    exit()
m=a*(n-2)#最小
M=b*(n-2)#最大
ans=M-m+1
print(ans)
# Judge status: Accepted
n=int(input())
a1=list(map(int,input().split()))
a2=list(map(int,input().split()))
ans=0
for i in range(n):
    tmp=0
    tmp+=sum(a1[:i+1])
    tmp+=sum(a2[i:])
    ans=max(tmp,ans)
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

H,W = [int(x) for x in input().split(" ")]

if H == 1 or W == 1:
    ans = 1
elif H % 2 == 0 or W % 2 == 0:
    ans = (H * W) // 2
else:
    ans = (H - 1) * W // 2 + (W + 1) //2

print(ans)
# Judge status: Wrong Answer
n = int(input())

a = [int(input()) for i in range(n)]
a_max = max(a)
a2 = a[:]
a2.remove(a_max)
a_second_max = max(a2)

for i in range(n):
    if i == max:
        print(a_second_max)
    else:
        print(a_max)
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

# In[38]:


import collections


# In[52]:


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


# In[54]:


a_cnt = collections.Counter(A)
p = sorted([i for i in a_cnt.items() if i[1] >= 2], reverse=True)
if len(p) > 0:
    if p[0][1]>=4:
        print(p[0][0]**2)
    elif len(p) > 1:
        print(p[0][0]*p[1][0])
    else:
        print(0)
else:
    print(0)


# In[ ]:
# Judge status: Accepted
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n, k = na()
h = na()

inf = 1 << 60
dp = [inf for i in range(n)]
dp[0] = 0

for i in range(n):
    p = min(i + k + 1, n)
    for j in range(i + 1, p):
        dp[j] = min(dp[j], dp[i] + abs(h[i] - h[j]))
print(dp[n - 1])
# Judge status: Wrong Answer
n=int(input())
t=list(str(n))
if n%10**(len(t)-1)==0:
  print(9*(len(t)-1))
elif n%10**(len(t)-2)==0:
  print(int(t[0])+9*(len(t)-1))
else:
  print(int(t[0])-1+9*(len(t)-1))
# Judge status: Accepted
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    H = II()
    from math import log2,floor
    print( 2**(floor(log2(H))+1)-1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
readline = sys.stdin.readline

N,M,K = map(int,readline().split())

A = [0] + list(map(int,readline().split()))
B = [0] + list(map(int,readline().split()))

for i in range(1, len(A)):
  A[i] += A[i - 1]

for i in range(1, len(B)):
  B[i] += B[i - 1]
  
import bisect

ans = 0
for i in range(len(A)):
  rest = K - A[i]
  if rest < 0:
    continue
  if ans < i:
    ans = i
  b_read = bisect.bisect_right(B, rest)
  if ans < i + b_read - 1:
    ans = i + b_read - 1
    
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
if A<8 and B <8:
    print("Yay!")
elif A==8 and B == 8:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
p=[k-q]*n
for i in range(q):
   #q回の正解が出る
    r=a[i]-1
    p[r]=p[r]+1
    #正解したら１点多くなる
for i in range(n):
    if p[i]>0:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))

print(max(a)-min(a))
# Judge status: Accepted
from operator import add
n,m,x=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]

ans=float('inf')
for i in range(2**n):
  c=0
  s=[0]*m
  for b in range(n):
    if i>>b&1:
      c+=l[b][0]
      for j in range(m):
        s[j]+=l[b][j+1]
  if all([e>=x for e in s]):
    ans=min(ans,c)
if ans==float('inf'):
  ans=-1
print(ans)
# Judge status: Accepted
a=list(map(int,input().split()))
if sum(a)>=22:
  print("bust")
elif sum(a)<=21:
  print("win")
# Judge status: Accepted
n = int(input())
 
a = list(map(int,input().split()))
 
cumsum_a = a.copy()
 
for i in range(n-1, -1, -1):
    cumsum_a[i] += cumsum_a[i+1]
 
ans = 0
node = 1
 
for i in range(n + 1):
    if a[i] > node:
        ans = -1
        break
 
    ans += node
 
    if i < n:
        node = min(2 * (node - a[i]), cumsum_a[i + 1])
 
print(ans)
# Judge status: Accepted
x = int(input())

a = x // 500
x = x - a * 500
b = x // 5

print(1000*a+5*b)
# Judge status: Wrong Answer
d,t,s= map(int,input().split())
if s*t>=d:
    print('yeah')
else:
    print('No')
# Judge status: Accepted
n, k = input().split()
n = int(n)
k = int(k)
res = 0
while n >= k:
    n /= k
    res += 1

res += 1
print(int(res))
# Judge status: Accepted
N = int(input())
l = []
for i in range(N):
    h = [int(x) for x in input().split()]
    l.append(h)
DP=[[0 for i in range(3)] for j in range(N+1)]
for j in range(0,N):
    for i in range(3):
        DP[j+1][i%3] = max(DP[j][(i+1)%3]+l[j][i%3], DP[j][(i+2)%3]+l[j][i%3])
print(max(DP[N][0],DP[N][1],DP[N][2]))
# Judge status: Accepted
from collections import Counter

s = list(input())

l = list(Counter(s).values())
for i in range(len(l)):
    if l[i] % 2 == 1:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
N, M = map(int, input().split())
From = set()
To = set()
for _ in range(M):
  a, b = map(int, input().split())
  if a == 1:
    From.add(b)
  if b == N:
    To.add(a)
if From.isdisjoint(To):
  print("INPOSSIBLE")
else:
  print("POSSIBLE")
# Judge status: Wrong Answer
print(min(map(list(open(0))[1].count,"#.")))
# Judge status: Wrong Answer
a, b = map(int, input().split())
count = 1
if b > 0:
  while a < b:
    a += a 
    count += 1
  print(count)
else:
  print(0)
# Judge status: Wrong Answer
n=int(input())
l=list(int(input()) for _ in range(5))
print(n//min(l)+5)
# Judge status: Accepted
n,m = map(int, input().split())

import math
mod = 10**9+7
if n==m:
    ans = math.factorial(n) * math.factorial(m) *2
    print(ans%mod)
elif abs(n-m)<2:
    ans = math.factorial(n) * math.factorial(m)
    print(ans%mod)
else:
    print(0)
# Judge status: Accepted
h, w = list(map(int, input().split()))
if h == 1 or w == 1:
    print(1)
elif (h * w) % 2 == 0:
    print((h * w) // 2)
else:
    print(((h * w) // 2) + 1)
# Judge status: Wrong Answer
n = input()

pay = ""
ret = ""
tmp = 0
for e in n[::-1]:
    e = int(e)
    e += tmp
    if e <= 5:
        pay += str(e)
        ret += "0"
        tmp = 0
    else:
        pay += str(0)
        ret += str(10 - e)
        tmp = 1

if tmp:
    pay += str(tmp)

pay = pay[::-1]
ret = ret[::-1]
#print(pay, ret)


ans = 0
for e in pay:
    ans += int(e)

for e in ret:
    ans += int(e)

print(ans)
# Judge status: Accepted
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


s = input()
stack = list()
for c in s:
    if c == 'B':
        if len(stack) > 0:
            stack.pop()
    else:
        stack.append(c)
print(''.join(stack))
# Judge status: Wrong Answer
a,b,k=map(int,input().split())
l=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        l.append(i)
print(l[k-1])
# Judge status: Accepted
A = list(map(int, input().split()))
A.sort(reverse=True)
K = int(input())
A[0] = A[0] * pow(2, K)

print(sum(A))
# Judge status: Accepted
s = input()
l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in range(7):
    if s == 'SUN':
        print(7)
        break
    else:
        if s == l[i]:
            print(7-i)
# Judge status: Accepted
N,Q = map(int,input().split())
S = input()
ruisekiwa = [0]*(N+1)
mode = 0
now = 0
for i in range(N):
  if S[i:i+2] == "AC":
    now += 1
  ruisekiwa[i+1] = now
for i in range(Q):
  l,r = map(int,input().split())
  print(ruisekiwa[r-1]-ruisekiwa[l-1])
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!


int_1 = input().split()

if int_1[0] <= int_1[2] <= int_1[1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b = map(int,input().split())
count = 0
while b > 0:
    b = b -a
    count += 1
print(count)
# Judge status: Accepted
from string import ascii_lowercase
from itertools import accumulate


def solve(string):
    n = int(string)
    t = [0] + [len(ascii_lowercase)**i for i in range(1, 12)]
    *t, = accumulate(t)
    l = 0
    ans = ""
    while t[l] < n:
        l += 1
    n -= t[l - 1] + 1
    for i in range(l - 1):
        j, n = divmod(n, len(ascii_lowercase)**(l - i - 1))
        ans += ascii_lowercase[j]
    ans += ascii_lowercase[n]
    return ans


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
# Judge status: Wrong Answer

def main():
  N = input()
  N_sum = 0
  
  if N == str(0):
    print("No")
    exit()
  
  for i in N:
    N_sum += int(i)
    
  if N_sum % 9 == 0:
    print("Yes")
  else:
    print("No")
  
if __name__ == "__main__":
  main()
# Judge status: Wrong Answer
N = int(input())
S = input()
print(max([len(set(S[:i])) + len(set(S[i:])) for i in range(N)]))
# Judge status: Accepted
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  I=list(map(int,str(i)))
  I2=list(reversed(I))
  if I==I2:
    ans+=1
print(ans)
# Judge status: Wrong Answer
print('ABC' if int(input()) <= 1000 else 'ABD')
# Judge status: Wrong Answer

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

if a >=12:
    print(12)
else:
    print(min(a,b))
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())

if 0 <= a or 0 <= c:
    if d < 0:
        print(a*d)
    elif b < 0:
        print(b*c)
    else:
        print(b*d)
elif 0 <= b or 0 <= d:
    print(a*c)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print(c-a+b)
# Judge status: Accepted
n = int(input())

if n%9 == 0:
  print('Yes')
  
else:
  print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
for k in range(1, max(a, b) + 1):
  if k - a == k - b:
    print(k)
    exit()
print("IMPOSSIBLE")
# Judge status: Accepted
n,s,c=int(input()),list(input()),0
for i in range(n):
  h=len(set(s[:i])&set(s[i:]))
  c=max(c,h)
print(c)
# Judge status: Accepted

from collections import defaultdict,deque
#from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

t=ii()
if t>=30:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
r = int(input())
pi = 3.141592
print(r * 2 * pi)
# Judge status: Accepted
S = input()

N = len(S)
l = S[0:(N-1)//2]
r = S[(N+3)//2 - 1:]
if l == r:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
N = int(input())
S = []
S_append = S.append
for i in range(N):
  S_append(input())
count = 0
while len(S) >0:
  S.remove(S[0])
  count += 1

print(count)
# Judge status: Wrong Answer
l = int(input())

print(pow(l/3, 2))
# Judge status: Wrong Answer
a,b,c,x,y = map(int,input().split())
c = c*2
n = max(x,y)
ans = 10**25
for i in range(10**6):
    x1,y1 = i,i
    p = c*i
    if x > x1:
        if y > y1:
            p += a*(x-x1) + b*(y-y1)
        else:
            p += a*(x-x1)
    else:
        if y > y1:
            p += b*(y+y1)
    if ans > p:
        ans = p

print(ans)
# Judge status: Accepted
line = list(input())
l = [int(s) for s in line]
a = sum(l)

print(a)
# Judge status: Accepted
n=int(input())
lamp = [int(input()) for i in range(n)]
cnt = 0
select = lamp[0]
while True:
  if cnt>n:
    print(-1)
    break;
  elif select == 2:
    cnt += 1
    print(cnt)
    break;
  else:
    select = lamp[select-1]
    cnt += 1
# Judge status: Wrong Answer
import numpy as np
N, X = [int(i) for i in input().split()]
xn = np.array([int(i) for i in input().split()])
xn = abs(X-xn)

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

ans = xn[0]
for i in range(1, len(xn)):
    ans = gcd(ans, xn[i])

print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

start = 0
end = (3 * N) - 1

ans = 0
while True:
    end -= 1
    ans += A[end]
    start += 1
    end -= 1
    if start > end:
        break

print(ans)
# Judge status: Wrong Answer
p = 0
n, a, b = map(int, input().split())
for i in input():
    if i == "a" and p > a+b:
        p += 1
        print("Yes")
    elif i == "b" and p > a+b and f > a+b:
        f += 1
        p += 1
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N, A, B, C, D = (int(i) for i in input().split())  
S = input()

bef = ''
row_dot_max = 0
count = 0
for i, s in enumerate(S):
  if bef == '#' and s == '#' and i > A and i <= max(C,D)-2:
    print('No')
    exit()
  
  if s == '.' and i >= B-2 and i <= D:
    count += 1
  else:
    row_dot_max = max(row_dot_max, count)
    count = 0
  bef = s

row_dot_max = max(row_dot_max, count)
if C > D:
  if row_dot_max >= 3:
    print('Yes')
  else:
    print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
N,K = map(int, input().split())
ans = 0
# if N > K and K == 1:
#     print(0)
#     exit(0)
if N < abs(N - K):
    ans = 0
elif N % K == 0:
    ans = 0
else:
    ans = abs(N % K - K)
# while N > abs(N - K):
#     N = abs(N - K)


print(ans)
# Judge status: Accepted
S = input()
T_l = [i for i in input()]
T_x = ''.join(T_l[0:-1])
if S==T_x:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
A,B,M=map(int,input().split())

al=[]
a=input().split()
for i in a:
    al.append(int(i))
bl = []
b=input().split()
for i in b:
    bl.append(int(i))

cl=[]
for i in range(M):
    l=[]
    c = input().split()
    for i in c:
        l.append(int(i))
    cl.append(l)

l=[]
for i in cl:
    a=0
    a=al[i[0]-1]+bl[i[1]-1]-i[2]
    l.append(a)

print(min(l))
# Judge status: Accepted
import math
a, b, h, m = map(float, input().split())
mm = (m % 60.0) * 6.0
hh = h * 30.0 + m * 0.5

rad = (mm - hh) * math.pi / 180.0
c = math.sqrt(math.pow(a, 2) + math.pow(b, 2) - 2 * a * b * math.cos(rad))

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

under1000 = N % 1000

if under1000 == 0:
  print(0)
else:
  print(1000 - under1000)
# Judge status: Accepted
import math
a=[int(input()) for i in range(5)]

b=[]
c=[]

for i in range(5):
  p=math.ceil(a[i]/10)*10
  b.append(p)
  c.append(list(str(a[i]-1)))

d=[]
for i in range(5):
  d.append(int(c[i][-1]))

print(sum(b)-(10-min(d)-1))
# Judge status: Wrong Answer
n = int(input())

a = 10**n % (10**9+7)
b = 8**n % (10**9+7)
c = 9**n % (10**9+7)

x = b + a - 2*c

print(x % (10**9+7))
# Judge status: Wrong Answer
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = list(ns())
    if S[0] == 'A' and 'C' in S[2:-2]:
        S.remove('A')
        S.remove('C')
        for s in S:
            if s.isupper():
                print('WA')
        print('AC')
    else:
        print('WA')


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
s = "aaa"
for i in range(n):
  d1 , d2 = map(int,input().split(" "))
  if d1 == d2:
    s += "b"
  else:
    s += "c"

if "bbb" in s:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
for i in range(N):
    A[i] = -A[i]
heapq.heapify(A)
for i in range(M):
    trgt = heapq.heappop(A)//2
    heapq.heappush(A,trgt)
print(-sum(A))
# Judge status: Wrong Answer
li = input().split()
print('AtCoder,li[1][0],Contest')