Harryxun/stf_run huggingface dataset:
from math import sqrt
EPS = 10**(-8)
N = 100
def intersection(p, q, s, t):
    a = 2*(p-s)
    b = 2*(q-t)
    c = (p**2+q**2) - (s**2+t**2)
    A = a**2 + b**2
    Bx = p*b**2 + a*(c-q*b)
    Cx = (p**2+q**2-1)*b**2 - 2*b*c*q + c**2
    Dx = Bx**2-A*Cx
    #By = q*a**2 + b*(c-p*a)
    #Cy = (p**2+q**2-1)*a**2 - 2*a*c*p + c**2
    #Dy = By**2-A*Cy
    x0 = (-sqrt(Dx)+Bx)/A; y0 = (-x0*a + c)/b;
    x1 = (sqrt(Dx)+Bx)/A; y1 = (-x1*a + c)/b;
    return x0, y0, x1, y1
def dist(p, q, s, t):
    return (p-s)**2 + (q-t)**2
x,y = [0.0]*N,[0.0]*N
xi = [0.0]*2; yi = [0.0]*2
while True:
    n = input()
    if n==0:
        break
    ans = 1
    for i in xrange(n):
        x[i], y[i] = map(float, raw_input().split(','))
    for i in xrange(n):
        for j in xrange(i+1, n):
            rr = dist(x[i], y[i], x[j], y[j])
            if rr<4.00+EPS:
                if rr<EPS:
                    cnt = 2
                    for k in xrange(n):
                        if k==i or k==j:
                            continue
                        if dist(x[i], y[i], x[k], y[k])<1.00+EPS:
                            cnt += 1
                    ans = max(ans, cnt)
                else:
                    xi[0], yi[0], xi[1], yi[1] = intersection(x[i], y[i], x[j], y[j])
                    for t in xrange(2):
                        #print xi[t],yi[t], "(", i, j,")"
                        cnt = 2
                        for k in xrange(n):
                            if k==i or k==j:
                                continue
                            rri = dist(xi[t], yi[t], x[k], y[k])
                            if rri<1.00+EPS:
                                cnt += 1
                                #print k, rri
                        #print ">>",cnt
                        ans = max(ans, cnt)
    print ans

### FIXED CODE ###

import math
while 1:
    N = int(input())
    if N == 0:
        break

    PS = []
    for i in range(N):
        x, y = map(float, input().split(','))
        PS.append((int(x * 100000), int(y * 100000)))

    D2 = 100000**2
    ans = 0
    for i in range(101):
        py = i * 10000
        for j in range(101):
            px = j * 10000
            cnt = 0
            for x, y in PS:
                if (px - x) ** 2 + (py - y) ** 2 <= D2:
                    cnt += 1
            ans = max(ans, cnt)
    print(ans)
from math import gcd
a,b,c,d = map(int, input().split())
c_n = b//c - (a-1)//c
d_n = b//d - (a-1)//d
l = (c*d)//gcd(c,d)
l_n = b//l - (a-1)//l
print(c_n+d_n-l_n)

### FIXED CODE ###

from fractions import gcd
a,b,c,d = map(int, input().split())
c_n = b//c - (a-1)//c
d_n = b//d - (a-1)//d
l = (c*d)//gcd(c,d)
l_n = b//l - (a-1)//l
print(b - a - c_n - d_n + l_n + 1)
#!/usr/bin/env python3
#CODE FESTIVAL 2017 Final A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
lst = ['A','K','I','H','B','R']
for i in range(len(s)):
    if s[i] not in lst:
        print('NO')
        quit()
a = s.count('A')
t = ''
for i in range(len(s)):
    if s[i] != 'A':
        t += s[i]
if 'KIHBR' not in t or a > 4 or 'KIH' not in s:
    print('NO')
    quit()
if t.count('K') != 1 or t.count('I') != 1 or t.count('H') != 1 or t.count('B') != 1 or t.count('R') != 1:
    print('NO')
    quit()
a = 0
for i in range(len(s)):
    if s[i] == 'K':
        if s[:i].count('A') > 1:
            print('NO')
            quit()
    if s[i] == 'H':
        for j in range(i+1.len(s)):
            if s[j] == 'B':
                if s[i:j].count('A') > 1:
                    print('NO')
                    quit()
    if s[i] == 'B':
        for j in range(i+1,len(s)):
            if s[j] == 'R':
                if s[i:j].count('A') > 1:
                    print('NO')
                    quit()
    if s[i] == 'R':
        if s[i:].count('A') > 1:
            print('NO')
            quit()
print('YES')


### FIXED CODE ###

#!/usr/bin/env python3
#CODE FESTIVAL 2017 Final A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
lst = ['A','K','I','H','B','R']
for i in range(len(s)):
    if s[i] not in lst:
        print('NO')
        quit()
a = s.count('A')
t = ''
for i in range(len(s)):
    if s[i] != 'A':
        t += s[i]
if 'KIHBR' not in t or a > 4 or 'KIH' not in s:
    print('NO')
    quit()
if t.count('K') != 1 or t.count('I') != 1 or t.count('H') != 1 or t.count('B') != 1 or t.count('R') != 1:
    print('NO')
    quit()
for i in range(len(s)):
    if s[i] == 'K':
        if s[:i].count('A') > 1:
            print('NO')
            quit()
    if s[i] == 'H':
        for j in range(i+1,len(s)):
            if s[j] == 'B':
                if s[i:j].count('A') > 1:
                    print('NO')
                    quit()
    if s[i] == 'B':
        for j in range(i+1,len(s)):
            if s[j] == 'R':
                if s[i:j].count('A') > 1:
                    print('NO')
                    quit()
    if s[i] == 'R':
        if s[i:].count('A') > 1:
            print('NO')
            quit()
print('YES')
a,b=(int(x) for x in input().split())
c = ( a + b ) % 3
if (str(a) % '3' == '0' or str(b) % '3' == '0' or (c) == '0'):
    print ( 'Possible' )
else:
    print ( 'Impossible' )

### FIXED CODE ###

a,b=(int(x) for x in input().split())
c = ( a + b ) % 3
if ((int(a) % 3)  == 0 or  (int(b) % 3)  == 0 or int(c) == 0):
    print ( 'Possible' )
else:
    print ( 'Impossible' )
N, K = list(map(int, input().split()))


def check(k, hs, mx, mn, memo):
    if (k, mx, mn) in memo:
        return memo[(k, mx, mn)]
    if k == 0:
        return mx - mn
    r = []
    for i, h in enumerate(hs):
        hs.remove(h)
        r.append(check(k - 1, hs, max(mx, h), min(mn, h), memo))
        hs.insert(i, h)
    memo[(k, mx, mn)] = min(r)
    return min(r)


def main():
    hs = [int(input()) for i in range(N)]
    print(check(K, hs, 0, 10 ** 9, {}))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N, K = list(map(int, input().split()))
    hs = [int(input()) for i in range(N)]
    hs.sort()
    i = 0
    r = 10 ** 9
    while True:
        if i + K > N:
            break
        r = min(r, hs[i + K - 1] - hs[i])
        i += 1
    print(r)


if __name__ == '__main__':
    main()
import numpy as np
n,x,y = map(int, input().split())
s = np.zeros((n,n))
t = np.zeros(n)
for i in range(0,n):
  for j in range(i,n):
    s[i][j] = abs(i-j)
x = x-1
y = y-1
s[x][y] = 1
for i in range(0,n):
  for j in range(i,n):
    a = abs(i-x)+abs(j-y)+1
    if a < s[i][j];
    s[i][j] = a

for i in range(0,n):
  for j in range(i,n):
    for k in range(0.n):
      if k+1 == s[i][j]:
        t[k+1] += 1

for k in range(0.n):
  print t[k]

### FIXED CODE ###

n,x,y = map(int, input().split())
t = [0 for i in range(n)]
x = x-1
y = y-1
for i in range(0,n):
  for j in range(i,n):
    a = abs(i-x)+abs(j-y)+1
    b = abs(i-j)
    if a < b:
      t[a-1] += 1
    else:
      t[b-1] += 1

for k in range(0,n-1):
  print(int(t[k]))
N,M = map(int, input().split())
def abc(n, m):
    if n<=abs(n-m):
        return n
    else:
        return abc(abs(n-m), m)
p=abc(N,M)
print(p)

### FIXED CODE ###

N,M = map(int, input().split())
if N>=N%M:
    if N%M>=M-N%M:
        ans=M-N%M
    else:
        ans=N%M
else:
    ans=N
print(ans)
n = int(input())
h = list(map(int, input().split()))
sum = 0
m = 0
for i in h:
    if m <= i:
        sum += 1
        m = i
print(sum)

### FIXED CODE ###

a,b = map(int, input().split())
if a == b:
    print(a*2)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    XY=[tuple(map(int,input().split())) for _ in range(n)]
    parity=[0]*2
    for x,y in XY:
        parity[(x+y)%2]=1

    # 双方のparityがあれば不可能
    if(parity[0] and parity[1]):
        print(-1)
        return

    # for output
    m=31
    D=[2**i for i in range(m)]
    W=[None]*m
    # parityが偶数ならば、先に長さ1のRを入れることで、奇数の場合に帰着
    if(parity[0]):
        XY=[(x-1,y) for x,y in XY]
        D.insert(0,1)

    # 45 deg 回転
    U=[x-y for x,y in XY]
    V=[x+y for x,y in XY]

    for j in range(n): # 各 U[i],V[i]に対して方向を定める
        res=[0]*m
        u=(U[j]+pow(2,m)-1)//2
        v=(V[j]+pow(2,m)-1)//2
        for i in range(m):
            ub=u&1; vb=v&1
            if(ub and vb):
                res[i]='R'
            elif(ub and (not vb)):
                res[i]='D'
            elif((not ub) and vb):
                res[i]='U'
            else:
                res[i]='L'
            u>>=1; v>>=1
        W[j]=''.join(res)

    # output
    print(m+parity[0])
    print(*D)
    for j in range(n):
        ans=W[j] if(parity[1]) else 'R'+W[j]
        print(ans)
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    XY=[tuple(map(int,input().split())) for _ in range(n)]
    parity=[0]*2
    for x,y in XY:
        parity[(x+y)%2]=1

    # それぞれのパリティの点が存在すると不可能
    if(parity[0] and parity[1]):
        print(-1)
        return

    m=31
    D=[pow(2,i) for i in range(m)]
    # 偶数の場合は奇数に帰着させる
    if(parity[0]):
        XY=[(x-1,y) for x,y in XY]
        D=[1]+D

    U=[x-y for x,y in XY]
    V=[x+y for x,y in XY]

    W=[0]*n
    for j in range(n):
        res=[0]*m
        u=(U[j]+pow(2,m)-1)//2
        v=(V[j]+pow(2,m)-1)//2
        for i in range(m):
            ub=u&1; vb=v&1
            if(ub and vb):
                res[i]='R'
            elif(ub and (not vb)):
                res[i]='D'
            elif((not ub) and vb):
                res[i]='U'
            else:
                res[i]='L'
            u>>=1; v>>=1
        ans=''.join(res)
        W[j]=ans

    m=m+parity[0]
    print(m)
    print(*D)
    for j in range(n):
        ans=W[j] if(parity[1]) else 'R'+W[j]
        print(ans)
resolve()
m = input()
n = input()
i = 0
j = 0
list = []
while i < m:
    while j < n:
        k = input()
        list.append(k)
        j += 1
    i += 1
i = 0
list2 = []
while i < n:
    k = input()
    list2.append(k)
    i += 1
i = 0
j = 0
k = 0
while i < m:
    while j < n:
        t = list[j + k]
        s = list2[j]
        sum += t * s
        j += 1
    print(sum)
    i += 1
    k += 4

### FIXED CODE ###

a1 = [input().split()]
m = int(a1[0][0])
n = int(a1[0][1])
a2 = [input().split() for i in range(m)]
a3 = [input().split() for i in range(n)]
i = 0
while i < m:
    sum = 0
    j = 0
    while j < n:
        s = int(a2[i][j]) * int(a3[j][0])
        sum += s
        j += 1
    print(sum)
    i += 1
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
cnt = ()
ans=[]

for j in li:
    cnt.add(set(num for num in range(j[0],j[1]+1)))

ans = cnt[0]
for k in range(len(cnt)-1):
    ans = ans & cnt[k+1]
print(len(ans))


### FIXED CODE ###

n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,i[0])
    min_r = min(min_r,i[1])
if min_r >= max_l:
    print(min_r-max_l+1)
else:
  print(0)
N, W = map(int, input().split())
wv = np.array([list(map(int, input().split())) for _ in range(N)], dtype="int64")
dp = np.zeros(W + 1, dtype="int64")

for w, v in wv:
    dp[W:w-1:-1] = np.maximum(dp[W:w-1:-1], dp[W-w::-1] + v)
    print(dp)
    
print(dp[-1])

### FIXED CODE ###

# -*- coding: utf-8 -*-

import numpy as np

EDPC = "https://atcoder.jp/contests/DP/"
TDPC = "https://atcoder.jp/contests/tDPc/tasks"

################ DANGER ################
test = ""
#test = \
"""
3 8
3 30
4 50
5 60
ans 90
"""

"""
5 5
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
ans 5000000000(>int32)
"""

"""
6 15
6 5
5 6
6 4
6 6
3 5
7 2
ans 17
"""
########################################
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
########################################  
# np.maximum(np.array([1,3,2]), np.array([2, 1, 3]))
N, W = map(int, input2().split())
WV = np.array([tuple(map(int, input2().split())) for _ in range(N)])

dp = np.zeros(W + 1, dtype="int64")
for w, v in WV:
    dp[W:w-1:-1] = np.maximum(dp[W:w-1:-1], dp[W-w::-1] + v)

print(dp[-1])
a, b, c=map(int, raw_input().split())
max_min=sorted(a, b, c)
for i in range(len(max_min)):
    print max_min[i],

### FIXED CODE ###

n=map(int, raw_input().split())
max_min=sorted(n)
for i in range(len(max_min)):
    print max_min[i],
s=int(input())
mod=10**9+7


dp=[1]*(s+1)

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


#print(dp)
for i in range(3,s+1):
    for j in range(3,s-i+1):
        dp[i+j]+=dp[i]%mod
    #print(i,dp)
print(dp[s]%mod)







### FIXED CODE ###

s=int(input())
mod=10**9+7

if s<3:
    print(0)
    exit()

dp=[1]*(s+1)

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

#print(dp)
for i in range(3,s+1):
    for j in range(3,s-i+1):
        dp[i+j]+=dp[i]%mod
    #print(i,dp)
print(dp[s]%mod)
N, K = int(input())
H = list(map(int, input().split()))
P = [0] + [-1] * (len(H)-1)

def minv(i, v):
  if i < len(H):
    cost = v()
    if P[i] < 0:
      P[i] = cost
    else:
      P[i] = min(P[i], cost)

for i in range(len(H)-1):
  for k in range(1, K+1):
    minv(i + 1, lambda : P[i] + abs(H[i] - H[i+k]))

print(P[-1])


### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
P = [0] + [-1] * (len(H)-1)

def minv(i, v):
  if i < len(H):
    cost = v()
    if P[i] < 0:
      P[i] = cost
    else:
      P[i] = min(P[i], cost)

for i in range(len(H)-1):
  for k in range(1, K+1):
    minv(i + k, lambda : P[i] + abs(H[i] - H[i+k]))

print(P[-1])
N, M = map(int, input().split())
E = [[] for i in range(N)]
RE = [[] for i in range(N)]
for i in range(M):
  u, v = map(int, input().split())
  E[u - 1].append(v - 1)
  RE[v - 1].append(u - 1)
S, T = map(int, input().split())
RD = [-1] * N
RD[T - 1] = 0
Q = [T - 1]
while Q:
  q = Q.pop(0)
  for adj in RE[q]:
    if RD[adj] == -1:
      RD[adj] = RD[q] + 1
      Q.append(adj)
D = [[-1, -1, -1] for i in range(N)]
Q = [[-1, -1, -1] for i in range(3 * N)]
Q[0] = [S - 1, 0, RD[S - 1] % 3]
o = 0
i = 1
while Q:
  q, d, m = Q[o]
  o += 1
  if q == -1:
    break
  if RD[q] == -1:
    continue
  D[q][m] = d + RD[q]
  if m != 0:
    for adj in E[q]:
      _m = (d + 1 + RD[adj]) % 3
      if D[adj][_m] == -1:
        Q[i] = [adj, d + 1, _m]
        i += 1
P = [d[0] for d in D if d[0] != -1]
if P:
  print(min(P) // 3)
else:
  print(-1)

### FIXED CODE ###

N, M = map(int, input().split())
E = [[] for i in range(N)]
RE = [[] for i in range(N)]
for i in range(M):
  u, v = map(int, input().split())
  E[u - 1].append(v - 1)
  RE[v - 1].append(u - 1)
S, T = map(int, input().split())
RD = [-1] * N
RD[T - 1] = 0
Q = [T - 1]
while Q:
  q = Q.pop(0)
  for adj in RE[q]:
    if RD[adj] == -1:
      RD[adj] = RD[q] + 1
      Q.append(adj)
D = [[-1, -1, -1] for i in range(N)]
Q = [[-1, -1, -1] for i in range(M)]
if M:
  Q[0] = [S - 1, 0, RD[S - 1] % 3]
o = 0
i = 1
while Q:
  q, d, m = Q[o]
  Q[o] = [-1, -1, -1]
  o = (o + 1) % M
  if q == -1:
    break
  if RD[q] == -1:
    continue
  D[q][m] = d + RD[q]
  if m != 0:
    for adj in E[q]:
      _m = (d + 1 + RD[adj]) % 3
      if D[adj][_m] == -1:
        Q[i] = [adj, d + 1, _m]
        i = (i + 1) % M
P = [d[0] for d in D if d[0] != -1]
if P:
  print(min(P) // 3)
else:
  print(-1)
n, k = LI()
a = LI()
l = len(a[:a.index(1)])
r = len(a[a.index(1):])

if l == 0:
    left = 0
elif l < k:
    left = 1
else:
    left = math.ceil((l - k) / (k - 1)) + 1

if r == 0:
    right = 0
elif r < k:
    right = 1
else:
    right = math.ceil((r - k) / (k - 1)) + 1

print(left + right)

### FIXED CODE ###

import math, sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]


n, k = LI()
a = LI()

result = math.ceil((n - k) / (k - 1)) + 1

print(result)
function check(n):
    i = 1
    print(" ",end="")
    while(i != n):
        if  (i % 3 == 0):
            print(i,end="")
        elif(i % 10 == 3):
            print(i,end="")
            i = i / 10
        
check(30)


### FIXED CODE ###

n = int(input())

for  i in range(1,n+1):
    if i%3 == 0 or str(i).find("3") != -1:
        print(" %d" %i ,end="")
print()
N = int(input())

y>=math.log(1.01, N/100)
print(y)

### FIXED CODE ###

import math
N = int(input())

s=100
count=0

while N > s:
    s*=1.01
    s=math.floor(s)
    count+=1
print(count)
n, m = (int(i) for i in input().split())  
a = [[int(i) for i in input().split()] for i in range(n)] 
dic = {}
lis = []

for x in a:
  if x[0] not in dic:
  	dic[x[0]] = x[1]
  else:
    dic[x[0]] += x[1]

sorted_dict = sorted(dic.items(), key=lambda x:x[0])

count = 0
for x in sorted_dict:
  if len(lis) >= m:
    break
  else:
    lis += [x[0]] * x[1]
    count += x[1]
  
#print(lis)
print(sum(lis[:m]))

### FIXED CODE ###

n, m = (int(i) for i in input().split())  
a = [[int(i) for i in input().split()] for i in range(n)] 
dic = {}
lis = []

a.sort()
ans = 0
for x in a:
  if x[1] >= m:
    ans += x[0] * m
    break
  else:
    ans += x[0] * x[1]
    m -= x[1]

print(ans)
N,A,B = [map(int,input().split())]
print(sum(i for i in range(n+1)) if A <= sum(map(int,str(i))) <= B)

### FIXED CODE ###

N,A,B =map(int,input().split())
print(sum(i for i in range(N+1) if A <= sum(map(int,str(i))) <= B))
import sys

param = sys.argv

print( int(param[1]) ** 3 )

### FIXED CODE ###

import sys
p = sys.stdin.readline()
p = int(p)
o = p ** 3
print o
a = int(input())
x = r * 3.14
print(x)

### FIXED CODE ###

r = int(input())
x = r *2 * 3.14
print(x)
N = int(input())
A = list(map(int,input().split()))

ans = 0


sum_A = A[0]
for i in range(1,N) :
    if ((sum_A + A[i]) == 0) or (sum_A *(sum_A + A[i]) >= 0) :
        if sum_A > 0 :
            ans += 1 + sum_A + A[i]
            #print("ans += {}".format(1 + sum_A + A[i]))
            sum_A = -1
        elif sum_A < 0 :
            ans += 1 - (sum_A + A[i])
            #print("ans += {}".format(1 - (sum_A + A[i])))
            sum_A = 1
        
    else :
        sum_A += A[i]
        #print("else")
    record.append(sum_A)

print(ans)


### FIXED CODE ###

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

calc1 = 0
calc2 = 0

L = A

if L[0] > 0 :
    su = L[0]
else :
    su = 1
    calc1 += 1 + abs(L[0])

for i in range(1,N) :
    su += L[i]
    if i % 2 :
        if su >= 0 :
            calc1 += 1 + abs(su)
            su = -1
    else :
        if su <= 0 :
            calc1 += 1 + abs(su)
            su = 1

L = A

if L[0] < 0 :
    su = L[0]
else :
    su = -1
    calc2 += 1 + abs(L[0])

for i in range(1,N) :
    su += L[i]
    if not i % 2 :
        if su >= 0 :
            calc2 += 1 + abs(su)
            su = -1
    else :
        if su <= 0 :
            calc2 += 1 + abs(su)
            su = 1
print(min(calc1,calc2))
def dist(a, b):
  if a * b < 0:
    return 2 * min(abs(a), abs(b)) + max(abs(a), abs(b))
  else:
    return max(abs(a), abs(b))

def solve(A, K):
  ans = dist(A[0], A[K])
  for i in range(len(A)-K+1):
    ans = min(ans, dist(A[i], A[i+K-1]))
  return ans
               
N, K, *A = map(int, open(0).read().split())
print(solve(A, K))

### FIXED CODE ###

def dist(a, b):
  if a * b < 0:
    return 2 * min(abs(a), abs(b)) + max(abs(a), abs(b))
  else:
    return max(abs(a), abs(b))

def solve(A, K):
  ans = dist(A[0], A[K-1])
  for i in range(len(A)-K+1):
    ans = min(ans, dist(A[i], A[i+K-1]))
  return ans
               
N, K, *A = map(int, open(0).read().split())
print(solve(A, K))
#58b
o = input()
e = input()
ans=[]
for i in range(len(o)):
    ans.append(o[i]+e[i])
print(''.join(ans))

### FIXED CODE ###

#58b
o = input()
e = input()
ans=[]
for i,j in zip(o,e):
    ans.append(i+j)
    
if len(o)>len(e):
    ans.append(o[-1])

print(''.join(ans))
N, K = map(int, input().split())
a = list(map(int, input().split()))
b = []

for k in range(K):
    b = [0 for _ in range(N)]
    for i in range(N):
        for j in range(max(i-a[i], 0), min(i+a[i]+1, N)):
            b[j] += 1
    a = b
    
ans = " ".join([str(i) for i in a])
print(ans)

### FIXED CODE ###

S = input()
print(S[0:3])
if __name__ == '__main__':
  S = raw_input()
  Sdate = datetime.date(S.year, S.month)
  if Sdate <= datetime(2019, 4, 30):
    print('Heisei')
  else:
    print('TBD')

### FIXED CODE ###

from datetime import datetime

if __name__ == '__main__':
  S = raw_input()
  Sdate = datetime.strptime(S, '%Y/%m/%d')
  if Sdate <= datetime(2019, 4, 30):
    print('Heisei')
  else:
    print('TBD')
import sys
sys.setrecurisonlimit(10**9)
N,W = map(int,input().split())
info = [list(map(int,input().split())) for i in range(N)]
# dp[i+1][w] i+1番目まで品物を選んで重さwのときの価値の最大値
# dp[0] = [0]*(W+1)
dp = [[0]*(W+1) for i in range(N+1)]
for i in range(N):
    for w in range(W+1):
        if  w - info[i][0] >= 0:
            dp[i+1][w] = max(dp[i][w-info[i][0]] + info[i][1],dp[i][w])
        else:    
            dp[i+1][w] = dp[i][w]
print(dp[N][W])

### FIXED CODE ###

N,W = map(int,input().split())
value,weight = [],[]
def chmin(a,b):
    if (a > b):
        a = b
        return True
    return False
for i in range(N):
    w,v = map(int,input().split())
    value.append(v)
    weight.append(w)
# dp[i][v]: i番目までの品物から価値vを超えるように選んだ時の重さの最小値
dp = [[float("inf")] * (sum(value)+1) for i in range(N+1)]
dp[0][0] = 0
for i in range(1,N+1):
    for v in range(sum(value)+1):
        if v - value[i-1] >= 0:
            dp[i][v] = min(dp[i-1][v-value[i-1]] + weight[i-1],dp[i-1][v])
        else:
            dp[i][v] = dp[i-1][v]
ans = 0
for v in range(sum(value),-1,-1):
    if dp[N][v] <= W:
        ans = v
        break
print(ans)
import sys 
def sieves(m):
    global S
    S = range(1,m+1,2)
    r = int(m**.5)
    h = len(S)
    S[0] = 0
    for i in range(h):
        x = S[i]
        if x>r: break
        if x and i+x<h: S[i+x:h:x] = [0]*((h-1-i-x)/x+1)
    S[0] = 2
    return

S=[]
sieves(50001)
for s in sys.stdin:
    n = int(s)
    p1 = n/2-1
    p2 = (n+1)/2
    while S[p1]==0: p1 -=1
    while S[p2]==0: p2 +=1
    print S[p1],S[p2]

### FIXED CODE ###

import sys
def primes(m):
    N = range(1,m+1,2)
    r = int(m**.5)
    h = len(N)
    N[0] = 0
    i=0
    while N[i]<=r:
        x = N[i]
        if x and i+x<h: N[i+x:h:x] = [0]*((h-1-i-x)/x+1)
        i += 1
    x = [2] + filter(None,N)
    return x

PRIMES = primes(50030)
for s in sys.stdin:
    n = int(s)
    for a in PRIMES:
        if a>n: break
        elif a<n: b = a
    print b,a