peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, W = list(map(int, input().split()))

wv = [list(map(int, input().split())) for i in range(N)]

dp = [[0] * (W+1) for i in range(N)]

for i in range(N):
  w, v = wv[i]
  for j in range(W, 0, -1):
    if j - w < 0:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = max(dp[i-1][j-w]+v, dp[i-1][j])

print(dp[N-1][W])
# Judge status: Accepted
N = int(input())
S = list(map(int,input().split()))
S = sorted(S)
a = S[0]
for i in range(N-1):
  a = (a + S[i+1])/2
  
print(a)
# Judge status: Accepted
n = int(input())
lst = [ [ int(i) for i in input().split() ] for j in range(n) ]
r = 0
for i in range(n-2):
    if lst[i][0] == lst[i][1]:
        if lst[i+1][0] == lst[i+1][1]:
            if lst[i+2][0] == lst[i+2][1]:
                r = 1
if r == 0:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

E = max(C, D)
while True:
    if E % min(C, D) == 0:
        break
    E += max(C, D)

print(B - A - (B-A)//C - (B-A)//D + (B-A)//E)
# Judge status: Accepted
A, V = map(int, input().split()) 
B, W= map(int, input().split()) 
T = int(input())


diff1 = abs(A - B)
diff2 = (V - W)*T

if ( diff1 <= diff2):
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = (n - 1 + k - 2) // (k - 1) 
print(ans)
# Judge status: Wrong Answer
a, b, c, d = map(int,input().split())

if a - c <= d :
    print('Yes')
elif (a - b) <= d and (b - c) <= d:
    print('Yes')
else :
    print('No')
# Judge status: Wrong Answer
a = input()
s = list(a)

for i in range(len(s)):
  if (a[i] == '?'):
    s[i] = 'D'

print(s)
# Judge status: Accepted
from decimal import Decimal

A, B = input().split()
A = Decimal(A)
B = Decimal(B)
print(int(A * B))
# Judge status: Accepted
s = input()
modify = '2018'+ s[4:]

print(modify)
# Judge status: Accepted
n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = input()
ans = 0
vstd = [0]*n
def jungkeng(x):
  global ans
  if x=='r':
    ans += p
  elif x=='s':
    ans += r
  else:
    ans += s
  return ans
  
for i in range(k):
  ans = jungkeng(t[i])
  vstd[i]=1
for i in range(k,n):
  if t[i]==t[i-k] and vstd[i-k]:
    continue
  ans = jungkeng(t[i])
  vstd[i] = 1
print(ans)
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
aa = []
bb = []
for _ in range(n):
    a, b = map(int, readline().split())
    aa.append(a)
    bb.append(b)
aa.sort()
bb.sort()
print(bb[n // 2] - aa[n // 2] + 1 + n // 2)
# Judge status: Accepted
s=input()
n=len(s)
for i in range(2,n,2):
  h=(n-i)//2
  if s[:h]==s[h:n-i]:
    print(n-i)
    break
# Judge status: Wrong Answer
s = input()
t = input()
if s == t[:-1]:
  print("YES")
else: 
  print("NO")
# Judge status: Wrong Answer
import math

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

vol = a**2 * b
ans = 0
if vol/2 < x:
    print("水多し、台形になる")
    h0 = x/(a**2)
    c = 2*h0 - b
    ans = math.degrees(math.atan((b-c)/a))
else:
    print("水少ない、三角形になる")
    d = (2*x)/(b*a)
    ans = math.degrees(math.atan(b/d))
print(ans)
# Judge status: Accepted
N = int(input())
print(N*(N-1)//2)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if b-a == c-b:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b,c,k = map(int,input().split())

'''
if k%2==0:
    num = (2**k+2)/3
    tak = num*a+(num-1)*b+(num-1)*c
    nak = (num-1)*a+num*b+(num-1)*c

else:
    num = (2**k+1)/3
    tak = (num-1)*a+num*b+num*c
    nak = num*a+(num-1)*b+num*c
'''
if k%2==0:
    ans=a-b
else:
    ans=b-a

if abs(ans)>10**18:
    print('Unfair')
else:
    print(ans)
# Judge status: Wrong Answer
N = int(input())
a = [int(input()) for i in range(N)] 

ans = sum(a)
done = True
if not ans % 10 == 0:
  print(ans)
else:
  a.sort()
  for i in range(N):
    ans -= a[i]
    if not ans % 10 == 0:
      print(ans)
      break
  else:
    print("0")
# Judge status: Accepted
n = int(input())
aa = list(sorted(map(int, input().split())))
x = max(aa)
y = aa[0]
for i in range(1, n - 1):
    if abs(x / 2 - y) > abs(x / 2 - aa[i]):
        y = aa[i]
print("{} {}".format(x, y))
# Judge status: Accepted
s=int(input())
ans=0
mod=10**9+7
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

for i in range(1,s//3+1):
    ans+=(combinations_count(s-3*i+i-1,s-3*i))%mod
print(ans%mod)
# Judge status: Accepted
n = int(input())
v = list(map(int, input().split()))
v.sort()
s = 0
temp = v[0]
for i in range(n - 1):
    s = (temp + v[i + 1]) / 2
    temp = s
print(s)
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
from collections import deque

d=deque(list(input().rstrip()))
d.append("2")
ans=0
r=0

while r<len(d):
    if len(d)<2:
        break
    if d[0]!=d[1] and d[0]!=2 and d[1]!=2:
        d.popleft()
        d.popleft()
        ans+=2
        r=0
    else:
        d.rotate(-1)
        r+=1

print(ans)
# Judge status: Wrong Answer
#67 A - Multiple Array
N = int(input())
A, B = [],[]
for _ in range(N):
    a,b= map(int,input().split())
    A.append(a); B.append(b)
A = list(reversed(A))
B = list(reversed(B))

c = 0
for a,b in zip(A,B):
    if a%b == 0:
        continue
    # 前に押されたボタンの回数分足される
    a += c
    # c 回ボタンを押せば Ai は Bi の倍数になる
    c += b-(a%b)
print(c)
# Judge status: Accepted
X,A,B=map(int,input().split())
if A>=B:
    print("delicious")
elif A<B and (A+X)>=B:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
N, M = map(int,input().split())

A = list(map(int,input().split()))
D = dict()

for a in A:
    if a in D:
        D[a] += 1
    else:
        D[a] = 1

for _ in range(M):
    B, C = map(int,input().split())
    if C in D:
        D[C] += B
    else:
        D[C] = B

D = sorted(D.items(), reverse = True)

ans, cnt = 0, 0
for d in D:
    x = min(d[1], N-cnt)
    cnt += x
    ans += d[0] * x

    if cnt == N: break


print(ans)
# Judge status: Wrong Answer
import numpy as np

N = int(input())
a = np.fromstring(input(), sep=" ", dtype=np.int64)
b = np.bitwise_xor.reduce(a)
c = np.bitwise_xor(a, 0)
print(*c, sep=" ")
# Judge status: Wrong Answer
a, b, k = map(int, input().split())
ans = []
pool = [i for i in range(a, b+1)]
ans += pool[:k] + pool[-k:]
ans = list(set(ans))
[print(i) for i in ans]
# Judge status: Wrong Answer
a,b=(int(x) for x in input().split())
if a>b:
  print(str(b)*a)
else:
  print(str(a)*b)
# Judge status: Accepted
S = input()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      count+=1
  print(count)
# Judge status: Wrong Answer
n=int(input())
for i in range(n+1):
 ans=0
 for x in range(i):
  for y in range(i):
   for z in range(i):
    if i==x*x+y*y+z*z+x*y+x*z+y*z:
      ans+=1
 print(ans)
# Judge status: Accepted
def gcd(x,y):
    ans=0
    if x < y :
        x,y=y,x
    
    if y==0:
        return x
    else:
        return gcd(y,x%y)

def prime_decomposition(x):
  i = 2
  table = []
  while i * i <= x:
    while x % i == 0:
      x //= i
      table.append(i)
    i += 1
  if x > 1:
    table.append(x)
  return table
  
a,b=map(int,input().split())

m=gcd(a,b)
ans=len(list(set(prime_decomposition(m))))+1
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    A = list(map(int, input().split()))

    res = 1
    inc = 0
    dec = 0

    for i in range(n - 1):
        if A[i] < A[i+1]:
            inc += 1
        elif A[i] > A[i+1]:
            dec += 1
        
        if inc and dec:
            res += 1
            inc, dec = 0, 0
    
    print(res)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

ans=float('inf')
num=-100
while num!=101:
    kari=0
    for i in range(n):
        kari+=(num-a[i])**2
    num+=1
    ans=min(ans,kari)

print(ans)
# Judge status: Wrong Answer
s = input().split(" ")
N = int(s[0])
M = s[1]
s = input().split(" ")
A = []
sum = 0
for w in s:
    A.append(int(w))
    sum += int(w)

if sum >= N:
    print(N - sum)
else:
    print(-1)
# Judge status: Wrong Answer
n=int(input())
s=''
t=ord('a')
#print(t)
for i in range(n):
 s+=chr(t+i)
 print(s)
# Judge status: Accepted
s = input()

ans = 99999
for i in range(len(s) - 2):
    ans = min(ans, abs(753 - int(s[i:i + 3])))

print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
harf=sum(a)//2
l,r,i=0,a[0],0
while r<harf:
    i+=1
    l=r
    r+=a[i]
print(min(harf-l,r-harf))
# Judge status: Accepted
n = int(input().strip())
a = int(input().strip())
b = int(input().strip())
c = int(input().strip())
d = int(input().strip())
e = int(input().strip())

bottle_neck = min(a, b, c, d, e)
print(4 + -(-n // bottle_neck))
# Judge status: Wrong Answer
S =input()
listS = [S[0],S[1],S[2],S[3]]
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[2] !=listS[3]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
k = int(input())
a,b = map(int, input().split())
if b-a >= (k - 1) or a%k > b%k:
    print('OK')
else:
    print('NG')
# Judge status: Wrong Answer
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    N = int(inp.readline().strip())

    r = (N * (N - 1)) / 2
    return int(r)


def main():
    import sys
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import defaultdict

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

count=defaultdict(int)
for i in range(N):
  n = a[i]
  count[n-1] += 1
  count[n] += 1
  count[n+1] += 1

print(sorted(count.values())[-1])
# Judge status: Accepted
import math

n = int(input())
List = []
n_sqrt = int(math.sqrt(n))

for i in range(1,n_sqrt+1):
    if n % i == 0:
        number = i + (n // i) -2
        List.append(number)
        
print(min(List))
# Judge status: Accepted
x, a, b = map(int, input().split())
if a>=b:
    print("delicious")
else:
    if b-a>x:
        print("dangerous")
    else:
        print("safe")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
a = int(input())
flg = 0
while a > 0:
	if a % 10 == 9:
		print("Yes")
		flg = 1
		break
	else:
		a = a / 10
if flg == 0:
	print("No")
# Judge status: Wrong Answer
a,b=map(int,input().split())
print('Possible' if a==3 or b==3 or ((a+b)%3)==0 else 'Impossible')
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

x = 1000
for i in range(n-1):
    if A[i] < A[i+1]:
        q, x = divmod(x, A[i])
        x += q*A[i+1]
print(x)
# Judge status: Accepted
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))
# Judge status: Accepted
n,x=map(int,input().split())
L=list(map(int,input().split()))
cnt=0
ans=1
for l in L:
    cnt+=l
    if cnt>x:
        break
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
D = list(map(int, input().split()))

M = max(D)
cnt = [0 for i in range(M + 1)]

for d in D:
    cnt[d] += 1

if D[0] != 0:
    print(0)
    exit()
if cnt[0] != 1 or 0 in cnt:
    print(0)
    exit()

res = 1
MOD = 998244353
for i in range(2, M + 1):
    res *= cnt[i - 1] ** cnt[i]
    res %= MOD

print(res)
# Judge status: Accepted
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(m)]

from collections import defaultdict
d = defaultdict(int)
for i in range(m):
    d[ab[i][0]] += 1
    d[ab[i][1]] += 1

for i in range(1, n + 1):
    print(d[i])
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a + b == c or a + c ==b or b + c == a:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
def main():
    from collections import Counter
    n = int(input())
    s = [input() for _ in range(n)]
    cs = Counter(s)
    m = int(input())
    t = [input() for _ in range(m)]
    print(max(0,cs.most_common()[0][1] - t.count(cs.most_common()[0][0])))

if __name__ == '__main__':
    main()
# Judge status: Accepted
a=input()

if a=="hi"*(len(a)//2):
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
n=int(input())

a=list(map(int,input().split()))
b=[a[0]]
if n%2:#n%2==1
    for i in range(1,n):
        if i%2==1:
            b.append(a[i])
        else:
            b.append(a[i])
else:
    for i in range(1,n):
        if i%2==0:
            b.append(a[i])
        else:
            b.append(a[i])
"""
for i in range(n):
    b.append(a[i])
    b.reverse()
"""
for i in range(n):
    print(b[i],end=" ")
# Judge status: Accepted
N = int(input())
hhh = list(map(int, input().split()))
m = 0
ans = 0
for i in range(N - 1):
    if hhh[i] >= hhh[i + 1]:
        m += 1
        ans = max(ans, m)
    else:
        m = 0
print(ans)
# Judge status: Accepted
S = input()
if S == "AAA":
    print("No")
else:
    if S == "BBB":
        print ("No")
    else:
        print("Yes")
# Judge status: Accepted
n, m = map(int, input().split())
f = {}
s = {}


for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f[b] = 1
        if b in s:
            print("POSSIBLE")
            exit()
    if b == n:
        s[a] = 1
        if a in f:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")
# Judge status: Accepted
n, k = [int(x) for x in input().split()]
seq = [int(x) for x in input().split()]
dp = [0]*n
k = min(k, n)
for i in range(1, k):
    dp[i] = abs(seq[i] - seq[0])
# print(dp)
for i in range(k, n):
    a = dp[i-1] + abs(seq[i] - seq[i-1])
    for j in range(k-1):
        a = min(a, dp[i-2-j] + abs(seq[i] - seq[i-2-j]))
    dp[i] = a
# print(dp)
print(dp[-1])
# Judge status: Accepted
n, m, k = map(int, input().split())

for i in range(n + 1):
    for j in range(m + 1):
        if i * (m - j) + j * (n - i) == k:
            print("Yes")
            exit()

print("No")
# Judge status: Accepted
import sys
n=input()
j=0

if(n[0]==n[1]==n[2]):
 print('No')
else:
 print('Yes')
# Judge status: Accepted
x = int(input())
print((x // 11) * 2 + (0 if x % 11 == 0 else 1 if x % 11 <= 6 else 2))
# Judge status: Accepted
def gcd(a,b):
    a,b = max(a,b),min(a,b)
    while b:
        a,b =b,a%b
    return a

X=int(input())

if 360%X==0:
    print(360//X)
else:
    g =gcd(360,X)
    print(360//g)
# Judge status: Accepted
w,h,n = map(int,input().split())
W = ["."] * w
H = ["."] * h

for _ in range(n):
  x,y,a = map(int,input().split())
  
  if a==1:
    tmp = ["#"]*x + W[x:]
    W = tmp
  elif a==2:
    tmp = W[:x] + ["#"]
    W = tmp
  elif a==3:
    tmp = ["#"]*y + H[y:]
    H = tmp
  elif a==4:
    tmp = H[:y] + ["#"]
    H = tmp
    
print(W.count('.')*H.count('.'))
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()
cnt = 0
for i in range(n):
    if s[i:] == t[:n-i]:
        cnt += i
print(n + cnt)
# Judge status: Accepted
import math

N, H = map(int, input().split())
a, b = [], []
for i in range(N):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

a_max = sorted(a)[-1]
b_des = sorted(b, reverse=True)

res = 0
sum_b = 0
for bi in b_des:
    if bi <= a_max:
        break
    else:
        H -= bi
        res += 1
    if H <= 0:
        break

if H > 0:
    res += int(math.ceil(H / a_max))

print(res)
# Judge status: Accepted
N = int(input())
act = []
for i in range(N):
    a,b,c = map(int,input().split())
    act.append([a,b,c])

INF = 10**10
dp = []
for i in range(N):
    dp.append([0,0,0])

dp[0] = act[0]

for i in range(1,N):
    dp[i][0] = max(dp[i-1][1] + act[i][0],dp[i-1][2] + act[i][0])
    dp[i][1] = max(dp[i-1][0] + act[i][1],dp[i-1][2] + act[i][1])
    dp[i][2] = max(dp[i-1][0] + act[i][2],dp[i-1][1] + act[i][2])

print(max(dp[N-1]))
# Judge status: Accepted
s = str(input())
t = str(input())
a = 0
for i in range(0,len(s)):
    if s[i] != t[i]:
        a = 1
        break
if a == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from math import factorial

N,M=map(int,input().split())
if abs(N-M)>1:
    print(0)
else:
    if N==M:
        mod=10**9+7
        n=factorial(N)%mod
        m=factorial(M)%mod
        print(n*m*2%mod)
    else:
        mod=10**9+7
        n=factorial(N)%mod
        m=factorial(M)%mod
        print(n*m%mod)
# Judge status: Accepted
N = int(input())
S = str(input())

l = 0
r = 0

for i in range(N):
    if S[i] == "(":
        r += 1
    elif S[i] == ")":
        if r >= 1:
            r -= 1
        else:
            l += 1

print("(" * l + S + ")" * r)
# Judge status: Accepted
a, b = map(int, input().split())
c = 1
d = 0
while c < b:
    c += a - 1
    d += 1
print(d)
# Judge status: Accepted
k = int(input())

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

count=0

c=b-a

ans=0

for i in range(a,b+1):
    if i%k==0:
        ans=1
        break

if 0<ans:
    print('OK')

else:
    print('NG')
# Judge status: Wrong Answer
n, k, s = map(int, input().split())

for i in range(k):
    print(s, end=" ")
for i in range(n - k):
    if i != n - k - 1:
        print(s + 1, end=" ")
    else:
        print(s + 1)
# Judge status: Accepted
a = str(input())
b = str(input())
c = int(len(a))
e = int()
for i in range(0,c):
  if a[i] == b[i]:
    e +=1
  else:
    continue
f = int(c-e)
print(f)
# Judge status: Accepted
w,h,n = map(int,input().split())
p = [[int(i) for i in input().split()] for i in range(n)]
a = 0
b = 0
c = w
d = h

for i in range(n):
    if p[i][2] == 1:
        a = max(a, p[i][0])            
    elif p[i][2] == 2:
        c = min(c, p[i][0])
    elif p[i][2] == 3:
        b = max(b, p[i][1])
    else:
        d = min(d, p[i][1])

if c > a and d > b:
    ans = (c-a)*(d-b)
else:
    ans = 0

print(ans)
# Judge status: Accepted
n,k,s=map(int,input().split())
x=10**9
if s==x:x=1
a=[s]*k+[x]*(n-k)
print(*a)
# Judge status: Accepted
n,k = map(int,input().split())
A = list(map(int,input().split()))

left = 0
right = max(A)

#if accumulate[(ai-1)//k]<=k return True?
def is_ok(x):
  cnt = 0
  for i in range(n):
    cnt += (A[i]-1)//x 
  return cnt<=k
     
#binary search
while (right-left)>1:
  mid = (left+right)//2
  if is_ok(mid):
    right = mid
  else:
    left = mid
    
print(right)
# Judge status: Wrong Answer
a,b,t = map(int,input().split())

for i in range(1,20):
  if a*i*(i+1)/2 >=t+0.5:
    if i==1:
      print(0)
      break
    else:
      print(b*i)
      break
# Judge status: Wrong Answer
N = int(input())
N_list = [0]*(N+1)

for i in range(1,11):
    for j in range(1,11):
        for k in range(1,11):
           if(i**2+j**2+k**2+i*j+j*k+k*i<=N):
               N_list[i**2+j**2+k**2+i*j+j*k+k*i]+=1
for i in N_list:
    print(i)
# Judge status: Accepted
S = int(input())
f = 10**9 + 7
dp = [0]*(S+1)
dp[0] = 1
for i in range(1,S+1):
    if i==1 or i==2: dp[i] = 0
    else:
        for j in range(0,i-2):
            dp[i] += dp[j]
            dp[i] %= f
print(dp[-1]%f)
# Judge status: Wrong Answer
s = input()
n = len(s)
ans = 1
if s[0] != "A":
    ans *= 0
check = 0
for i in range(1, n):
    if s[i] == "C" and check == 0:
        check = 1
    elif s[i] == "C":
        check = 0
    else:
        if 97 <= ord(s[i]) <= 122:
            ans *= 1
        else:
            ans *= 0
if s[-1] == "C" or s[1] == "C":
    ans *= 0
print(["WA", "AC"][ans * check])
# Judge status: Accepted
import bisect
n=int(input())
a=[int(input()) for _ in range(n)][::-1]
dp=[]
for i in a:
  if bisect.bisect_right(dp,i)==len(dp):
    dp.append(i)
  else:
    dp[bisect.bisect_right(dp,i)]=i
print(len(dp))
# Judge status: Accepted

import numpy as np


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


N, M, X = inpl()

costs = []
aa = []
for _ in range(N):
    ca = inpl()
    costs.append(ca[0])
    aa.append(ca[1:])

aa = np.array(aa)
costs = np.array(costs)

ans = 10**10
for bit in range(1 << N):
    flags = [(bit >> i) & 1 == 1 for i in range(N)]
    rikai = aa[flags].sum(axis=0)
    if (rikai >= X).sum() == M:
        ans = min(ans, costs[flags].sum())


if ans == 10 ** 10:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
a, b, k = map(int, input().split())
if k <= a:
  print('{} {}'.format(a-k, b))
else:
  k -= a
  print('{} {}'.format(0, max(b-k, 0)))
# Judge status: Accepted
a = list(input())
b = list(input())
for i in range(len(a)-1):
  print(a[i]+b[i],end="")
if len(a) != len(b):
  print(a[-1])
else:
  print(a[-1]+b[-1])
# Judge status: Accepted
S = input()
T = input()

dcts = {}
dctt = {}
jdg = True

for i, s in enumerate(S):
    if s in dcts.keys():
        if dcts[s]!=T[i]:
            jdg = False
            break
    else: dcts[s] = T[i]
    if T[i] in dctt.keys():
        if dctt[T[i]]!=s:
            jdg = False
            break
    else: dctt[T[i]] = s
print('Yes' if jdg else 'No')
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()
cnt1, cnt2 = 0, 1

for Si in S:
    if Si=='a' and cnt1<A+B:
        print('Yes')
        cnt1 += 1
    elif Si=='b' and cnt1<A+B and cnt2<=B:
        print('Yes')
        cnt1 += 1
        cnt2 += 1
    else:
        print('No')
# Judge status: Wrong Answer
def resolve():
    A, B = list(map(int, input().split()))
    S = str(input())
    import re
    if S[A] != '-':
        print('No')
        return
    if re.match('[0-9]+', S[:A]) and re.match('[0-9]+', S[A+1:-1]):
        print('Yes')
        return
    print('No')

resolve()
# Judge status: Wrong Answer
import collections
import sys

n, y = map(int, input().split(" "))

q = collections.deque([10000] * n)
s = sum(q)

while len(q) != 0:
    if s == y:
        c = collections.Counter(q)
        print("%d %d %d" % (c.get(10000, 0), c.get(5000,0), c.get(1000,0)))
        sys.exit()
    if s < y:
        break

    tmp = q.popleft()
    if tmp == 10000:
        s -= 5000
        q.appendleft(5000)
    elif tmp == 5000:
        s -= 4000
        q.append(1000)

print("-1 -1 -1")
# Judge status: Wrong Answer
word = list(input())

if word[2]==word[3] and word[4]==word[5]:
    print("Yes")
# Judge status: Accepted
C=input()
abclist="abcdefghijklmnopqrstuvwxyz"

print(abclist[abclist.index(C)+1])
# Judge status: Accepted
n=int(input())
s=list(input())
ctR=0;ctG=0;ctB=0
for i in range(n):
  if s[i]=='R':
    ctR+=1
  elif s[i]=='G':
    ctG+=1
  else:
    ctB+=1

ct=0
for i in range(n):
  x=s[i]
  for j in range(1,min(i,n-1-i)+1):
    if s[i]!=s[i-j] and s[i]!=s[i+j] and s[i-j]!=s[i+j]:
      ct+=1
print(ctR*ctG*ctB-ct)
# Judge status: Accepted
import math
a=int(input())
b=math.pi
print(2*a*b)
# Judge status: Accepted
from sys import stdin
n = int(stdin.readline())
ans = 0
dp = [0]*(n+1)
for i in range(1,n+1):
    j = i
    while j <= n:
        dp[j] += 1
        j += i
for i in range(1,n+1):
    ans += dp[i]*i
print(ans)
# Judge status: Accepted
L,R=map(int,input().split())
if R-L>=2019:
    minimum=0
else:
    left,right=L%2019,R%2019
    minimum=2018**2
    for i in range(left,right+1):
        for j in range(i+1,right+1):
            minimum=min(minimum,i*j%2019)
print(minimum)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
if 0 in a:
    print (0)
    exit(0)
p = 1
for i in range(n):
    p *= a[i]
    if p>10**18:
        break
if p>10**18:
    p = -1
print (p)
# Judge status: Accepted
A1A2A3=input()
A1, A2, A3 = A1A2A3.split()
A1 = int(A1)  
A2 = int(A2)  
A3 = int(A3)

if A1+A2+A3>=22:
  print('bust')
else:
  print('win')
# Judge status: Wrong Answer
#ABC133 B

import math
N,D = map(int,input().split())
point = []
count = 0
for i in range(N):
    X = list(map(int,input().split()))
    point.append(X)
for i in range(1,N):
    for j in range(i+1,N+1):
        for k in range(D):
            S = 0
            square = []
            square.append(((point[i-1][k])-(point[j-1][k]))**2)
            S += math.sqrt(sum(square))
            if S % 1 ==0:
                count += 1
        

print(count)
# Judge status: Wrong Answer
short = 10
ans = 0
for i in range(5):
    n = int(input())
    if short > n%10 and n%10 > 0:
        short = n%10
    ans += (n//10)*10
    if n%10 > 0:
        ans += 10
print(short,ans)
ans -= 10 if short > 0 else 0
print(ans+short)
# Judge status: Wrong Answer
text = input()
answer = "No"
#print(text)
if "hi" in text:
    if "ii" in text:
        answer = "No"
    elif "hh" in text:
        answer = "No"
    else:
        answer = "Yes"

print(answer)