Harryxun/stf_run huggingface dataset:
l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for i in range(l)]
b = [[0 for i in range(n)] for i in range(m)]
c = [[0 for i in range(n)] for i in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += (a[i][m] * b[m][j])
 print(" ".join([str(x) for x in c[i]]))

### FIXED CODE ###

l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for i in range(l)]
b = [[0 for i in range(n)] for i in range(m)]
c = [[0 for i in range(n)] for i in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += (a[i][k] * b[k][j])
 print(" ".join([str(x) for x in c[i]]))
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse =True)
width = 0
height = 0
found = False
for i in A:
    if A.count(i) >= 4:
        width = i
        height = i
        count += 1
        break
    elif A.count(i) >= 2:
        if width == 0:
            width = i
        elif not i == width:
            height = i
            found = True
            break

if found:
    print(width * height)
else:
    print('0')

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
l = []

for i in range(0, N - 1):
    if len(l) == 2:
        break
    if A[i] == A[i + 1] and not A[i] == 0:
        l.append(A[i])
        A[i + 1] = 0
        
if len(l) == 2:
    print(l[0] * l[1])
else:
    print('0')
D=int(input())
if D=25:
  print("Christmas")
elif D=24:
  print("Christmas Eve")
elif D=23:
  print("Christmas Eve Eve")
elif D=22:
  print("Christmas Eve Eve Eve")


### FIXED CODE ###

D=int(input())
if D==25:
  print("Christmas")
elif D==24:
  print("Christmas Eve")
elif D==23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
a, b, k = map(int, input().split())
x = list(range(a, b+1))
C = list(set(x[:k] + x[-k:]))
C.sort()
for c in C:
    print(c)

### FIXED CODE ###

a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)
from collections import deque
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
cnt = [[float('inf')]*w for _ in range(h)]
moves = ((0, 1), (0, -1), (1, 0), (-1, 0))
q = deque([])
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      cnt[i][j] = 0 
 
def bfs():
  while q:
    y, x = q.popleft()
    for dy, dx in moves:
      ny = y + dy
      nx = x + dx 
      if 0 <= ny < h and 0 <= nx < w and a[ny][nx] == '.' and used[ny][nx] == 0:
        used[ny][nx] = 1
        cnt[ny][nx] = min(cnt[ny][nx], cnt[y][x]+1)
        q.append([ny, nx])
 
used = [[0]*w for _ in range(h)]
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      used[i][j] = 1
      q.append([i, j])
 
bfs()
 
ans = 0
for i in range(h):
  for j in range(w):
    ans = max(ans, cnt[i][j])
print(ans)
from collections import deque
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
cnt = [[float('inf')]*w for _ in range(h)]
moves = ((0, 1), (0, -1), (1, 0), (-1, 0))
q = deque([])
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      cnt[i][j] = 0 

def bfs():
  while q:
    y, x = q.popleft()
    for dy, dx in moves:
      ny = y + dy
      nx = x + dx 
      if 0 <= ny < h and 0 <= nx < w and a[ny][nx] == '.' and used[ny][nx] == 0:
        used[ny][nx] = 1
        cnt[ny][nx] = min(cnt[ny][nx], cnt[y][x]+1)
        q.append([ny, nx])

used = [[0]*w for _ in range(h)]
for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      used[i][j] = 1
      q.append([i, j])

bfs()

ans = 0
for i in range(h):
  for j in range(w):
    ans = max(ans, cnt[i][j])
print(ans)


### FIXED CODE ###

from collections import deque
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]
moves = ((1, 0), (-1, 0), (0, 1), (0, -1))
cnt = [[float('inf') for _ in range(w)] for _ in range(h)]
ans = 0
searched = [[0 for _ in range(w)] for _ in range(h)]
q = deque([])

def bfs():
  while q:
    y, x = q.popleft()
    for dy, dx in moves:
      next_y = y + dy
      next_x = x + dx 
      if 0 <= next_y < h and 0 <= next_x < w and searched[next_y][next_x] == 0 and a[next_y][next_x] == '.' and cnt[next_y][next_x] > cnt[y][x]+1:
        searched[next_y][next_x] = 1
        q.append([next_y, next_x])
        cnt[next_y][next_x] = cnt[y][x]+1

for i in range(h):
  for j in range(w):
    if a[i][j] == '#':
      cnt[i][j] = 0
      searched[i][j] = 1
      q.append([i, j])

bfs()
for i in range(h):
  for j in range(w):
    ans = max(ans, cnt[i][j])

print(ans)
from collections import defaultdict, deque, Counter
N, Q = map(int, input().split())

connection = defaultdict(list)
for i in range(N-1):
    a,b =  map(int, input().split())
    connection[a].append(b)

operations = Counter()
for i in range(Q):
    p,q =  map(int, input().split())
    operations[p] += q

children = defaultdict(set)
for i in range(1,N+1):
    children[i].add(i)
    d = deque(connection[i])
    checked = set(connection[i])
    while len(d) > 0:
        x = d.popleft()
        children[i].add(x)
        d += connection[x]

ans = []
for i in range(1, N+1):
    for v in children[i]:
        cnt += operations[v]
        print(cnt)
    ans.append(str(cnt))
print(' '.join(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
from collections import deque

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

connection = [[] for i in range(N)]
for i in range(N-1):
    a,b =  map(int, input().split())
    connection[a-1].append(b)
    connection[b-1].append(a)

operations = [0] * N
for i in range(Q):
    p,q =  map(int, input().split())
    operations[p-1] += q

ans = [0] * N

stack = deque([1])
while len(stack)>0:
    node = stack.pop()
    ans[node-1] += operations[node-1]
    for node_c in connection[node-1]:
        connection[node_c-1].remove(node)
        ans[node_c-1] += ans[node-1]
        stack.append(node_c)

print(' '.join(map(str, ans)))
alphabet = list('abcdefghijklmnopqrstuvwxyz')

s=input()

ss = alphabet.index(s)

print(alphabet[ss])


### FIXED CODE ###

s = input()
alphabet = list('abcdefghijklmnopqrstuvwxyz')
print(alphabet[alphabet.index(s)+1])
n = input()
l = map(int, raw_input().split())
max = l[0]
min = l[0]
s = 0
for i in range(n+1):
 if max < l[i]:
  max = l[i]
 if min > l[i]:
  min = l[i]
 s += s + l[i]
print min, max, s

### FIXED CODE ###

n = input()
l = map(int, raw_input().split())
max = l[0]
min = l[0]
s = 0
for i in range(n):
 if max < l[i]:
  max = l[i]
 if min > l[i]:
  min = l[i]
 s = s + l[i]
print min, max, s
n=int(input())
for i in range(n):
	rest=list(input().split())
a=rest
rest.sort()
for i in range(n):
	print(rest.index(a[i]))
		


### FIXED CODE ###

from collections import defaultdict
n=int(input())

rest=defaultdict(list)
for i in range(n):
	s,h=input().split()
	rest[s].append([int(h),i+1])
for k in sorted(list(rest.keys())):
	for p,i in sorted(list(rest[k]),key=lambda x:x[0])[::-1]:
		print(i)
s = input()
ans = 0
for i in range len(s):
  if(s[i] == '+'):
    ans += 1

print(ans)

### FIXED CODE ###

s = input()
ans = 0
for i in range(len(s)):
  if(s[i] == '+'):
    ans += 1
  else:
    ans -= 1
print(ans)
N,X = map(int, input().split())
L = list(map(int, input().split()))
count = 0
D = 0
i = 0

while D < X+1:
  count += 1
  D += L[i]
  i += 1
  
  
print(count)

### FIXED CODE ###

N,X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
D = 0

for i in range(N):
  D += L[i]
  if D <= X:
    count += 1
  else:
    break

print(count)
from functools import reduce

def judge(S):
    kingaku = [int(x) for x in list(S)]
    maxkosuul = kingaku[:-2]
    keta = kingaku[-2:]
    maxkosuu = int(reduce(lambda x, y: x + y, [str(x) for x in maxkosuul]))
    simo = int(reduce(lambda x, y: x + y, [str(x) for x in keta]))
    simo1 = simo - simo//5*5
    simo2 = simo1 - simo1//4*4
    simo3 = simo2 - simo2//3*3
    simo4 = simo3 - simo3//2*2
    if simo//5+simo1//4+simo2//3+simo3//2+simo4 <= maxkosuu :
        print(1)
    else:
        print(0)

S = input()
judge(S)

### FIXED CODE ###

from functools import reduce

def judge(S):
    if int(S) < 100:
        print(0)
        return

    kingaku = [int(x) for x in list(S)]
    maxkosuul = kingaku[:-2]
    keta = kingaku[-2:]
    maxkosuu = int(reduce(lambda x, y: x + y, [str(x) for x in maxkosuul]))
    simo = int(reduce(lambda x, y: x + y, [str(x) for x in keta]))
    simo1 = simo - simo//5*5
    simo2 = simo1 - simo1//4*4
    simo3 = simo2 - simo2//3*3
    simo4 = simo3 - simo3//2*2
    if simo//5+simo1//4+simo2//3+simo3//2+simo4 <= maxkosuu :
        print(1)
    else:
        print(0)

S = input()
judge(S)
S = input().split()

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

S = input()

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")
import sys
from heapq

v,e,r=map(int, input().split());

e_1=[0]*e;
e_2=[0]*e;
e_w=[0]*e;

for i in range(e):
    e_1[i], e_2[i], e_w[i] = map(int, input().split());

v_q=[];

INF = 9999999999999999999
d = [INF for i in range(v)]
d[r] = 0
heapq.heappush(v_q,(0,r))
while(len(v_q) != 0):
    cost,u = heapq.heappop(v_q)
    if(cost > d[u]):
        continue
    for j in range(e):
        if(u == e_1[j]):
            alt = cost+e_w[j]
            if(d[e_2[j]] > alt):
                d[e_2[j]] = alt
                heapq.heappush(v_q,(alt,e_2[j]))

for i in range(v):
    if(d[i] != INF):
        print(d[i])
    else:
        print("INF")


### FIXED CODE ###

import sys
from collections import deque

v,e,r=map(int, input().split());

edge_info=[0]*v;
for i in range(v):
    edge_info[i] = []

for i in range(e):
    e1, e2, w = map(int, input().split());
    edge_info[e1].append((e2,w))

v_q=deque();

INF = 9999999999999999999
d = [INF for i in range(v)]
d[r] = 0
v_q.append((0,r))
while(len(v_q) != 0):
    cost,u = v_q.popleft()
    if(cost > d[u]):
        continue
    for j in range(len(edge_info[u])):
        e2,w = edge_info[u][j]
        alt = cost+w
        if(d[e2] > alt):
            d[e2] = alt
            v_q.append((alt,e2))

for i in range(v):
    if(d[i] != INF):
        print(d[i])
    else:
        print("INF")
st=input().split()
H=int(st[0]);W=int(st[1])
c=[[0 for i in range(10)] for i in range(10)]
A=[[0 for i in range(W)]for i in range(H)]
for i in range(10):
    st=input().split()
    for j in range(10):
        c[i][j]=int(st[j])
for i in range(H):
    st=input().split()
    for j in range(W):
        A[i][j]=int(st[j])
import math
def Dijkstra(s):
    d=[math.inf]*10
    d[s]=0
    Q=list(range(10))
    V=list(range(10))
    while(len(Q)>0):
        u=Q[0]
        for i in Q:
            if d[i]<d[u]:
                u=i
        Q.remove(u)
        Vtmp=list(range(10))
        Vtmp.remove(u)
        for v in Vtmp:
            if (d[v]>d[u]+c[u][v]):
                d[v]=d[u]+c[u][v]
    return d[1]
result=0
DD=[0]*10
for i in range(10):
    DD[i]=Dijkstra(i)
for i in range(H):
    for j in range(W):
        if A[i][j]!=-1:
            result+=DD[A[i][j]]
print(result)


### FIXED CODE ###

N=input()
if N[0]==N[1] and N[1]==N[2]:
  print("Yes")
elif N[1]==N[2] and N[2]==N[3]:
  print("Yes")
else:
  print("No")
def resolve():
    def is_prime(n):
        if n == 1:
            return False

        for k in range(2, int(math.sqrt(n)) + 1):
            if n % k == 0:
                return False

        return True
    X = int(input())

    while True:
        if is_prime(X):
            print(X)
            return
        else:
            X += 1

    return

resolve()

### FIXED CODE ###

import math
def resolve():
    def is_prime(n):
        if n == 1:
            return False
 
        for k in range(2, int(math.sqrt(n)) + 1):
            if n % k == 0:
                return False
 
        return True
    X = int(input())
 
    while True:
        if is_prime(X):
            print(X)
            return
        else:
            X += 1
 
    return
 
resolve()
A = 25 - int(input()) # 0,1,2,3
X = [0] * 10 ** (A+8)

### FIXED CODE ###

D = int(input())
if D == 25:
    print("Christmas")
elif D == 24:
    print("Christmas Eve")
elif D == 23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
import collections
import sys
n,k = map(int,input().split())
ls = list(map(int,input().split()))
a = list(set(ls))
c = collections.Counter(ls)
p = 0
if len(a) > k:
    di = [0]*(len(a))
    new = c.most_common()[::-1]
    for i in range(len(a)):
        di[i] = new[i][1]
    import numpy 
    new_ls = numpy.cumsum(numpy.array(di))
    for j in range(len(a)):
        if len(a) - k <=new_ls[j]:
            print(new_ls[j])
            sys.exit()
else:
    print(0)

### FIXED CODE ###

import sys
n,k = map(int,input().split())
ls = list(map(int,input().split()))
p = len(list(set(ls)))
if p <= k:
    print(0)
    sys.exit()
di=[float("inf")]*n
for i in range(n):
    if di[ls[i]-1] == float("inf"):
        di[ls[i]-1] = 1
    else:
        di[ls[i]-1] += 1
di.sort(reverse=True)
q = 0 
while True:
    s = di.pop()
    p -= 1
    q += s
    if p <= k:
        print(q)
        sys.exit()
class UnionFind():
    n=1
    rnk=[0]
    par=[0]
    sze=[1]
    def __init__(self,N):
        self.n=N
        self.rnk=[0 for i in range(self.n)]
        self.par=[i for i in range(self.n)]
        self.sze=[1 for i in range(self.n)]
    def find(self,x):
        if x==self.par[x]:
            return x
        else:
            self.par[x]=self.find(self.par[x])
            return self.par[x]
    def unite(self,x,y):
        x=self.find(x)
        y=self.find(y)
        self.par[x]=y
        self.rnk[x]=1
        self.sze[y]+=self.sze[x]
        self.sze[x]=0
    def same(self,x,y):
        return self.find(x)==self.find(y)
    def size(self,x):
        return self.sze[self.find(x)]
N,M=map(int,input().split())
G=UnionFind(N)
A=[0 for i in range(M)]
B=[0 for i in range(M)]
ans=[0 for i in range(M+1)]
for i in range(M):
    A[i],B[i]=map(int,input().split())
    A[i]-=1;B[i]-=1
ans[M]=(N*(N-1))//2
for i in range(M-1,-1,-1):
    if G.same(A[i],B[i]):
        ans[i]=ans[i+1]
    else:
        ans[i]=ans[i+1]-G.size(A[i])*G.size(B[i])
    G.unite(A[i],B[i])
for i in range(1,M+1):
    print(ans[i])

### FIXED CODE ###

class UnionFind():
    n=1
    par=[0]
    rnk=[0]
    def __init__(self,size):
        self.n=size
        self.par=[i for i in range(self.n)]
        self.rnk=[0 for i in range(self.n)]
    def find(self,vertex1):
        if self.par[vertex1]==vertex1:
            return vertex1
        else:
            self.par[vertex1]=self.find(self.par[vertex1])
            return self.par[vertex1]
    def unite(self,vertex1,vertex2):
        vertex1=self.find(vertex1)
        vertex2=self.find(vertex2)
        if vertex1==vertex2:
            return
        if (self.rnk[vertex1]<self.rnk[vertex2]):
            self.par[vertex1]=vertex2
        else:
            self.par[vertex2]=vertex1
            if(self.rnk[vertex1]==self.rnk[vertex2]):
                self.rnk[vertex1]+=1
    def same(self,vetrex1,vertex2):
        return self.find(vetrex1)==self.find(vertex2)

N,M=map(int,input().split())
A=[0 for i in range(M)]
B=[0 for i in range(M)]
for i in range(M):
    A[i],B[i]=map(int,input().split())
    A[i]-=1;B[i]-=1
G=UnionFind(N)
D=dict()
for i in range(N):
    D[i]=1
ans=[(N*(N-1))//2]
for i in range(M)[::-1]:
    #print([G.find(i) for i in range(N)],A[i],B[i],D,ans[-1])
    a=G.find(A[i])
    b=G.find(B[i])
    G.unite(A[i],B[i])
    x=G.find(A[i])
    if a!=b:
        ans.append(ans[-1]-D[a]*D[b])
        if x==a:
            D[a],D[b]=D[a]+D[b],0
        else:
            D[a],D[b]=0,D[a]+D[b]
    else:
        ans.append(ans[-1])
for line in ans[:-1][::-1]:
    print(line)
X=int(input())
A=math.floor(X/500)
B=math.floor((X-A*500)/5)
print(A*1000+B*5)

### FIXED CODE ###

X=int(input())
A=int(X/500)
B=int((X-A*500)/5)
print(A*1000+B*5)
N,X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
i = 1
while D <= X and i <= N+1:
    #print("D, X", D, X)
    D += L[i-1]
    i += 1

print(i-1)

### FIXED CODE ###

N,X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
i = 1
while i - 1 < N:
    #print("D, X", D, X)
    D += L[i-1]
    if X < D:
        break
    i += 1

print(i)
n,k = map(int, input().split())
ans = 2*k+1
if ans > n:print(“NO”)
else:print(“YES”)


### FIXED CODE ###

n,k = map(int, input().split())
ans = 2*k-1
if n < ans:
  print('NO')
else:
  print('YES')
N = input()
num = input().split()

count = 0
end=False
while(True):
	div = []
	for i in num:
		if(i % 2 == 0):
			div.append(i/2)
		else:
			print(count)
			end = True
    if(end == True):
      break
	num = div
	count = count + 1



### FIXED CODE ###

n = input()
num = [int(i) for i in input().split()]
count = 0
end=False
while(True):
	div = []
	for i in num:
		if(i % 2 == 0):
			div.append(i/2)
		else:
			print(count)
			end = True
			break
	if(end == True):
		break
	num = div
	count = count + 1
N=int(input())
XL=[list(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x:x[0]-x[1])
i=0
normv=0
rmv=0
while True:
  if XL[i][0]+XL[i][1]<=XL[i+1][0]-XL[i+1][1]:
    i+=1
    normv+=1
  else:
    if XL[i]>XL[i+1]:
      XL.pop(i)
      rmv+=1
    elif XL[i][0]+XL[i][1] < XL[i+1][0]+XL[i+1][1]:
      XL.pop(i+1)
      i+=1
      normv+=1
      rmv+=1
    else:
      XL.pop(i)
      rmv+=1
  if rmv+normv==N-1:
    break
if len(XL)<2:
  pass
elif XL[-1][0]-XL[-1][0]<XL[-2][0]-XL[-2][0]:
  rmv+=1
else:
  normv+=1
print(len(XL))

### FIXED CODE ###

N=int(input())
XL=[list(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x:x[0]+x[1])
ans=1
left=XL[0][0]+XL[0][1]
for i in range(1,N):
  if XL[i][0]-XL[i][1] >= left:
    ans+=1
    left=XL[i][0]+XL[i][1]
  else:
    pass
print(ans)
(a, b, c) = [int(i) for i in input().split()]

count = 0

for i in range(a, b + 1)
    if c % i == 0
        count += 1

print(count)

### FIXED CODE ###

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

count = 0

for i in range(a, b + 1) :
    if c % i == 0 :
        count += 1

print(count)
def main():
    n, m = map(int, input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]

    for row in range(n - m):
        current_index = 0
        for index in range(n - m):
            current_index = a[row].find(b[row], index)
            if current_index < 0:
                break

            for i in range(row + 1, n - m):
                if a[i].find(b[i]) != current_index:
                    break
            else:
                print('Yes')
                return

    print('No')


if __name__ == "__main__":

    main()


### FIXED CODE ###

def main():
    n, m = map(int, input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]

    for row in range(n - m + 1):
        current_index = 0
        for index in range(n - m + 1):
            current_index = a[row].find(b[0], index)
            if current_index < 0:
                break

            for i in range(m):
                if a[row + i].find(b[i], current_index) != current_index:
                    break
            else:
                print('Yes')
                return

    print('No')


if __name__ == "__main__":

    main()
N = int(input())
def f(N):
  if N % 5 == 0 and N % 3 == 0:
    return f(N-1)
  elif N % 5 == 0:
    return f(N-1)
  elif N % 3 == 0:
    return f(N-1)
  elif N == 1:
    return 1
  else:
    return f(N-1)+N
print(f(N))

### FIXED CODE ###

N = int(input())
count = 0
for i in range(N+1):
  if i % 3 != 0 and i % 5 != 0:
    count += i
print(count)
import sys
sys.setrecursionlimit(10000000)

N = int(input())
D = []
dp = []
for _ in range(N):
    a,b,c = map(int, input().split())
    D.append([a,b,c])
    dp.append([-1]*3)

def dfs(n, activity):#n日目にactivityを選んだ場合の最大幸福
    if dp[n][activity]!=-1:
        return dp[n][activity]
    if n==1:
        ans = 0
        for i in range(3):
            if i!=activity:
                ans = max(ans, D[1][activity]+D[0][i])
            dp[n][activity] = ans
        return ans
    ans = 0
    for i in range(3):
        if i!=activity:
            ans =max(ans, D[n][activity]+dfs(n-1, i))
    dp[n][activity] = ans
    return ans
ans = 0
for i in range(3):
    ans = max(ans, dfs(N-1, i))
print(ans)




### FIXED CODE ###

N = int(input())

vacation = []

for i in range(N):
    a,b,c = map(int, input().split())

    vacation.append([a,b,c])

dp = []*N

for i in range(N):
    dp.append([0, 0, 0])

dp[0][0]=vacation[0][0]
dp[0][1]=vacation[0][1]
dp[0][2]=vacation[0][2]

for i in range(0, N-1, 1):

    for j in range(3):
        for k in range(3):
            if j==k:
                continue
            dp[i+1][j] = max(dp[i+1][j], dp[i][k]+vacation[i+1][j])

print(max(dp[N-1]))
temp = input().split()
a, b, c, d, e, k = int(temp[0]), int(temp[1]), int(temp[2]), int(temp[3]), int(temp[4]), int(temp[5])
answer = 0
if e - d > k:
  answer += 1
if d - c > k:
  answer += 1
if c - b > k:
  answer += 1
if b - a > k:
  answer += 1
if answer == 0:
  print('Yay!')
else:
  print(':(')

### FIXED CODE ###

i = [int(input()) for i in range(6)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[4] - i[2] > i[5]:
  temp += 1
if i[4] - i[1] > i[5]:
  temp += 1
if i[4] - i[0] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[3] - i[1] > i[5]:
  temp += 1
if i[3] - i[0] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1
if i[2] - i[0] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')
from math import gcd

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

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

r=[0]*(n)
for i in range(n-2,-1,-1):
    r[i] = gcd(r[i+1],a[i+1])

print(max([gcd(r[i],l[i]) for i in range(n)]))


### FIXED CODE ###

from fractions import gcd

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

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

r=[0]*(n)
for i in range(n-2,-1,-1):
    r[i] = gcd(r[i+1],a[i+1])

print(max([gcd(r[i],l[i]) for i in range(n)]))
a, b = map(int, input().split()) 
if a + b >= 10:
  print("error") 
else:
  print(sum(a + b)


### FIXED CODE ###

a, b = map(int, input().split()) 
if a + b >= 10:
  print("error") 
else:
  print(a + b)
import sys
r, D, x2000 = map(int, sys.stdin.readline().split())
x2001 = r * x2000 - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
print(x2001)
print(x2002)
print(x2003)
print(x2004)
print(x2005)
print(x2006)
print(x2007)
print(x2008)
print(x2009)
print(x20010)

### FIXED CODE ###

import sys
r, D, x2000 = map(int, sys.stdin.readline().split())
x2001 = r * x2000 - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
print(x2001)
print(x2002)
print(x2003)
print(x2004)
print(x2005)
print(x2006)
print(x2007)
print(x2008)
print(x2009)
print(x2010)
n = int(input())
a = map(int,input().split())
b = map(int,input().split())

rest = 0
c = 0
for i in range(n):
    c += min(rest,a[i])
    c += min(max(0,a[i] - rest),b[i])
    rest = max(0, b[i] - a[i])
    
c += min(rest,a[i])
print(c)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
cnt = 0
for i in range(n):
  c = min(a[i] + a[i+1],b[i])
  if b[i] > a[i]:
    a[i+1] = a[i] + a[i+1] - c
  cnt += c
print(cnt)
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)
print(sum(A) + sum(C) - max(C))


### FIXED CODE ###

A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)

if (len(C)):
  C.remove(max(C))
print(sum(A) + sum(C))