Harryxun/stf_run huggingface dataset:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()
  field=[list(S()) for _ in range(h)]

  q=collections.deque()
  nokori=h*w
  dist=[[-1]*w for _ in range(h)]
  for i in range(h):
    for j in range(w):
      if field[i][j]=='#':
        q.append((i,j))
        dist[i][j]=0
        nokori-=1

  while q:
    if nokori==0:
      return d

    y,x=q.popleft()

    for dy,dx in dd:
      ny=y+dy
      nx=x+dx

      if 0<=ny<h and 0<=nx<w:
        if field[ny][nx]=='.':
          field[ny][nx]='#'
          d=dist[y][x]+1
          dist[ny][nx]=d
          q.append((ny,nx))
          nokori-=1

  return d

# main()
print(main())


### FIXED CODE ###

import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()
  field=[list(S()) for _ in range(h)]
  d=0

  q=collections.deque()
  nokori=h*w
  dist=[[-1]*w for _ in range(h)]
  for i in range(h):
    for j in range(w):
      if field[i][j]=='#':
        q.append((i,j))
        dist[i][j]=0
        nokori-=1

  while q:
    if nokori==0:
      return d

    y,x=q.popleft()

    for dy,dx in dd:
      ny=y+dy
      nx=x+dx

      if 0<=ny and ny<h and 0<=nx and nx<w:
        if field[ny][nx]=='.':
          field[ny][nx]='#'
          d=dist[y][x]+1
          dist[ny][nx]=d
          q.append((ny,nx))
          nokori-=1

  return d

# main()
print(main())
#!/usr/bin/env python
# -*- coding: utf-8 -*-


N,M = map(int,input().split())
G = [[] for i in range(N)]
visited = [False for i in range(N)]

for i in range(M):
    a,b = map(lambda x:int(x)-1,input().split())
    G[a].append(b)
    G[b].append(a)


s = 0
t = G[s][0]

path = [s,t]
solved = [False, False]
visited[s] = True
visited[t] = True

while(True):
    if not solved[0]:
        for n in G[s]:
            if visited[n]:
                continue
            visited[n] = True
            s = n
            path = [s] + path
            break
        else:
            if solved[1]:
               break 
            solved[0] = True

    if not solved[1]:
        for n in G[t]:
            if visited[n]:
                continue
            visited[n] = True
            t = n
            path = path + [t]
            break
        else:
            if solved[0]:
                break
            solved[1] = True
print(len(path))
print(' '.join((map(lambda x:str(x+1), path))))


### FIXED CODE ###

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

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

if N == 1:
    print(1)
    quit()

if A[0] < A[1]:
    tend = 1
elif A[0] > A[1]:
    tend = -1
else:
    tend = 0

count = 1
prev = A[1]

for a in A[2:]:
    if prev < a and tend < 0:
        tend = 0
        count += 1
    elif prev > a and tend > 0:
        tend = 0
        count += 1
    elif tend == 0:
        if prev < a:
            tend = 1
        elif prev > a:
            tend = -1
        else:
            tend = 0

    prev = a

print(count)
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
count=1
for i in range(n):
  d += n[i]
  if d<=x:
    count+=1
print(count)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
count=1
for i in range(n):
  d += l[i]
  if d<=x:
    count+=1
print(count)
x = input()
 print(int(x)^3)

### FIXED CODE ###

x = input()
ans = x**3
print ans
N = int(input())
A = list(map(lambda x: int(x),input().split()))
X = [(-1)**(i) for i in range(N)]
for i in range(N):
    c = 0
    for j in range(N):
        c += A[j]*X[(N+j-i)%N]
    print(c,end=" ")


### FIXED CODE ###

n,a,b  = list(map(lambda x: int(x),input().split()))
print(min(n*a,b))
n = int(input())
s = input()
s = list(s)

count = 0
white_count = 0
white_count2 = 0
black_count = 0
black_No = 0

for i in range(n):
    if s[i] == "#":
        black_No = i
        break

for i in range(n - black_No):
    if s[i + black_No] == ".":
        white_No = i + black_No
        break

while True:
    try:
        if s[white_No + count] == ".":
            count += 1
        else:
            break
    except:
        break

for i in range(n - black_No):
    if s[i + black_No] == ".":
        white_count += 1

if count > white_No - black_No:
    t = n - white_No - count
    for i in range(t):
        if s[i + white_No + count] == ".":
            white_count2 += 1
    for j in range(n - t):
        if s[j] == "#":
            black_count += 1
    result = black_count + white_count2
else:
    result = white_count

print(result)


### FIXED CODE ###

n = int(input())
s = input()

count_black = 0
count_white = 0
a = n + 1
cnt_white = [0] * a
cnt_black = [0] * a
result = []

for i in range(n):
    if s[i] == ".":
        count_white += 1

cnt_white[0] = count_white

for i in range(n):
    if s[i] == "#":
        count_black += 1
    else:
        count_white -= 1
    cnt_white[i+1] = count_white
    cnt_black[i+1] = count_black

for i in range(n+1):
    result.append(cnt_black[i] + cnt_white[i])

ans = min(result)

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

dic = {}

for a in A:
    if a in dic.keys():
        dic[a] += 1
    else: dic[a] = 1

flag = True
ini = N
if N % 2 == 1:
    if 0 in A:
        if dic[0] == 1:
            ini = 2
    else:
        flag = False
else:
    ini = 1
    
for i in range(ini,N,2):
    if not flag: break
    if dic[i] != 2:
        flag = False

if flag:
    print(2**(N//2)%(10**9+7))
else:
    print(0)

### FIXED CODE ###

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

# N が奇数なら、Aはすべて偶数であり、かつ0を除いてすべて1ペア、かつ0が1つあるはず
# N が偶数なら、Aはすべて奇数であり、かつすべて1ペア
# 上記を確認するための辞書
dic = {}

for a in A:
    if a in dic.keys():
        dic[a] += 1
    else: dic[a] = 1

flag = True
ini = N
if N % 2 == 1:
    if 0 in A:
        if dic[0] == 1:
            ini = 2
        else:
            flag = False
    else:
        flag = False
else:
    ini = 1

for i in range(ini,N,2):
    if not flag: break
    if i in dic:
        if dic[i] != 2:
            flag = False
    else: flag = False

if flag:
    print(2**(N//2)%(10**9+7))
else:
    print(0)
import sys

N = int(input())

L0=2
L1=1

for i in range(N-1):
	temp=L0+L1
	L0=L1
	L1=temp
print(temp)

### FIXED CODE ###

import sys

N = int(input())

L0=2
L1=1

temp=L1
for i in range(N-1):
	temp=L0+L1
	L0=L1
	L1=temp
print(temp)
N,D=[int(x) for x in input().split()]
if( N/D < N- D*2){
 print(int(N/D)) 
}else{
 print(int(N/D)+1)
}


### FIXED CODE ###

import math
def Solve():
    N,D=[int(x) for x in input().split()]
    return math.ceil(N/(D*2+1))
print(Solve())
N = int(input())
a = N[-1]
if a="0","1","6","8":
  print("pon")
  elif a="3":
    print("bon")
    else:
      print("hon")

### FIXED CODE ###

s =int( input()[-1])
if s in [2, 4, 5, 7, 9]:
  print('hon')
elif s in [0, 1, 6, 8]:
  print('pon')
else:
  print('bon')
k,n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

c = a[0] + (K - a[n-1])

for i in range(1,N):
    d = max(c, A[i] - A[i-1])

print(K - d)


### FIXED CODE ###

k,n = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
c = a[0] + (k - a[n-1])
for i in range(1,n):
  c = max(c,a[i] - a[i-1])
print(k-c)
import math
A,B=map(int,input().split())
a=math.gcd(A,B)
b=A*B//a
print(b)

### FIXED CODE ###

import fractions
A,B=map(int,input().split())
a=fractions.gcd(A,B)
b=A*B//a
print(b)
import math

def binary(n):
    l = [0] * 40#n<10^12<2^40
    for i in range(39,-1,-1):
        if n >= 2 ** i:
            l[i] = 1
            n = n - 2 ** i
        else:
            l[i] = 0
    
    return l#返り値はリストであることに注意

def xor_plus(l1,l2):#引数はリストであることに注意
    l = [0] * 40
    for i in range(0,40):
        if l1[i] == l2[i]:
            l[i] = 0
        else:
            l[i] = 1
    return l#返り値はリストであることに注意

def backto10(l):
    s = 0
    for i in range(0,len(l)):
        s = s + l[i] * (2 ** i)
    return s
        

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

b = [0] * n

for i in range(0,n):
    b[i] = binary(a[i])
    
l = int(math.log2(k))
ansx = 2 ** l

s = 0

for i in range(0,n):
    s = s + backto10(xor_plus(binary(ansx),b[i]))

print(s)

### FIXED CODE ###

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

def f(x):
    ret = 0
    for i in range(N):
        ret += A[i] ^ x
    return ret

###2**(num-1)<=K<2**numなるnumを求める
P = bin(K)
num = len(list(map(int,P[2:])))

best = 0

for i in range(num):
    count = 0###2**iの位が1になるAの個数
    for j in range(N):
        if A[j] > A[j]^(2**i):
            count += 1
    
    if count <= N - count:
        best += 2**i

#print(best)
can = [0]*40

for i in range(40):
    if K & 2**i == 0:
        continue
    for j in range(0,i):
        can[i] += best & 2**j
    for j in range(i+1,40):
        can[i] += K & 2**j

can.append(K)

print(max(list(map(f,can))))
N=int(input())
x=list(map(int,input().split()))
ans=0
MOD=10**9+7

import math


for i in range(2,N+1):#iは右端からの数
    #(x[-1]-x[-i])/i+(x[-2]-x[-i])/i......(x[-i+1]-x[-i])/i
    for j in range(i-1):
        ans+=(x[-j-1]-x[-i])/(i-1)
print(int((ans*math.factorial(N-1))%MOD))

### FIXED CODE ###

MOD = 10 ** 9 + 7
N = int(input())
x = list(map(int, input().split()))
x.sort()
 
kaijo = [1]
for i in range(1, N):
    kaijo.append(kaijo[-1] * i % MOD)
 
ans = 0
for i in range(N - 1):
    ans = (ans * (i + 1) + (x[-1] - x[i]) * kaijo[i]) % MOD
 
print(ans)
n,m = map(int,input().split())
ls = [int(input()) for _ in range(m)]

dp = [0 for _ in range(n+1)]
dp[1] = 1
dp[2] = 2

for i in range(3,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = dp[i-1]+dp[i-2]

print(dp[n]%(10**9+7))

### FIXED CODE ###

n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))
if(b=="A"):
    print("T")
if(b=="T"):
    print("A")
if(b=="G"):
    print("C")
if(b=="C"):
    print("G")

### FIXED CODE ###

b=input()

if(b=="A"):
    print("T")
if(b=="T"):
    print("A")
if(b=="G"):
    print("C")
if(b=="C"):
    print("G")
input = int(input)
if(input == 22):
  print("Christmas Eve Eve Eve")
elif(input == 23):
  print("Christmas Eve Eve")
elif(input == 24):
  print("Christmas Eve")
elif(input == 25):
  print("Christmas")


### FIXED CODE ###

input = int(input())
if(input == 22):
  print("Christmas Eve Eve Eve")
elif(input == 23):
  print("Christmas Eve Eve")
elif(input == 24):
  print("Christmas Eve")
elif(input == 25):
  print("Christmas")
H = input().split()
H = [int(i) for i in H]

if H[0] > H[1]:
    H[0] = H[0] - H[1]
    count+ = 0
else:
    count+ = 1
print(count)

### FIXED CODE ###

H = input().split()
H = [int(i) for i in H]

count = 0

while True:
    if H[0] > H[1]:
        H[0] = H[0] - H[1]
        count+=1
    else:
        count = count + 1
        break
print(count)
def luca(n):
  if n == 2:
    return 1
  elif n == 1:
    return 2
  luca(n) = luca(n-1) + luca(n-2)
  return

print(luca(int(input()))

### FIXED CODE ###

def luca(n, a=1, b=2):
  if n <= 1:
    return a
  return luca(n-1, a+b, a)

a = int(input())
print(luca(a))
N = int(input())
S = input()

C = ('SS', 'SW', 'WS', 'WW')
for i in range(4):
    ans = list(C[i])
    for j in range(1, N):
        if (ans[-1] == 'S' and S[j] == 'o') or(ans[-1] == 'W' and S[j] == 'x'):
            ans.append(ans[-2])
        else:
            ans.append('S' if ans[-2] == 'W' else 'W')
    if ans[0] == ans[-1]:
        ans.remove(-1)
        if (ans[0] == 'S' and S[0] == 'o' and ans[-1] == ans[1]) or \
            (ans[0] == 'S' and S[0] == 'x' and ans[-1] != ans[1]) or \
                (ans[0] == 'W' and S[0] == 'o' and ans[-1] != ans[1]) or \
                (ans[0] == 'W' and S[0] == 'x' and ans[-1] == ans[1]):
            print(''.join(ans))
            exit()
print(-1)


### FIXED CODE ###

N = int(input())
s = input()
s += s[0]

testcase = ((0, 0), (0, 1), (1, 0), (1, 1))  # 0: sheep, 1: wolf

for p0, n0 in testcase:
    p, n = p0, n0
    ans = []
    for i in range(1, N+1):
        ans.append(p)
        if n == 0 and s[i] == 'o':
            p, n = n, p
        elif n == 0 and s[i] == 'x':
            p, n = n, 1-p
        elif n == 1 and s[i] == 'o':
            p, n = n, 1-p
        elif n == 1 and s[i] == 'x':
            p, n = n, p
    if (p, n) == (p0, n0):
        a = ['S' if x == 0 else 'W' for x in ans]
        print(''.join(a))
        exit()
print(-1)
N = int(input())

V = list(map(int, input().split()))

C = list(map(int, input().split()))

P = 0

for i in range(0,N+1):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(Y)


### FIXED CODE ###

N = int(input())

V = list(map(int, input().split()))

C = list(map(int, input().split()))

P = 0

for i in range(N):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(P)
# -*- coding: utf-8 -*-
s = raw_input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])

### FIXED CODE ###

# -*- coding: utf-8 -*-
s = input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])
def calcH(x, cx, y, cy, h):
    return abs(x-cx)+abs(y-cy)+h
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
Hmax = 10**9
for i in range(101):
    for j in range(101):
        k = 0
        flag = True
        for x, y, h in xyh:
            H_ = calcH(x, i, y, j, h)
            if h == 0:
                flag = False
            if k > 0:
                if H_ != H and flag:
                    flag = False
                    break
                elif H_ != H:
                    H = H_
                    flag = True
                else:
                    flag = True
                    continue
            else:
                H = H_
            k += 1
        if flag == False or H > Hmax:
            continue
        else:
            Cx = i
            Cy = j
            Ch = H
            break
print(Cx, Cy, Ch)

### FIXED CODE ###

def calcCh(cx, cy, x, y, h):
    return abs(x-cx)+abs(y-cy)+h
def calcH(cx, cy, ch, x, y, h):
    return max(ch - calcCh(cx, cy, x, y, 0), 0)
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
xyh = sorted(xyh, key = lambda x: x[2])[::-1]
lst = [[x, y] for x in range(101) for y in range(101)]
for Cx, Cy in lst:
    Ch = calcCh(Cx, Cy, *xyh[0])
    if all(xyh[i][2] == calcH(Cx, Cy, Ch, *xyh[i]) for i in range(n)):
        break
print(Cx, Cy, Ch)
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
ti, ai = list(map(int, input().split()))
vp = ti + ai
tp = ti
ap = ai
for i in range(1,n):
    t, a = list(map(int, input().split()))
    if ti == t and ai == a:
        continue
    ti = t
    ai = a
    niv = vp/(ti+ai)
    nit = tp/ti
    nia = ap/ai
    ni = math.ceil(max(niv, nit, nia))
    vi = ni*(ti+ai)
    vp = vi
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
tp = 1
ap = 1
for i in range(n):
    ti, ai = list(map(int, input().split()))
    #nit = math.ceil(tp/ti)
    #nia = math.ceil(ap/ai)
    nit = -tp//ti
    nia = -ap//ai
    ni = max(-nit, -nia)
    vi = ni*(ti+ai)
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)
N = int(input())
P = sorted(list(map(int, input().split())))

print(L[N//2]-L[N//2-1])

### FIXED CODE ###

N = int(input())
P = sorted(list(map(int, input().split())))

print(P[N//2]-P[N//2-1])
def gcd(m,n):
    x = max(m,n)
    y = min(m,n)

    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y
            y = z
        else:
            return z

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

skoubaisu = 1
for x in a:
    skoubaisu = lcm(skoubaisu,x)

if M*2 <= skoubaisu:
  print(0)
else:
  print(M//skoubaisu+1)

### FIXED CODE ###

K,X = [int(x) for x in input().split()]

total = K * 500

if total >= X:
    print("Yes") 
else:
    print("No")
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
temp,temp2=0,0
Sa,Sb=[0]*n,[0]*m
for i in range(n):
    temp+=a[i]
    Sa[i]=temp
for i in range(m):
    temp2+=b[i]
    Sb[i]=temp2
ans,j=0,m-1
for i in range(n):
    if Sa[i]>k: break
    while Sa[i]+Sb[j]>k: j-=1
    ans=max(ans,i+j+2)
print(ans)

### FIXED CODE ###

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

for i in range(1,n+1): a[i]=a[i]+a[i-1]
for i in range(1,m+1): b[i]=b[i]+b[i-1]
j=m
ans=0
for i in range(n+1):
    if j<0: break
    while a[i]+b[j]>k and j>=0: j-=1
    ans=max(i+j,ans)
print(ans)
N , i = list(map(int, input().split()))
print(n + 1 -i)

### FIXED CODE ###

n, i = list(map(int, input().split()))
print(n - i + 1 )
import sys
input = sys.stdin.readline
a,o,b=map(int,input().split())
print(a+b if o=="+" else a-b)


### FIXED CODE ###

import sys
input = sys.stdin.readline
a,o,b=input().split()
a=int(a)
b=int(b)
print(a+b if o=="+" else a-b)
import copy
N = int(input())
X = list(map(int,input().split()))
length = len(X)
sortx = sorted(X)
bef = sortx[int(length//2)]
aft = sortx[int(length//2)+1]

for i in range(N):
    if(X[i]<=bef):
        print(aft)
    else:
        print(bef)

### FIXED CODE ###

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

sortx = sorted(X)
bef = sortx[N//2-1]
aft = sortx[N//2]
for i in X:
        print(aft if i <= bef else bef)
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    c = Counter(A)
    if (c.most_common()[0][1] < 2 or c.most_common()[1][1] < 2) \
            and c.most_common()[0][1] < 4:
        return print(0)
    d = [i[0] for i in c.items() if i[1] >= 2]
    d.sort()
    e = [i[0] for i in c.items() if i[1] >= 4]
    e.sort()
    print(max(d[-1] * d[-2], e[-1]*e[-1]))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    c = Counter(A)
    if (c.most_common()[0][1] < 2 or c.most_common()[1][1] < 2) \
            and c.most_common()[0][1] < 4:
        return print(0)
    d = [i[0] for i in c.items() if i[1] >= 2]
    if d:
        d.sort()
    e = [i[0] for i in c.items() if i[1] >= 4]
    if e:
        e.sort()
    if d and e:
        print(max(d[-1] * d[-2], e[-1]*e[-1]))
    elif d:
        print(d[-1] * d[-2])
    else:
        print(e[-1]*e[-1])


if __name__ == '__main__':
    main()
n = int(input())
lim = 10**18
ans,exc = 1,False
for x in input().split():
  ans *= int(x)
  if ans > lim:
    exc = True
    print("-1")
if not exc:
  print(ans)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
inpt = map(int, raw_input())

if (inpt[0] * inpt[1]) % 2 == 0: print 'Even'
else: print 'Odd'


### FIXED CODE ###

inpt = map(int, raw_input().split())

if (inpt[0] * inpt[1]) % 2 == 0:
	print "Even"
else:
	print "Odd"
r,c = map(int,input().split())
mat = [[i for i in map(int,input().split())] for _ in range(4)]
c_sum = [0 for _ in range(c+1)]
for i in mat :
    i.append(sum(i))
    for j in range(len(i)) :
        c_sum[j] += i[j]
    
mat.append(c_sum)
for i in mat :
    print(" ".join(list(map(str,i))))
    
    

### FIXED CODE ###

r,c = map(int,input().split())
mat = [[i for i in map(int,input().split())] for _ in range(r)]
c_sum = [0 for _ in range(c+1)]
for i in mat :
    i.append(sum(i))
    for j in range(len(i)) :
        c_sum[j] += i[j]
    
mat.append(c_sum)
for i in mat :
    print(" ".join(list(map(str,i))))
r = input()
rr = input()
rrr = r * rr
print(rrr)

### FIXED CODE ###

r = int(input())
print(r * r)
x,y=map(int,input().split())
ans="No"
if a in range(x+1):
  b=x-a
  a*2+b*4==y:
    ans="Yes"
print(ans)

### FIXED CODE ###

X,Y=map(int, input().split())
p=(4*X-Y)/2
q=(Y-2*X)/2
if p==int(p) and q==int(q) and p>=0 and q>=0:
  print("Yes")
else:
  print("No")
A,B,K = map(int, input().split())
tmp = list(range(A,B+1))
answer = list(set(tmp[0:K]+tmp[-K:]))
print(*answer, sep='\n')

### FIXED CODE ###

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

ak = [i for i in range(a, min(b + 1, a + k))]
bk = [i for i in range(max(a, b - k + 1), b + 1)]

answer = list(set(ak) | set(bk))
answer.sort()
print(*answer, sep='\n')
n = int(input())
n_1 = int(n ** (1/2))
s = 0
 
for i in range(1,n_1):
    if n % i == 0:
        if i < n // i -1:
            s += (n // i) - 1

print(s)

### FIXED CODE ###

n,k = map(int,input().split())
print(n -k + 1)
import numpy as np
a, b = map(int, input().split(' '))
c = np.lcm(a, b)
print(str(c))

### FIXED CODE ###

result_list = [1, 2, 3]
for i in range(2):
    item = int(input())
    result_list.remove(item)
print(result_list[0])
s = input()
s2 = s
while "01" in s2 or "10"in s2::
    if "01" in s2:
        s2 = s2.replace("01", "")
    elif "10" in s2:
        s2 = s2.replace("10", "")

print(len(s) - len(s2))

### FIXED CODE ###

s = input()
ans = min(s.count("0"), s.count("1")) * 2
print(ans)
N,K,*X = map(int,open(0).read().split())
S = bin(K)[2:]
L = len(S)
ls = [(a,b) for a,b in zip(*[iter(X)]*2)]
s = '0'
ans = 0
for i,c in enumerate(S):
  if c=='0':
    s += c
    continue
  j = L-i
  m = (1<<(j-1))-1
  n = int(s,2)<<j
  x = m|n
  v = 0
  for a,b in ls:
    if x==x|a:
      v += b
  ans = max(v,ans)
  s += c
v = 0
for a,b in ls:
  if K==K|a:
    v += b
ans = max(ans,v)
print(ans)


### FIXED CODE ###

N,K,*X = map(int, open(0).read().split())
S = bin(K)[2:]
L = len(S)
one = set()
ls = [(a,b) for a,b in zip(*[iter(X)]*2) if a<=K]
kls = [K]
ans = 0
for i in range(L):
  if S[i]=='1':
    m = int(S[:i]+'0'+'1'*(L-i-1),2)
    kls.append(m)
for k in kls:
  m = 0
  for a,b in ls:
    if k==k|a:
      m += b
  ans = max(ans,m)
print(ans)
# -*- coding: utf-8 -*-
from functools import reduce
import fractions


def gcd(*numbers):
  return reduce(fractions.gcd, numbers)


n = int(input())
lst = list(map(int, input().split()))
min_v = min(lst)

max_gcd = 0
for i in range(n):
  arr = lst[:i] + lst[i + 1:len(lst)]
  if min_v < max_gcd:
    break
  wk_gcd = gcd(*arr)
  max_gcd = wk_gcd if wk_gcd > max_gcd else max_gcd

print(max_gcd)


### FIXED CODE ###

# -*- coding: utf-8 -*-
def check(a, time):
  ret, mod = divmod(time, a)
  value = True if mod == 0 else check(a, ret) if ret > a else False
  return value


a, b, t, biscuit = map(int, input().split() + ["0"])
for i in range(1, t + 1):
  if check(a, i):
    biscuit = biscuit + b

print(biscuit)
s=input()
for i in range(len(s)):
    if s[i]==s[i+1]:
        result='Bud'
        break
    else:
        result='Good'
print(result)


### FIXED CODE ###

s=input()
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        result='Bad'
        break
    else:
        result='Good'
print(result)
a, b, c = list(map(int, input()))
if a < b and b < c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a, b, c = list(map(int, input().split()))
if a < b and b < c:
  print("Yes")
else:
  print("No")