Harryxun/stf_run huggingface dataset:
from collections import deque

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [[0] * 2 for i in range(M)]
for i in range(M):
    BC[i][0],BC[i][1] = map(int, input().split())

A.sort()
BC = sorted(BC, key=lambda x:x[1],reverse=True)
flag = False

k = 0
for i in range(M):
    for j in range(BC[i][0]):
        if A[k] < BC[i][1]:
            A[k] = BC[i][1]
            k += 1
        else:
            print(sum(A))
            flag = True
            break
    if flag == True:
        break

print(sum(A))

### FIXED CODE ###

from collections import deque
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [[0] * 2 for i in range(M)]
for i in range(M):
    BC[i][0],BC[i][1] = map(int, input().split())

A.sort()
BC = sorted(BC, key=lambda x:x[1],reverse=True)

k = 0
for i in range(M):
    for j in range(BC[i][0]):
        
        if k >= N:
            print(sum(A))
            sys.exit()
        
        if A[k] < BC[i][1]:
            A[k] = BC[i][1]
            k += 1
        else:
            print(sum(A))
            sys.exit()

print(sum(A))
N,K=map(int,input().split())
L=list(map(int,input().split()))
sum(list(sorted(L))[:K])


### FIXED CODE ###

N=int(input())
cnt=0
while N>0:
  N//=2
  cnt=cnt*2+1
print(cnt)
hp, atk = input().split()

hp = int(hp)
atk = int(atk)

value = 0

numlist = list((input().split()))

numlist = list(map(int, numlist))

for i in range(atk):
    value = value + numlist[i]
    
if value > hp:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math

hp, atk = input().split()

hp = int(hp)

atk = int(atk)

print(math.ceil(hp / atk))
b = int(input())

if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'G':
  print('C')
else:
  print('G')

### FIXED CODE ###

b = input()

if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'G':
  print('C')
else:
  print('G')
n = int(input())
a = list(map(int, input().split()))

mynas=0
for i in range(n):
    if a[i]<0:
        mynas += 1

goukei=0
if mynas % 2 ==0:
    for j in range(n):
        goukei+=abs(a[j])
else:
    a=np.array(a)
    np.abs(a)
    a=np.sort(a)
    for k in range(n):
        goukei+=a[i]
    goukei-=a[0]*2

print(goukei)


### FIXED CODE ###

import numpy as np
n = int(input())
a = list(map(int, input().split()))

mynas=0
for i in range(n):
    if a[i]<0:
        mynas += 1

a=np.array(a)
a=np.abs(a)
a=np.sort(a)
goukei=0

if mynas % 2 ==0:
    for j in range(n):
        goukei += a[j]
else:
    for k in range(n):
        goukei+=a[k]
    goukei-=a[0]*2

print(goukei)
import itertools

N = int(input())

S = []
for _ in range(N):
    S.append(input())
    
M, A, R, C, H = [], [], [], [], []

march = ["M","A","R","C","H"]

for s in S:
    top = s[0]
    if top in march:
        if top == "M":
            M.append(s)
        elif top == "A":
            A.append(s)
        elif top == "R":
            R.append(s)
        elif top == "C":
            C.append(s)
        elif top == "H":
            H.append(s)

MARCH = [len(M), len(A), len(R), len(C), len(H)]

for i in range(len(MARCH)):
    if MARCH[i] == 0:
        del march[i]

if len(march) <= 2:
    print(0)

else:
    x = 0
    pattern = list(itertools.combinations(MARCH, 3))
    for i in pattern:
        x += i[0]*i[1]*i[2]
    print(x)
    

### FIXED CODE ###

import itertools

N = int(input())

S = []
for _ in range(N):
    S.append(input())
    
M, A, R, C, H = [], [], [], [], []

march = ["M","A","R","C","H"]

for s in S:
    top = s[0]
    if top in march:
        if top == "M":
            M.append(s)
        elif top == "A":
            A.append(s)
        elif top == "R":
            R.append(s)
        elif top == "C":
            C.append(s)
        elif top == "H":
            H.append(s)

MARCH = [len(M), len(A), len(R), len(C), len(H)]

if MARCH.count(0) >= 3:
    print(0)

else:
    x = 0
    pattern = list(itertools.combinations(MARCH, 3))
    for i in pattern:
        x += i[0]*i[1]*i[2]
    print(x)
import sys
a,b = map(int(sys.stdin.readline().split()))
if a < b:
print("a < b")
elif a > b:
print("a > b")
else:
print("a == b")


### FIXED CODE ###

import sys
a,b = map(int,sys.stdin.readline().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
N = int(input())
n=N
c=0
while n>0:
  n//=10
  c+=1

print(c)
if c%2==0:
  print(int((10**c-1)/11))
else: 
  print(int(N-10**(c-1)+1+(10**(c-1)-1)/11))


### FIXED CODE ###


abc=input().split()
a,b,c=int(abc[0]),int(abc[1]),int(abc[2])
 
print(max(0,c-(a-b)))
N, A, B = map(int, input().split())

c = N // (A + B)
mod = N % (A + B)
# print(c,mod)

if mod > A:
    mod_A = mod // A 
    # print(mod_A)
    print(c * A + mod_A * A)
else:
    print(c * A + mod)

### FIXED CODE ###

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

q, mod = divmod(N, A+B)
# print(q,mod)

if A == 0:
    print(0)
else:
    if mod > A:
        print(q * A + A)
    else:
        print(q * A + mod)
a, b = map(int,input().split())
min_a=str(a)*b
min_b=str(b)*a
print(min(min_a, min_b)

### FIXED CODE ###

a,b = map(int,input().split())
min_a=str(a)*b
min_b=str(b)*a
print(min(min_a, min_b))
r= int(input())
p= 3.141592
print(p*r**2,2*p*r)

### FIXED CODE ###

from math import pi
r = float(input())
print(round(r * r * pi, 7), round(2 * pi * r, 7))
def frog2(H,N,K):
    #print(H)
    DP = [10**10]*N
    #DP = [0]*N
    DP[0] = 0
    DP[1] = abs(H[1]-H[0])
    for i in range(2,N):
        for j in range(1,K+1):
            DP[i] = chmin(DP[i],DP[i-j]+abs(H[i]-H[i-j]))
    return DP[-1]

def chmin(a,b):
    if a < b:
        return a
    else:
        return b

if __name__ == '__main__':
    N,K = map(int,input().split())
    H = list(map(int,input().split()))
    ans = frog2(H,N,K)
    print(ans)
    

### FIXED CODE ###


def frog(H,N):
    #print(H)
    DP = [0]*N
    DP[0] = 0
    DP[1] = abs(H[1]-H[0])
    for i in range(2,N):
        DP[i] = min(abs(H[i]-H[i-2])+DP[i-2],abs(H[i]-H[i-1])+DP[i-1])
    #print(DP)
    return DP[-1]    
if __name__ == '__main__':
    N = int(input())
    H = list(map(int,input().split()))
    ans = frog(H,N)
    print(ans)
S=input()
L=len(S)
L1=len(S)
L2=0
while L1!=L2:
    L1=len(S)
    S=S.replace("01","")
    S=S.replace("10","")
    print(S)
    L2=len(S)
print(L2)
print(L-L2)


### FIXED CODE ###

S=input()
print(len(S)-abs(S.count("1")-S.count("0")))
a="0"+input()
b="1"+input()
dp=[[0]*len(b) for i in range(len(a))]
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]==b[j]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
            else:
                dp[i][j]=1
        else:
            if i>0 and j>0:
                dp[i][j]=max(dp[i-1][j],dp[i][j-1])
            elif i==0 and j>0:
                dp[i][j]=dp[i][j-1]
            elif i>0 and j==0:
                dp[i][j]=dp[i-1][j]
            else:
                dp[i][j]=0

ans = []
x,y=len(a)-1,len(b)-1
lcs = dp[x][y]
while x > 0 or y > 0:
    if x-1 >= 0 and dp[x-1][y] == lcs:
        x -= 1
    elif y-1 >= 0 and dp[x][y-1] == lcs:
        y -= 1
    else:
        ans.append(a[x])
        y -= 1
        x -= 1
        
        lcs -= 1
print("".join(ans[::-1]))

### FIXED CODE ###

# https://atcoder.jp/contests/dp/tasks/dp_a
# A - Frog 1

N=int(input())
H=list(map(int,input().strip().split(" ")))


def find(H):
    if len(H) == 1:
        return 0

    dp = [0] * len(H)
    dp[1] = abs(H[1] - H[0])
    for i in range(2, len(H)):
        dp[i] = min(dp[i - 1] + abs(H[i] - H[i - 1]), dp[i - 2] + abs(H[i] - H[i - 2]))
    return dp[-1]


#H = [10, 30, 40, 20]
print(find(H))
l=[]
for i in range(3):
  l.append(list(map(int,input().split())))
n=int(input())
l1=[]
for i in range(n):
  l1.append(int(input())
for i in range(len(l)):
    for j in range(len(l)):
        if(l[i][j] in l1):
            l[i][j]=0
f=0
if((l[0][0]==0 and l[0][1]==0 and l[0][2]==0) or (l[1][0]==0 and l[1][1]==0 and l[1][2]==0) or (l[2][0]==0 and l[2][1]==0 and l[2][2]==0))
    f=1
elif((l[0][0]==0 and l[1][0]==0 and l[2][0]==0) or (l[0][1]==0 and l[1][1]==0 and l[2][1]==0) or (l[0][2]==0 and l[1][2]==0 and l[2][2]==0))
    f=1
elif((l[0][0]==0 and l[1][1]==0 and l[2][2]==0) or (l[0][2]==0 and l[1][1]==0 and l[2][0]==0)):
    f=1
if(f==1):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

l=[]
for i in range(3):
  l.append(list(map(int,input().split())))
n=int(input())
l1=[]
for i in range(n):
  l1.append(int(input()))
for i in range(len(l)):
    for j in range(len(l)):
        if(l[i][j] in l1):
            l[i][j]=0
f=0
if((l[0][0]==0 and l[0][1]==0 and l[0][2]==0) or (l[1][0]==0 and l[1][1]==0 and l[1][2]==0) or (l[2][0]==0 and l[2][1]==0 and l[2][2]==0)):
    f=1
elif((l[0][0]==0 and l[1][0]==0 and l[2][0]==0) or (l[0][1]==0 and l[1][1]==0 and l[2][1]==0) or (l[0][2]==0 and l[1][2]==0 and l[2][2]==0)):
    f=1
elif((l[0][0]==0 and l[1][1]==0 and l[2][2]==0) or (l[0][2]==0 and l[1][1]==0 and l[2][0]==0)):
    f=1
if(f==1):
    print("Yes")
else:
    print("No")
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 9

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)


### FIXED CODE ###

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

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)
s = input() + "T"
x, y = map(int, input().split())
n = len(s)

tmp = n 
for i in range(n):
    if s[i] == "T":
        tmp = i
        break
    x -= 1
    
up_down = False
cnt = 0
ud =[]
lr = []
for i in range(tmp, n):
    if s[i] == "T":
        if up_down and cnt != 0:
            ud.append(cnt)
        if not up_down and cnt != 0:
            lr.append(cnt)
        cnt = 0
        up_down = not up_down
    else:
        cnt += 1

def is_subset_sum(array, k, x_y):
    if (k + x_y) % 2 != 0:
        return False
    MOD = 10**9 + 1
    n = len(array)

    # dp[i][j] := i番目までを選んだときにsumがjになるかどうか
    dp = [[False] * (k + 1) for i in range(n + 1)]
    dp[0][0] = True

    for i in range(n):
        for j in range(k + 1):
            if j - array[i] < 0:
                dp[i + 1][j] = dp[i][j]
            else:
                dp[i + 1][j] = dp[i][j] or dp[i][j - array[i]]

    return dp[n][abs(k + x_y)//2]


if is_subset_sum(lr, sum(lr), x) and is_subset_sum(ud, sum(ud), y):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

muki = "plus_x"

#info[muki][kaisu]

info=[["plus_x",0]]
count = 0
for i in range(len(s)):
  if s[i]=="F":
    if muki == "plus_x":
      info[0][1] += 1
    else:
      info[count][1] +=1
      
  if s[i] =="T":
    if muki =="plus_x" or muki=="x":
      muki ="y"
      info.append(["y",0])
      count += 1
    elif muki =="y":
      muki ="x"
      info.append(["x",0])
      count += 1
      
#print(info)
x_set=set([info[0][1]])
y_set=set([0])

for i in range(1,count+1):
  if info[i][0]=="x":
    x_set = set(map(lambda x: x+info[i][1], x_set))|set(map(lambda x: x-info[i][1], x_set))
  if info[i][0]=="y":
    y_set = set(map(lambda y: y+info[i][1], y_set))|set(map(lambda y: y-info[i][1], y_set))

if (x in x_set) and (y in y_set):
  print("Yes")
else:
  print("No")
if W>=S:
  print("unsafe")
else:
  print("safe")

### FIXED CODE ###

s,w=map(int,input().split())
if w>=s:
  print("unsafe")
else:
  print("safe")
red blue
5 5
blue

### FIXED CODE ###

if __name__ == '__main__':
    s = input()
    a = s.split(" ", )
    c, d = map(int, input().split())
    f = input()
    if f  == a[0]:
        c = c-1
    else:
        d = d-1
    print(str(c)+" "+str(d))
INF = float("inf")
n = int(input())
m = [[0] * (n + 1) for _ in range(n + 1)]
li = [list(map(int, a.split())) for a in sys.stdin]
z = (li[0][0], ) + list(zip(*li))[1]
for l in range(1, n):
    for i in range(1, n - l + 1):
        j = i + l
        m[i][j] = INF
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + z[i - 1] * z[k] * z[j])
print(m[1][n])



### FIXED CODE ###

import sys
INF = float("inf")
n = int(input())
m = [[0] * (n + 1) for _ in range(n + 1)]
li = [list(map(int, a.split())) for a in sys.stdin]
z = (li[0][0], ) + list(zip(*li))[1]
for l in range(1, n):
    for i in range(1, n - l + 1):
        j = i + l
        m[i][j] = INF
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + z[i - 1] * z[k] * z[j])
print(m[1][n])
def s(l):
    if l<2:
        return 1
    else:
        return s(l-2)
ab=int(input())
ll=s(ab)
a=0
b=1
while(b):
    if(ll%10!=0):
        b=0
    else:
        a=a+1
print(a)

### FIXED CODE ###

# v=[]
# num=251
# for i in range(num):
#     if i==0 or i==1:
#         v.append(1)
#     else:
#         v.append(i*v[i-2])
        
# for i in range(0,num,2):
#     print(i,v[i],end=' ')
#     print()

n=int(input())
if n%2!=0:
    print(0)
else:
    ans=n//10
    n=n//10
    i=1
    while(1):
        ans+=n//(5**i)
        if n//(5**i)==0:
            break
        i+=1
        
        
    print(ans)
a,b,k = map(int, input().split())
import math
import sys
c = math.gcd(a, b)
ls = []
for i in range(1, c):
    if c % i == 0:
        ls.append(i)

print(ls[k-1])


### FIXED CODE ###

a, b, c= map(int, input().split())
print(min(b//a, c))
N,K,X,Y=map(int,input().split(sep))
print(int((K*X)+((N-K)*Y)))

### FIXED CODE ###

N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)
s = input().split()
sum = 700
for n in s:
  if n == 'o'
  	sum += 100
print(sum)

### FIXED CODE ###

n = list(input())
sum = 700
for a in n:
  if a == 'o':
  	sum += 100
print(sum)
SIZE = 10 ** 6 + 100
g1, g2, inv = [1, 1], [1, 1], [0, 1]
for i in range(2, SIZE + 1):
    g1.append((g1[-1] * i) % MOD)
    inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
    g2.append((g2[-1] * inv[-1]) % MOD)
def nPr(n, r):
    if r < 0 or r > n:
        return 0
    return g1[n] * g2[r] % MOD
def nCr(n, r):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % MOD

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict
from itertools import combinations, permutations
from itertools import accumulate
from math import ceil, sqrt, pi

MOD = 10 ** 9 + 7
INF = 10 ** 18

K = int(input())
A, B = map(int, input().split())

for i in range(A, B + 1):
    if i % K == 0:
        print("OK")
        exit()
        
print("NG")
n,k=map(int,input().split())
A=list(map(int,input().split()))
a=[0]*n
a[0]=1
nxt=A[0]-1
i=2
while 1:
  a[nxt]=i
  nxt=A[nxt]-1
  i+=1
  if a[nxt]!=0:
    g=i-a[nxt]
    t=a[nxt]-1
    break
if t>=k:
  print(a.index(k+1)+1)
else:
  k-=t
  u=k%g
  print(a.index(t+u+1)+1)

### FIXED CODE ###

s=input()
t=input()
if s==t[:-1]:
  print('Yes')
else:
  print('No')
import sys


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


def main():
    INF = 10**7
    h, w = [int(i) for i in input().split()]
    c_h, c_w = [int(i) for i in input().split()]
    d_h, d_w = [int(i) for i in input().split()]
    grid = [["#"] * (w + 2)]
    for _ in range(h):
        line = ["#"] + list(input()) + ["#"]
        grid.append(line)
    grid.append(["#"] * (w + 2))
    warp_count = [[INF] * (w + 2) for _ in range(h + 2)]
    directions = ((1, 0), (-1, 0), (0, 1), (0, -1))
    warps = []
    for x in range(-2, 3):
        for y in range(-2, 3):
            if x == 0 and y == 0:
                continue
            if (x, y) not in directions:
                warps.append((x, y))

    stack = []
    warp_count[c_h][c_w] = 0
    stack.append((c_h, c_w, 0))

    while stack:
        _h, _w, warp = stack.pop()
        warp_count[_h][_w] = warp

        cnt = 0
        # walk
        for _a, _b in directions:
            if grid[_h + _a][_w + _b] != "#" and warp_count[_h + _a][_w + _b] > warp:
                cnt += 1
                stack.append((_h + _a, _w + _b, warp))

        if cnt == 4:  # 4方向行けるときにワープは不要
            continue

        # warp
        for x, y in warps:
            if _h + x < 0 or _h + x > h or _w + y < 0 or _w + y > w:
                continue
            elif grid[_h + x][_w + y] == "#":
                continue

            if warp_count[_h + x][_w + y] > warp + 1:
                stack.append((_h + x, _w + y, warp + 1))

    if warp_count[d_h][d_w] == INF:
        print(-1)
    else:
        print(warp_count[d_h][d_w])
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
# sys.setrecursionlimit(100000)
from collections import defaultdict


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


def main():
    h, w, m = [int(i) for i in input().split()]
    d_h = defaultdict(int)
    d_w = defaultdict(int)
    bom = set()
    for _ in range(m):
        h, w = [int(i) for i in input().split()]
        bom.add((h, w))
        d_h[h] += 1
        d_w[w] += 1
    H = sorted(d_h.items(), key=lambda x: -x[1])
    W = sorted(d_w.items(), key=lambda x: -x[1])
    ans = 0
    for k_h, v_h in H:
        for k_w, v_w in W:
            tmp = v_h + v_w
            if (k_h, k_w) in bom:
                tmp -= 1
                ans = max(tmp, ans)
            else:
                ans = max(tmp, ans)
                break
        else:
            continue
        break

    for k_w, v_w in W:
        for k_h, v_h in H:
            tmp = v_h + v_w
            if (k_h, k_w) in bom:
                tmp -= 1
                ans = max(tmp, ans)
            else:
                ans = max(tmp, ans)
                break
        else:
            continue
        break
    print(ans)


if __name__ == "__main__":
    main()
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    ab = sorted([ist(map(int, input().rstrip('\n').split())) for _ in range(n)])
    t = 0
    for a, b in ab:
        t += b
        if t >= k:
            print(a)
            exit()


if __name__ == '__main__':
    slove()


### FIXED CODE ###

n, k = map(int, input().split())
ab = [list(map(int, input().split()))for _ in range(n)]
ab.sort()
cnt = 0
for a, b in ab:
    cnt += b
    if cnt >= k:
        print(a)
        exit()
ret = -1

for i in range(1,1010):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    ret = i
    break
print(ret)

### FIXED CODE ###

A, B = map(int, input().split())
ret = -1

for i in range(1,1010):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    ret = i
    break
print(ret)
s =input()
print("Bad" if any(S[i]==S[i+1] for i in range(3)) else "Good")

### FIXED CODE ###

s = input()

print("Bad" if any(s[i]==s[i+1] for i in range(3)) else "Good")
def inpl(): return list(map(int, input().split()))

H, W = inpl()
A = [inpl() for _ in range(H)]
B = [inpl() for _ in range(W)]

DP = [[0 for _ in range(W+1)] for _ in range(H+1)]
DP[0][0] = 1 << 12800

for h in range(H):
    for w in range(W):
        d = abs(A[h][w] - B[h][w])
        DP[h+1][w] |= DP[h][w] >> d
        DP[h+1][w] |= DP[h][w] << d
        DP[h][w+1] |= DP[h][w] >> d
        DP[h][w+1] |= DP[h][w] << d
l = 1 << 12800
r = 1 << 12800
for i in range(12800):
    if (DP[-1][-2]& l) | (DP[-1][-2] & r):
        print(i)
        break
    l = l << 1
    r = r >> 1

### FIXED CODE ###

def inpl(): return list(map(int, input().split()))

H, W = inpl()
A = [inpl() for _ in range(H)]
B = [inpl() for _ in range(H)]

DP = [[0 for _ in range(W+1)] for _ in range(H+1)]
DP[0][0] = 1 << 12800

for h in range(H):
    for w in range(W):
        d = abs(A[h][w] - B[h][w])
        DP[h+1][w] |= DP[h][w] >> d
        DP[h+1][w] |= DP[h][w] << d
        DP[h][w+1] |= DP[h][w] >> d
        DP[h][w+1] |= DP[h][w] << d
l = 1 << 12800
r = 1 << 12800
for i in range(12801):
    if (DP[-1][-2]& l) | (DP[-1][-2] & r):
        print(i)
        break
    l = l << 1
    r = r >> 1
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

#
# A, B, C = list(map(int, sys.stdin.readline().split()))
# a = A
# ok = False
# for _ in range(1000):
#     ok |= a % B == C
#     a += A
# if ok:
#     print('YES')
# else:
#     print('NO')
#
#
# A, B = [int(sys.stdin.readline()) for _ in range(2)]
# if A>B:
#     print('GREATER')
# elif A<B:
#     print('LESS')
# else:
#     print('EQUAL')


O, E = [sys.stdin.readline().rstrip() for _ in range(2)]
ans = ''
for i in range(len(O)):
    ans += O[i]
    ans += E[i]

print(ans)


### FIXED CODE ###

import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")


import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

#
# A, B, C = list(map(int, sys.stdin.readline().split()))
# a = A
# ok = False
# for _ in range(1000):
#     ok |= a % B == C
#     a += A
# if ok:
#     print('YES')
# else:
#     print('NO')
#
#
# A, B = [int(sys.stdin.readline()) for _ in range(2)]
# if A>B:
#     print('GREATER')
# elif A<B:
#     print('LESS')
# else:
#     print('EQUAL')


O, E = [sys.stdin.readline().rstrip() for _ in range(2)]
ans = ''
for i in range(len(O)):
    ans += O[i]
    if i < len(E):
        ans += E[i]

print(ans)



#
# N, M = list(map(int, sys.stdin.readline().split()))
# A, B = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))
# C, D = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(M)]))
#
# O, E = [sys.stdin.readline().rstrip() for _ in range(2)]
# ans = ''
# for i in range(len(O)):
#     ans += O[i]
#     ans += E[i]
#
# print(ans)
N = int(input())
s = str(input())
t = str(input())

word = s + t

if s == t:
  print(N)

for letter in s:
  if letter not in letter_list:
    letter_list.append(letter)
    
for letter in t:
  if letter not in list(letter_dict.keys()):
    letter_dict[letter] = 1
    
print(len(letter_dict))

### FIXED CODE ###

import sys
N = int(input())
s = str(input())
t = str(input())

answer = 2 * N
for i in range(N, 2 * N + 1):
    if s[len(s) - (2 * N - i):] == t[:2 * N - i]:
        answer = i
        break
    
print(answer)
W, a, b = map(int,input().split())
 
if a+W<=b:
  print(b-(a+W))
elif (a<= b)and (b<(a+W)):
  print(b-a)
elif ((a-W)<=b) and(b<a):
  print(a-b)
elif (b<(a-W):
  print(a-(b+W))

### FIXED CODE ###

W, a, b = map(int,input().split())
 
if (a+W)<=b:
  print(b-(a+W))
elif (a<= b)and (b<(a+W)):
  print(0)
elif ((a-W)<=b) and(b<a):
  print(0)
elif b<(a-W):
  print(a-(b+W))