Harryxun/stf_run huggingface dataset:
r=int(inout())
print(3*r*r)

### FIXED CODE ###

r = int(input())

print(3*r*r)
"""a=int(input())
b=int(input())"""
a,b = int(input()),int(input())

if 6<=a<=12 :
    ans = b/2

elif 6 > a :
    ans = 0

else :
    ans = b

print(ans)


### FIXED CODE ###

a,b=(int(i) for i in input().split())
#外側はタプルを表してるんだね。
#a,b = int(input()),int(input())

if 6<=a<=12 :
    ans = b/2

elif 6 > a :
    ans = 0

else :
    ans = b

print(int(ans))
from collection import Counter
N = int(input())
c = Counter(''.join(sorted(input())) for _ in range(N))
sum_ = lambda n: int(n*(n-1)/2)
print(sum(map(sum_,c.values())))

### FIXED CODE ###

from collections import Counter
N = int(input())
c = Counter(''.join(sorted(input())) for _ in range(N))
sum_ = lambda n: int(n*(n-1)/2)
print(sum(map(sum_,c.values())))
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M <= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

print(sum(anslis[0:N-1]))


### FIXED CODE ###

T, X = map(int, input().split())
print(T / X)
a,b,c,k = list(map(input(),split()))
if a+b >= k:
  print(min(a,k))
else:
  print(a-(k-a-b))

### FIXED CODE ###

a,b,c,k = list(map(int,input().split()))
if a+b >= k:
  print(min(a,k))
else:
  print(a-(k-a-b))
N=int(input())
a=[int(i) for i in input().split()]
X=0
Y=0
min=10**11
for i in range(N):
  X=X+a[i]

for j in range(N-1):
  Y=Y+a[j]
  if abs(X-2*Y) <= min:
   min=abs(X-2*Y)
print(min)


### FIXED CODE ###

m,d = [ int(i) for i in input().split()]

if m%3==0 or d%3==0 or (m+d)%3==0 :
    print("Possible")
else:
    print("Impossible")
import sys
#input = sys.stdin.readline
sys.setrecursionlimit(10**9)
n,m=map(int,input().split())

a=[int(input()) for i in range(m)]

def fib(n):
    if n==1:
        return 1
    if n==2:
        return 2
    return fib(n-1)+fib(n-2)

ans=1
check=0
for i in a:
    if i-check==1 and i!=1:
        print(0)
        exit()
    if i-check==1 and i==1:
        check=2
    else:
      ans*= fib(i-check-1)
      check=i+1
ans*=fib(n-a[-1]-1)
print(ans%((10**9)+7))


### FIXED CODE ###

n,m=map(int,input().split())
mod=10**9+7

    
dp=[0]*(n+1)
dp[0]=1

a=set(int(input()) for i in range(m))

for i in range(1,n+1):
    if i in a:
        continue
    x=dp[i-1]
    if i>1:
        x+=dp[i-2]
    dp[i]=x%mod
print(dp[-1])
from collections import deque
import sys

dq = deque()
num = int(input())
line = sys.stdin.readlines()

for i in range(num):

    order = line[i].split()
    
    if order[0] == 'insert':
        dq.appendleft(com[1])
    elif order[0] == 'deleteFirst':
        dq.popleft()
    elif order[0] == 'deleteLast':
        dq.pop()
    else:
        if order[1] in dq:
            dq.remove(com[1])

print(' '.join(dq))

### FIXED CODE ###

from collections import deque
import sys

dq = deque()
num = int(sys.stdin.readline())
line = sys.stdin.readlines()

for i in range(num):

    order = line[i].split()

    if order[0] == 'insert':
        dq.appendleft(order[1])
    elif order[0] == 'deleteFirst':
        dq.popleft()
    elif order[0] == 'deleteLast':
        dq.pop()
    else:
        if order[1] in dq:
            dq.remove(order[1])

print(' '.join(dq))
nnk = list(map(lambda x: int(x), input().split(" ")))
n = nnk[0]
k = nnk[1]

hs = [int(input()) for l in range(n)]
hs.sort()

hmmm = []
for l in range(n-k+1):
    hmmm.append(hs[k+l-1] - hs[l])

hmmm.sort()
print(hmmm[0])

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-


d = input()

if d == "22":
    print("Christmas Eve Eve Eve")
elif d == "23":
    print("Christmas Eve Eve")
elif d == "24":
    print("Christmas Eve")
elif d == "25":
    print("Christmas")
w, h, x, y = map(int, input().split())

min_wh = w*h/2
a = 0

if x == 0 or y == 0:
    print(min_wh, 0)

if w%x==0 and h%y==0:
    a = 1
print(min_wh, a)

### FIXED CODE ###

w, h, x, y = map(int, input().split())


if x in [0, w] or y in [0, h]:
    print(w * h/2, 0)
else:
    if x * 2 == w and y * 2 == h:
        print(w * h / 2, 1)
    else:
        print(w * h/2, 0)
R = int(input())

if R < 1200:
    print("ABC")
elif 1200 < R < 2800:
    print("ARC")
elif 2800 < R
    print("AGC")

### FIXED CODE ###

R = int(input())

if R < 1200:
    print("ABC")
elif  R < 2800:
    print("ARC")
else:
    print("AGC")
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 =map(int, input().split())
if a > b:
 print("a > b")
elif  a == b:
 print("a == b")
else : 
 print("a < b")
n = int(input())
A, B = [], []
for _ in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
result = 0
for a, b in zip(A[::-1], B[::-1]):
    piyo = (a+result) % b
    if piyo == 0:
        continue
    result += b - piyo
print(result

### FIXED CODE ###

n = int(input())
A, B = [], []
for _ in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
result = 0
for a, b in zip(A[::-1], B[::-1]):
    piyo = (a+result) % b
    if piyo == 0:
        continue
    result += b - piyo
print(result)
import math

a,b,c,d=map(int,input().split())
x=int((a+d-1)/d)
y=int((c+b-1)/c)
 
if x>=y:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

s,w=map(int,input().split())
if s <= w:
    print("unsafe")
else:
    print("safe")
n = input()
print(n.reverse() if len(n) == 3 else n)

### FIXED CODE ###

n = input()
print(n[::-1] if len(n) == 3 else n)
N = int(input())
a = []
 
for x in range(1, N):
    y = N-x
    if x == y:
        continue
    a.append([x, y])
 
print(len(a))
N = int(input())
a = []

for x in range(1, N):
    y = N-x
    if x == y:
        continue
    if x > y:
        break
    a.append([x, y])

print(len(a))
提出情報

### FIXED CODE ###

N = int(input())
a = []
 
for x in range(1, N):
    y = N-x
    if x == y:
        continue
    if x > y:
        break
    a.append([x, y])
 
print(len(a))
N=int(input())
ls_A=list(map(int,input().split()))

#重複したやつ除く
ls_A.sort()
ls=[]
for i in range(N):
  if i==0:
    if ls_A[0]!=ls_A[1]:
      ls.append(ls_A[0])
  elif i==N-1:
    if ls_A[N-1]!=ls_A[N-2]:
      ls.append(ls_A[N-1]) 
  else:
    if ls_A[i]!=ls_A[i-1] and ls_A[i]!=ls_A[i+1]:
      ls.append(ls_A[i])       

#定数倍のやつに＋１する
if not ls:
  print(0)
else:
  A=[0]*(max(ls)+1)
  for i in range(len(ls)):
    a=1
    while ls[i]*a<=max(ls):
      A[ls[i]*a]+=1
      a+=1
  ans=0    
  for i in range(len(ls)):
    if A[ls[i]]==1:
      ans+=1
  print(ans)

### FIXED CODE ###

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

#定数倍のやつに＋１する
M=max(ls)
A=[0]*(M+1)
for i in range(N):
  a=M//ls[i]
  for j in range(1,a+1):
    if A[j*ls[i]]<=2:
      A[j*ls[i]]+=1
    
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)
N,Wmax=map(int,input().split(' '))
W=[]
V=[]
for _ in range(N):
	w,v = map(int,input().split(' '))
	W.append(w)
	V.append(v)

#dp[i][j]=i番目の品物までだけを選び重量制限をjとしたときの価値の最大値
dp_last = [0]*(Wmax+1)
for i in range(Wmax+1):
	if i >= W[0]:
		dp_last[i] = V[0]

for i in range(1,N):
	#今回の重量制限をwとする
	#今回は荷物を積む場合: dp[i][w] = dp[i-1][w-w[i]]+v[i] 
	#今回は荷物を積まない場合: dp[i][w] = dp[i-1][w]
	#よってこの2つのうち大きいほうをdp[i][w]に採用する
	dp = []
	for j in range(Wmax+1):
		if j<W[i]:
			dp.append(dp_last[j])
		else:
			dp.append(max(dp_last[j], dp_last[j-W[i]]+V[i]))
	dp_last = dp
print(dp[Wmax])

### FIXED CODE ###

N,Wmax=map(int,input().split(' '))
W=[]
V=[]
for _ in range(N):
	w,v = map(int,input().split(' '))
	W.append(w)
	V.append(v)

Vmax=sum(V)

# dp[i][v]=i番目の品物までだけを選び価値の合計をvとしたときの必要な重量の最小値
# ただしそのような価値の合計が実現不可能なときはNoneを格納

dp = []
for _ in range(N):
	dp.append([None]*(Vmax+1))

dp[0][0] = 0
dp[0][V[0]] = W[0]

for i in range(1,N):
	# 新しく積めるようになる荷物の価値をV[i]とする
	# このとき価値の合計をvにするのに必要な重量の最小値は
	#	  dp[i-1][v-V[i]]+W[i] と
	#   dp[i-1][v] のうち小さいほう
	for v in range(Vmax+1):
		if v-V[i]<0:
			dp[i][v] = dp[i-1][v]
		else:
			if dp[i-1][v] is not None:
				if dp[i-1][v-V[i]] is not None:
					dp[i][v] = min(dp[i-1][v],dp[i-1][v-V[i]]+W[i])
				else:
					dp[i][v] = dp[i-1][v]
			else:
				if dp[i-1][v-V[i]] is not None:
					dp[i][v] = dp[i-1][v-V[i]]+W[i]

ans = 0
for v in range(Vmax+1):
	try:
		ans = v if dp[-1][v]<=Wmax else ans
	except TypeError:
		pass

print(ans)
if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    count,i_a,i_b = 0,0,0
    # ADD A item
    for i_a in range(len(A)):
        if K < A[i_a]:
            i_a -= 1
            break
        else:
            K -= A[i_a]
    # replace B item
    for i_b in range(len(B)):
        if K < B[i_b] :
            i_b -= 1
            break
        else :
            K -= B[i_b]
    
    count = (i_a+1) + (i_b+1) # 読んだ本のindexの次のindexが格納されている。
    # 1冊も読めない⇒0
    # idx = i_a,i_bまで読んだ。
    # forの繰り返しをすべて終えた時 +1されるのか?

    for i in range(i_a,-1,-1): # A のアイテムを1つずつ減らしていく。
        K += A[i]
        for j in range(i_b,len(B)):
            if K < B[i_b]:
                i_b -= 1
            else :
                K -= B[i_b]
        count = max(count,((i)+(i_b+1)))
    print(count)

### FIXED CODE ###

def get_sum_arr(arr):
    sum_arr = [0]
    N = len(arr)
    for i in range(1,N+1):
        sum_arr.append(sum_arr[i-1] + arr[i-1])
    return sum_arr

def get_max_b(left_time,j,B_sum_arr):
    # [0,1,2,3,4,5]
    while B_sum_arr[j] > left_time and j > 0:
        j -= 1
    return j
def get_max_book_num(A,B,K):
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    count,i,j = 0,0,len(B_sum_arr)-1
    for i in range(0,len(A_sum_arr)):
        if K < A_sum_arr[i]:
            break
        else:
            left_time = K - A_sum_arr[i]
            j = get_max_b(left_time,j,B_sum_arr)
        count = max(count,(i+j))
    return count
if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    print(get_max_book_num(A,B,K))
if A == 0 & B == 0:
    print('NA')
elif 1 <= A <= 12:
    if 1 <= B <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 1 <= B <= 12:
    if 1 <= A <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

### FIXED CODE ###

S = input()

S_one = int(S[:2])
S_two = int(S[2:])

if S_one == 0:
    if 1 <= S_two <= 12:
        print('YYMM')
    else:
        print('NA')
elif 1 <= S_one <= 12:
    if 1 <= S_two <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= S_two <= 12:
        print('YYMM')
    else:
        print('NA')
import math

def lcm(a, b):
    return a * b // math.gcd (a, b)

n, m = map(int, input().split())
s = list(input())
t = list(input())

s1 = ['*'] * lcm(n, m)
l = len(s1)

for i in range(n):
    s1[(l//n) * i] = s[i]

for j in range(m):
    if s1[(l//m) * j] != '*' and s1[(l//m) * j] != t[j]:
        print(-1)
        break
    if j == m - 1:
        print(l)

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)

n, m = map(int, input().split())
s = list(input())
t = list(input())

for i in range(gcd(n, m)):
    if s[i * (n // gcd(n, m))] != t[i * (m // gcd(n, m))]:
        print(-1)
        break
    if i == gcd(n, m) - 1:
        print(lcm(n, m))
l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
C = (N/(4*M))
F = m.split(' ')
X = []
for item in F:
  votes = int(item)
  X.append(votes)

X.sort(reverse=True)
for i in range(M+1):
  if X[i]<C:
    print("No")
    break
  else:
    if i==M:
      print("Yes")

### FIXED CODE ###

l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)

S = sum(X)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")
# coding: utf-8
# Your code here!

words= list(input())
target = list(input())
i=len(words)-len(target)
for i in reversed(range(len(words)-len(target)+1)):
    # print(words[i])
    flag = True
    for j in range(len(target)):
        if not(words[i+j] == target[j] or words[i+j] == '?'):
            flag = False
            break
    if flag is True:
        words[i:i+len(target)] = target
        for k,word in enumerate(words):
            if word == '?':
                words[k]='a'
        break

if flag is True:
    print(''.join(words))
else:
    print("UNRESTORABLE")


### FIXED CODE ###

# coding: utf-8
# Your code here!

words= list(input())
target = list(input())
i=len(words)-len(target)
flag=False
while(0<=i):
    flag = True
    for j in range(len(target)):
        if not(words[i+j] == target[j] or words[i+j] == '?'):
            flag = False
            break
    if flag is True:
        words[i:i+len(target)] = target
        for k,word in enumerate(words):
            if word == '?':
                words[k]='a'
        break
    i-=1

if flag is True:
    print(''.join(words))
else:
    print("UNRESTORABLE")
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]

cnt = 0
for i in range(a,b+1):
    if (int(i/c)-i/c != 0) and (int(i/d)-i/d != 0):
        cnt += 1

print(cnt)

### FIXED CODE ###

s = str(input())
s = list(s)
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print("Bad")
else:
    print("Good")
import collections
I = [int(_) for _ in open(0).read().split()]
N = I[0]
AB = I[1:]
G = collections.defaultdict(set)
for a, b in zip(AB[::2], AB[1::2]):
    G[a].add(b)
    G[b].add(a)
color = [None] * (N + 1)


def dfs(G, v, cur):
    color[v] = cur
    for w in G[v]:
        if color[w] is None:
            dfs(G, w, 1 - cur)


dfs(G, 1, 0)
c=collections.Counter(color[1:])
cand1 = set(range(1, N + 1, 3))
cand2 = set(range(2, N + 1, 3))
cand3 = set(range(3, N + 1, 3))

i0, i1 = 0, 1
if c[0] > c[1]:
    i0, i1 = 1, 0

ans = [None] * (N + 1)
if c[i0] <= len(cand3):
    for i in range(1, N + 1):
        if color[i]==i0:
            ans[i] = cand3.pop()
        else:
            if cand1:
                ans[i] = cand1.pop()
            elif cand2:
                ans[i] = cand2.pop()
            else:
                ans[i] = cand3.pop()
else:
    for i in range(1, N + 1):
        if color[i] == i0:
            if cand1:
                ans[i] = cand2.pop()
            else:
                ans[i] = cand3.pop()
        else:
            if cand2:
                ans[i] = cand1.pop()
            else:
                ans[i] = cand3.pop()
print(*ans[1:])


### FIXED CODE ###

import collections
import sys
sys.setrecursionlimit(2*10**5)
I = [int(_) for _ in open(0).read().split()]
N = I[0]
AB = I[1:]
G = collections.defaultdict(set)
for a, b in zip(AB[::2], AB[1::2]):
    G[a].add(b)
    G[b].add(a)
color = [None] * (N + 1)


def dfs(G, v, cur):
    color[v] = cur
    for w in G[v]:
        if color[w] is None:
            dfs(G, w, 1 - cur)


dfs(G, 1, 0)
c=collections.Counter(color[1:])
cand1 = set(range(1, N + 1, 3))
cand2 = set(range(2, N + 1, 3))
cand3 = set(range(3, N + 1, 3))

i0, i1 = 0, 1
if c[0] > c[1]:
    i0, i1 = 1, 0

ans = [None] * (N + 1)
if c[i0] <= len(cand3):
    for i in range(1, N + 1):
        if color[i]==i0:
            ans[i] = cand3.pop()
        else:
            if cand1:
                ans[i] = cand1.pop()
            elif cand2:
                ans[i] = cand2.pop()
            elif cand3:
                ans[i] = cand3.pop()
else:
    for i in range(1, N + 1):
        if color[i] == i0:
            if cand2:
                ans[i] = cand2.pop()
            elif cand3:
                ans[i] = cand3.pop()
        else:
            if cand1:
                ans[i] = cand1.pop()
            elif cand3:
                ans[i] = cand3.pop()
print(*ans[1:])
import math


def distance(p1, p2):
    """returns the distance between p1 and p2

    >>> d = distance((0, 0), (1, 1))
    >>> print("{:.5f}".format(d))
    1.41421
    """
    (x1, y1) = p1
    (x2, y2) = p2
    return math.sqrt((x2-x1)**2 + (y2-y1)**2)


def run():
    x1, y1, x2, y2 = [int(i) for i in input().split()]

    print("{:.5f}".format(distance((x1, y1), (x2, y2))))


if __name__ == '__main__':
    run()


### FIXED CODE ###

import math


def distance(p1, p2):
    """returns the distance between p1 and p2

    >>> d = distance((0, 0), (1, 1))
    >>> print("{0:.5f}".format(d))
    1.41421
    """
    (x1, y1) = p1
    (x2, y2) = p2
    return math.sqrt((x2-x1)**2 + (y2-y1)**2)


def run():
    x1, y1, x2, y2 = [float(i) for i in input().split()]

    print(distance((x1, y1), (x2, y2)))


if __name__ == '__main__':
    run()
import sys
#import copy
#import numpy as np
#import itertools
import collections
#from collections import deque
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read
count = collections.Counter

def main():
    N = int(readline())
    S = input()

    values = list(count(S).values())
    ans = values[0] * values[1] * values[2]

    for i in range(N-2):
        for j in range(i+1, N-1):
            k = 2 * j - i
            if k >= N:
                break
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                ans -= 1

    print(ans)
    #print('end')


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
#import copy
#import numpy as np
#import itertools
import collections
#from collections import deque
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read
count = collections.Counter

def main():
    N = int(readline())
    S = input()

    values = list(count(S).values())
    if len(values) < 3:
        print(0)
        return
    
    ans = values[0] * values[1] * values[2]

    for i in range(N-2):
        for j in range(i+1, N-1):
            k = 2 * j - i
            if k >= N:
                break
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                ans -= 1

    print(ans)
    #print('end')


if __name__ == "__main__":
    main()
s = input()
ans = 0

for i in range(len(s)):
  for j in range(len(s)):
    a = s[i:i+j]
    if int(a) % 2019 == 0:
      ans += 1

print(ans)


### FIXED CODE ###

s,l = (input(),2019)
m,a,r = ([1]+[0]*l,0,0)
for i,e in enumerate(s[::-1]):
    a += int(e)*pow(10,i,l)
    r += m[a%l]
    m[a%l] += 1
print(r)
N, M = (list)(map(int, input().split()))
edge = []

for _ in range(N):
    edge.append((list)(map(int, input().split())))


inf = 10**15

d = [inf]*(N+2)
d[1] = 0
ans = inf
for i in range(N+1):
    update = False
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            update = True

    if not update:
        break
    elif i == N:
        ans = 'inf'

if not ans == 'inf':
    ans = d[N]
    print(-ans)
else:
    print(ans)


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()


N, M = (list)(map(int, input().split()))
edge = []

for _ in range(M):
    edge.append((list)(map(int, input().split())))


inf = 10**15

d = [inf]*(N+1)
d[1] = 0
ans = inf
for i in range(N):
    update = False
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            update = True

    if not update:
        break

neg = [False]*(N+1)
for i in range(N):
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            neg[b] = True
        if neg[a]:
            neg[b] = True

if neg[-1]:
    print('inf')
else:
    print(-d[-1])
n,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
a=[]
for i in range(n-1):
        a.append(x[i+1]-x[i])        

def gcd(m,n):
        while n:
                m,n = n,m%n
        return m

ans=min(a)
for j in a:
        if j%ans != 0:
                ans = gcd(j,ans)
print(ans)

### FIXED CODE ###

n,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
a=[]
for i in range(len(x)-1):
        a.append(x[i+1]-x[i])        

def gcd(m,n):
        while n:
                m,n = n,m%n
        return m

ans=a[0]
for j in a:
        if j%ans != 0:
                ans = gcd(j,ans)
print(ans)
foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

print(time - 10 + min([i for i in rest if i != 0]))

### FIXED CODE ###

foods = [int(input()) for i in range(5)]
time = 0
rest = list(map(lambda x: x % 10, foods))
for i in range(5):
    if rest[i] == 0:
        time += foods[i]
    else:
        time += foods[i] - rest[i] + 10

if any(rest):
    print(time - 10 + min([i for i in rest if i != 0]))
else:
    print(time)
import sys
sys.setrecursionlimit(2000000)
t=input()
tl=list(t)
tln=len(t)
x=t.find("?")
while x != -1:
    if x == tln:
        tl[x]="D"
        break
    if tl[x+1]=="D":
        tl[x]="P"
    elif tl[x+1]=="?":
        tl[x]="P"
    else:
        tl[x]="D"
    t="".join(tl)
    x=t.find("?")
print(t)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
t=input()
tl=list(t)
tln=len(t)
x=0
for x in range(tln):
    if tl[x] == "?":
        if x == tln-1:
            tl[x]="D"
            break
        elif x==0:
            if tl[x+1]=="?":
                tl[x]="P"
                tl[x+1]="D"
            else:
                tl[x]="D"
        elif tl[x-1]=="P":
            tl[x]="D"
        elif tl[x+1]=="?":
            tl[x]="P"
            tl[x+1]="D"
        elif tl[x+1]=="D":
            tl[x]="P"
        else:
            tl[x]="D"
t="".join(tl)
print(t)
A, B = map(int, input())
if B % A == 0:
  print(A + B)
else:
  print(A - B)

### FIXED CODE ###

A, B = map(int, input().split(" "))
if B % A == 0:
  print(A + B)
else:
  print(B - A)
A=list(input())
B=list(input())
C=list(input())
t='a'
d=1
while d==1:
    if t=='a':
        t=A.pop(0)
    if t=='b':
        t=B.pop(0)
    if t=='c':
        t=C.pop(0)
    if t=='a' and A==[]:
        print('A')
        break
    elif t=='b' and B==[]:
        print('B')
        break
    elif t=='c' and C==[]:
        print('C')
        break

### FIXED CODE ###

A=list(input())
B=list(input())
C=list(input())
t='a'
d=1#ずっとまわすつもり。
while d==1:
    if t=='a':
        t=A.pop(0)
    elif t=='b':
        t=B.pop(0)
    elif t=='c':
        t=C.pop(0)
    if t=='a' and A==[]:
        print('A')
        break
    elif t=='b' and B==[]:
        print('B')
        break
    elif t=='c' and C==[]:
        print('C')
        break
h, w = map(int, input().split())
ans = "Yes"
c = [0]*(w+2)
s = c
for i in range(h):
    S = ["0"]
    S1 = list(input())
    S.append(S1)
    S.append("0")
    s.append(S)
s.append(c)

for i in range(1,h+1):
    for j in range(1, w+1):
        if s[i][j]=="#":
            if s[i-1][j]!="#" and s[i+1][j]!="#" and s[i][j-1]!="#" and s[i][j+1]!="#":
                ans ="No"
            else:
                continue
print(ans)

### FIXED CODE ###

h, w = map(int, input().split())
ans = "Yes"
c = ["0"]*(w+2)
s = []
s.append(c)
for i in range(h):
    S = ["0"]
    S1 = list(input())
    S1.append("0")
    S = S+S1
    s.append(S)
s.append(c)

for i in range(1,h+1):
    for j in range(1, w+1):
        if s[i][j]=="#":
            if s[i-1][j]!="#" and s[i+1][j]!="#" and s[i][j-1]!="#" and s[i][j+1]!="#":
                ans ="No"
            else:
                continue
print(ans)