Harryxun/stf_run huggingface dataset:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
A = LI()
B = LI()


A, B = zip(*sorted(zip(A, B), key=lambda x:x[1]))

A_c = copy.deepcopy(A)

A.sort()
B.sort()

for i in range(N):
    if A[i] > B[i]:
        print("No")
        sys.exit(0)

for i in range(1,N):
    if A[i] < B[i-1]:
        print("Yes")
        sys.exit(0)

# ans = "Yes"
# for i in range(N):
#     if A[i] <= B[i]:
#         pass
#     else:
#         ans = "No"
#         break

si2i = sorted(range(len(A_c)), key=lambda x:A_c[x])
a = 0
count = 0
while True:
    a = si2i[a]
    if a == 0:
        break
    count += 1

if count <= N - 2:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import sys; readline = sys.stdin.readline
from collections import deque
from collections import Counter
 
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
 
A, B = zip(*sorted(zip(A, B), key=lambda x:x[1]))
 
A_s = sorted(A)
B_s = sorted(B)
 
no = "No"
yes = "Yes"
 
for i in range(len(A_s)):
    if A_s[i] > B_s[i]:
        print(no)
        exit(0)
 
for i in range(1, len(A_s)):
    if A_s[i] < B_s[i - 1]:
        print(yes)
        exit(0)
 
si2i = sorted(range(len(A)), key=lambda x:A[x])
 
a = 0
count = 0
while True:
    a = si2i[a]
    if a == 0:
        break
    count += 1
 
if count <= N - 2:
    print(yes)
else:
    print(no)
n = int(input())

a = n//10

b = n-a*10

if a==9 or b==9:
  print("Yes")

else:
  pront("No")

### FIXED CODE ###

n=int(input())

m=n%10
k=n//10

if m==9 or k==9:
  print("Yes")
else:
  print("No")
import math

r = int(raw_input())
print "%f %f" % (r * r *math.pi, 2 * r *math.pi)

### FIXED CODE ###

import math

r = float(raw_input())
print "%f %f" % (r * r *math.pi, 2 * r *math.pi)
# coding: utf-8

N, Y=(int(x) for x in input().split())

A = Y // 10000 #Yを越えない最大の10000円札の枚数
B = Y // 5000
C = Y // 1000

roop = 0
for i in range(A+1):
    if roop == 1:
        break
    for j in range(B+1):
        if i + j > N:
            break
        c = N - i - j #c:1000円札の枚数
        if 10*i + 5*j + c == Y//1000 and c >= 0:
            # a:10000円札、b:5000円札
            a = i
            b = j
            roop = 1
            break

if roop == 1:
    print("{0} {1} {2}".format(a, b, c))
else:
    a, b, c = -1, -1, -1
    print("{0} {1} {2}".format(a, b, c))

### FIXED CODE ###

# coding: utf-8

S = input()

S = S.replace("2017","2018")
print(S)
from fractions import gcd
from functools import reduce
import sys
import numpy as np

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def main():
    N = int(input())
    A = list(map(int, input().split()))
    L = np.lcm.reduce(A)
    ans = 0
    for a in A:
        ans += L // a
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from fractions import gcd
from functools import reduce
import sys
import numpy as np

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


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


def lcm_list(S):
    return reduce(lcm, S)


# mod m におけるaの逆元
def modinv(a, m):
    b = m
    u = 1
    v = 0
    while b:
        t = a // b
        a -= t * b
        a, b = b, a
        u -= t * v
        u, v = v, u
    u %= m

    # 負の場合は m を足して正の数にする
    if u < 0:
        u += m
    return u


def main():
    N = int(input())
    A = list(map(int, input().split()))
    L = lcm_list(A)
    L %= MOD
    ans = 0
    for a in A:
        a_ = modinv(a, MOD)
        ans += L * a_ % MOD
    ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()
d=input()
t=input()
s=input()

    
    if (s*t >= d):
        print ('Yes')
    
    else:
        print ('No')

### FIXED CODE ###

d, t, s = map(int, input().split())

if t * s >= d:
    print("Yes")
else:
    print("No")
N=int(input())
if N%2==0:
  print(N/2)
else if:
  print((N+1)/2)
	

### FIXED CODE ###

N=int(input())
if N%2==0:
  print((N/2)/N)
else:
  print(((N+1)/2)/N)
n = int(input())
a = list(map(int, input().split()))
s = [0]*n
for i in a:
    s[a[i]] += 1
for S in s[1::]:
    print(S)
print('0')

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = [0]*n
for i in a:
    s[i-1] += 1
for S in s[::]:
    print(str(S))
a = list(map(int, input().split( )))

a.sort()

ans = 0
ans += a[0]-b[0]
a[1]+=ans
a[2] += ans
ans += (a[0]-a[2]+1)//2
print(ans)


### FIXED CODE ###

#解説参照
a = list(map(int, input().split( )))
a.sort(reverse = True)
ans = 0
ans += a[0]-a[1]
a[1]+=ans
a[2] += ans
ans += (a[0]-a[2])//2
ans += ((a[0]-a[2])%2)*2###これ
print(ans)
def solve():
    X = int(input())
    memo = {}
    for A in range(100):
        for B in range(100):
            memo[A**5-B**5] = (A,B)
            memo[A**5+B**5] = (A,-B)
    A,B = memo[X]
    print(A, B)

if __name__ == "__main__":
    solve()

### FIXED CODE ###

def solve():
    X = int(input())
    memo = {}
    for A in range(500):
        for B in range(500):
            memo[A**5-B**5] = (A,B)
            memo[A**5+B**5] = (A,-B)
    A,B = memo[X]
    print(A, B)

if __name__ == "__main__":
    solve()
w,a,b = map(int,input().split())
ans = 0
if b > a:
    if a + w < b:
        ans = b - (a + w)
else:
    if b + w <= a:
        ans = a - (b + w)

print(ans)


### FIXED CODE ###

A,B = map(str,input().split())
if A == "H":
  A = 1
else:
  A = -1
if B == "H":
  B = 1
else:
  B = -1

if A*B > 0:
  print("H")
else:
  print("D")
a = input("羊の数")
b = input("狼の数")

S = int(a)
W = int(b)

if S <= W:
  print("unsafe")
else:
  print("safe")
  

### FIXED CODE ###

s, w = map(int, input().split())

if s <= w:
	print("unsafe")
else:
	print("safe")
N = input()

for s in N:
  if s == '7':
    return 'No'
return 'Yes'

### FIXED CODE ###

N = input()

include_7 = False
for s in N:
  if s == '7':
    include_7 = True
print('Yes') if include_7 else print('No')
n = int(input())
while n % 111 != 0:
    x = n+1
    n += 1
print(x)

### FIXED CODE ###

n = int(input())
if n % 111 == 0:
    x = n
while n % 111 != 0:
    x = n+1
    n += 1

print(x)
class UnionFind():
  def __init()__(self, n):
    self.n = n
    self.parents = [-1] * n
    
  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]
  
  def union(self,x,y):
    x = self.find(x)
    y = self.find(y)
    if x == y :
      return
    if self.parents[x] > self.parents[y]:
      x,y = y,x
    self.parents[x] += self.parents[y]
    self.parents[y] = x
    
  def size(self,x):
    return -self.parents[self.find(x)]
  
  def same(self,x,y):
    return self.find(x) == self.find(y)

def main(): 
  n, m, k = map(int, input().split())
  uf = UnionFind(n)
  ans = [0] * n
  deg = [0] * n
  for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    uf.union(a,b)
    deg[a] += 1
    deg[b] += 1
  for _ in range(k):
    c,d = map(int, input().split())
    c -= 1
    d -= 1
    if uf.same(c,d):
      deg[c] += 1
      deg[d] += 1
  for i in range(n):
    ans[i] = uf.size(i) - deg[i] - 1
  print(' '.join(map(str,ans)))

if __name__ == '__main__':
  main()

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7

class UnionFind():
  def __init__(self, n):
    self.n = n
    self.parents = [-1] * n
    
  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]
  
  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)
    
    if x == y:
      return
    
    if self.parents[x] > self.parents[y]:
      x, y = y, x
    
    self.parents[x] += self.parents[y]
    self.parents[y] = x
  
  #xが属するグループに含まれる要素数(サイズ)を返す
  def size(self, x):
    return -self.parents[self.find(x)]
  
  def same(self, x, y):
    return self.find(x) == self.find(y)
  
  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.n) if self.find(i) == root]
  
  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]
  
  def group_count(self):
    return len(self.roots)
  
  #根と根の下に属する要素のリスト辞書を返す
  def all_group_members(self):
    return {r: self.members(r) for r in self.roots()}

  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def main(): 
  n, m, k = map(int, input().split())
  uf = UnionFind(n)
  ans = [0] * n
  deg = [0] * n
  for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    uf.union(a,b)
    deg[a] += 1
    deg[b] += 1
  for _ in range(k):
    c,d = map(int, input().split())
    c -= 1
    d -= 1
    if uf.same(c,d):
      deg[c] += 1
      deg[d] += 1
  for i in range(n):
    ans[i] = uf.size(i) - deg[i] - 1
  print(' '.join(map(str,ans)))

if __name__ == "__main__":
  main()
import sys
from collections import defaultdict

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
S = list('-' + sr())
d = defaultdict(set)
for i in range(1, N+1):
    d[S[i]].add(i)

#print(d)
Q = ir()
for _ in range(Q):
    a, b, c = sr().split()
    if a == '1':
        b = int(b)
        s = S[b]
        d[s].remove(b)
        d[c].add(b)
    else:
        b = int(b); c = int(c)
        ans = 0
        for x in d:
            for y in d[x]:
                if b <= y <= c:
                    ans += 1
                    break
        print(ans)


### FIXED CODE ###

import sys
from bisect import bisect_left, bisect_right, insort

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
S = list('-' + sr())
d = [[] for _ in range(26)]
for i in range(1, N+1):
    s = S[i]
    o = ord(s) - ord('a')
    insort(d[o], i)

Q = ir()
for _ in range(Q):
    q, a, b = sr().split()
    if q == '1':
        a = int(a)
        if S[a] == b:
            continue
        prev = ord(S[a]) - ord('a')
        d[prev].remove(a)
        next = ord(b) - ord('a')
        insort(d[next], a)
        S[a] = b
    else:
        a = int(a); b = int(b)
        ans = 0
        for alpha in range(26):
            if bisect_right(d[alpha], b) - bisect_left(d[alpha], a) >= 1:
                ans += 1
        print(ans)

# 17
N = int(input())
for i in range(26):
  for j in range(16):
	if 4*i + 7*j == N:
	  print("Yes")
	  break


### FIXED CODE ###

N = int(input())
fmax = int(N/4)+1
smax = int(N/7)+1
for i in range(fmax+1):
  for j in range(smax+1):
    if (4*i+7*j) == N:
      print('Yes')
      exit()
print('No')
#include<bits/stdc++.h>
using namespace std;
typedef long long 	ll;
const ll 	MOD		=  	1e+9+7;
const ll 	N 		= 	2*1e6;
int dp[10000001];
int arr[10000001];
int n,k;
int solve(int ind)
{
	if(ind==n-1)
	{
		return 0;
	}
	if(dp[ind]!=-1)
	{
		return dp[ind];
	}
	int ans=solve(ind+1)+abs(arr[ind+1]-arr[ind]);
	for(int i=1;i<=k;i++)
	{
		if(ind+i<n)
		{
			ans=min(ans,solve(ind+i)+abs(arr[ind+i]-arr[ind]));
		}
	}
	return dp[ind]=ans;

}
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	memset(dp,-1,sizeof(dp));
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	cout<<solve(0)<<"\n";
	
	return 0;
}

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**10 for i in range(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] = min(dp[i], dp[i-j] + abs(h[i] - h[i - j]))
print(dp[n-1])
r,d,x = map(int,input().split())
for i in range(1,11):
  w = r*x - d
  x = w
  print(W)

### FIXED CODE ###

r,d,x = map(int,input().split())
for i in range(1,11):
    w = r*x - d
    x=w
    print(w)
B = 0
N = int(input())
A = (int(input()) for i in range(N))
for i in range(N):
  B += input()
C = (int(input()) for i in range(N-1))
for i in range(N-1):
  if A[i]+1 == A[i+1]:
    B += C[i]
print(B)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
for i in range(N-1):
  if A[i]+1 == A[i+1]:
    B.append(C[A[i]-1])
print(sum(B))
import fractions
from functools import reduce


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

MOD = 1e9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
lcms = lcm_list(arrs)
result = 0
for arr in arrs:
    result = (result+lcms/arr)

print(int(result%MOD))

### FIXED CODE ###


from fractions import gcd
MOD = 10**9+7
N = input()
i = 0
arrs = list(map(int, input().split()))
result = 0
lcms = 1
for number in arrs:
    lcms = (((number * lcms)) //(gcd(number, lcms)))
for arr in arrs:
    result += (lcms//arr)
result = result%MOD
ans = str(result).replace('.0','')
print(ans)
import math
a,b,c,d=map(int,input().split())
a-=1
l=c//math.gcd(c,d)*d
print(b-a-b//c+a//c-b//d+a//d+b//l-a//l)


### FIXED CODE ###

import fractions as f
a,b,c,d=map(int,input().split())
a-=1
l=c//f.gcd(c,d)*d
print(b-a-b//c+a//c-b//d+a//d+b//l-a//l)
n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:-1])-m
print(w)

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:n])-m
print(w)
n=int(input())

max=0
for i in range(1,n+1):
    count=0
    x=i
    while i%2 == 0:
        count +=1
        i /=2
        
    if count > max:
        max=count
        ans=x
        
print(ans)   

### FIXED CODE ###

n=int(input())

for i in range(8):
    if 2**i <= n:
        ans=2**i

print(ans)
S=input()

if len(S)==1:
  print(0)

print(min(S[::2].count(0), S[1::2].count(1)) + min(S[::2].count(1), S[1::2].count(0)))

### FIXED CODE ###

S = input()
s1 = S.count('1')
s0 = S.count('0')
print(2*min(s1, s0))
from itertools import accumulate
from bisect import bisect_left

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

ans = float("inf")

for j in range(2,n-1):
    i_list = []
    i_left = bisect_left(s, s[j-1]//2)-1
    if i_left != -1:
        i_list.append([s[i_left], s[j-1]-s[i_left]])
    if i_left != j-2:
        i_list.append([s[i_left+1], s[j-1]-s[i_left+1]])

    k_list = []
    k_left = bisect_left(s, s[j-1]+(s[-1]-s[j-1])//2)-1
    if k_left != j-1:
        k_list.append([s[k_left] - s[j-1], s[-1]-s[k_left]])
    if k_left != n-2:
        k_list.append([s[k_left+1] - s[j-1], s[-1]-s[k_left+1]])
    for i in i_list:
        for k in k_list:
            tmp = max(*i,*k)-min(*i, *k)
            ans = min(ans, tmp)

print(ans)

### FIXED CODE ###

from itertools import accumulate
from bisect import bisect_left

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

ans = float("inf")

for j in range(2,n-1):
    i_list = []
    i_left = bisect_left(s, s[j-1]//2)-1
    if i_left != -1:
        i_list.append([s[i_left], s[j-1]-s[i_left]])
    if i_left != j-2:
        i_list.append([s[i_left+1], s[j-1]-s[i_left+1]])

    k_list = []
    k_left = bisect_left(s, s[j-1]+(s[-1]-s[j-1])//2)-1
    if k_left != j-1:
        k_list.append([s[k_left] - s[j-1], s[-1]-s[k_left]])
    if k_left != n-2:
        k_list.append([s[k_left+1] - s[j-1], s[-1]-s[k_left+1]])
    for i in i_list:
        for k in k_list:
            tmp = max(i+k)-min(i+k)
            ans = min(ans, tmp)
print(ans)
a,b,c = map(int, input().split())
if a >= c:
  a -= c
  print(a,b)
elif c-a < b:
  b -= (c-a)
  a = 0
  print(a,b)
else:
  print(0,0)

### FIXED CODE ###

a,b = input().split()
print(b+a)
a=map(int,input().split())
a.sort()
a=a[::-1]
print("%d %d %d %d %d"%tuple(a))

### FIXED CODE ###

a=sorted(map(int,raw_input().split()))[::-1]
print("%d %d %d %d %d"%tuple(a))
x, b, r = map(int, input().split())
count=0
flag_b=0
flag_r=0
while:
  count+=b if count!=x else break
  flag_b+=1
  count+=r if count!=x else break
  flag_r+=1
  
  
print(x-(flag_r*r))

### FIXED CODE ###

x, b, r = map(int, input().split())
k=int(x/(b+r))
print(k*b+min(x%(b+r), b))
import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

MOD = 10 ** 9 + 7


# 階乗、Combinationコンビネーション(numpyを使う)
def cumprod(arr, MOD):
    L = len(arr)
    Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]
        arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]
        arr[n] %= MOD
    return arr.ravel()[:L]


def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64)
    x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64)
    x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv


U = 10**3
fact, fact_inv = make_fact(U, MOD)
fact, fact_inv = fact.tolist(), fact_inv.tolist()


def mod_comb_k(n, k, mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n - k] % mod


ans = []

# i回操作する方法
for i in range(1, K + 1):
    #print("i=", i)
    res = 1

    # i分割する
    # i-1箇所に置く
    pat_split = 1
    pat_split *= mod_comb_k(K - 1, i - 1, MOD)

    #print("pat_split", pat_split)

    # 残りの玉を置く
    pat_rest = i - 1 + 2
    bal_rest = N - (i - 1) - K
    res *= mod_comb_k(pat_rest + bal_rest - 1, bal_rest, MOD)
    #print("res", res)
    res *= pat_split
    res %= MOD

    ans.append(str(res))

print("\n".join(ans))


### FIXED CODE ###

import sys
import numpy as np
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

MOD = 10 ** 9 + 7


# 階乗、Combinationコンビネーション(numpyを使う)
def cumprod(arr, MOD):
    L = len(arr)
    Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]
        arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]
        arr[n] %= MOD
    return arr.ravel()[:L]


def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64)
    x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64)
    x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv


U = 10**4
fact, fact_inv = make_fact(U, MOD)
fact, fact_inv = fact.tolist(), fact_inv.tolist()


def mod_comb_k(n, k, mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n - k] % mod


ans = []
red = N - K

# i回操作する方法
for i in range(1, K + 1):
    #print("i=", i)
    res = 1

    # i分割するためには、i-1個ボールが必要
    if red < (i - 1):
        ans.append(str(0))
        continue

    # i分割する
    # i-1箇所に置く
    pat_split = 1
    pat_split *= mod_comb_k(K - 1, i - 1, MOD)

    #print("pat_split", pat_split)

    # 残りの玉を置く
    pat_rest = i - 1 + 2
    bal_rest = N - (i - 1) - K
    res *= mod_comb_k(pat_rest + bal_rest - 1, bal_rest, MOD)
    #print("res", res)
    res *= pat_split
    res %= MOD

    ans.append(str(res))

print("\n".join(ans))
S,W = map(int, input.split())
print "unsafe" if W >= S else "safe"

### FIXED CODE ###

S, W = map(int, input().split())
print("unsafe" if W >= S else "safe")
S = input()
T = input()
A = int(input())
B = int(input())
U = input()

if S == U :
  print(A - 1)
elif T == U :
  print(B - 1)

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()
 
if S == U :
  print(str(A - 1) + ' ' + str(B))
elif T == U :
  print(str(A) + ' ' + str(B - 1))
def main():
    N = int(input())
    row = input()
    for (s, t) in zip(row[:N], row[N:]):
        print(s+t, end="")
    print("") # 改行

    if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    N = int(input())
    row = input()
    S = row.split()[0]
    T = row.split()[1]
    result = ""
    for (s, t) in zip(S, T):
        result += s
        result += t
    print(result)

if __name__ == "__main__":
    main()
INF = 10**18
N = int(input())
sum = 1
for _ in range(N):
  sum = sum*int(input())
  if sum > INF:
    print(-1)
    import sys
    sys.exit()

print(sum)

### FIXED CODE ###

INF = 1000000000000000000
N = int(input())
flag = 1
l = list(map(int,input().split()))
if 0 in l:
  print(0)
  import sys
  sys.exit()
sum = 1
for i in l:
  sum = sum*i
  if sum > INF:
    print(-1)
    flag = 0
    break
  else:
    pass
    
if flag:
  print(sum)
#Big Array
N, K = map(int, input().split())
a = [0]*N
b = [0]*N
R = [0]*(10**5)
ans = 0
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(N):
    R[a[i]] = R[a[i]] + b[i]
j = 0
while K > 0:
    K = K - R[j]
    ans = ans + 1
    j = j + 1
print(ans-1)

### FIXED CODE ###

#Big Array
N, K = map(int, input().split())
a = [0]*(N)
b = [0]*(N)
R = [0]*(10**5+1)
ans = 0
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(N):
    R[a[i]] = R[a[i]] + b[i]
j = 0
while K > 0:
    K = K - R[j]
    ans = ans + 1
    j = j + 1
print(ans-1)
n,k=map(int,input().split())
w=input()
l=[]
c=0
w="1"+w
for i in range(1,1+n):
  if w[i]!=w[i-1]:
    l.append(c)
    c=1
  else:
    c+=1
l.append(c)
if w[-1]=="0":
  l.append(0)
s=l[0]
for i in range(1,1+k):
  s+=l[2*i]+l[2*i-1]
s1=s
c1=l[0]+l[1]
for i in range(1,(len(l)+1)/2):
  s1=s1-l[2*i-2]-l[2*i-1]+l[2*i-2+2*k+1]+l[2*i+2*k]
  if s1>s:
    s=s1
print(s)
  



### FIXED CODE ###

n,k=map(int,input().split())
l=input()
b=True
if l[0]=="1":
  b=True
else:
  b=False
l1=[]
c=1
l11=l[0]
for i in range(1,len(l)):
  if l[i]!=l[i-1]:
    l1.append(c)
    c=1
  else:
    c+=1
l1.append(c)
if b:
  if k>=len(l1)//2:
    print(n)
  else:
    l2=[]
    c1=0
    for i in range(0,(len(l1)//2)):
      c1+=l1[i*2+1]+l1[i*2]
      l2.append(c1)
    if len(l1)%2==1:
      c2=l2[k-1]+l1[2*k]
      for j in range(k,len(l2)):
        c3=l2[j]-l2[j-k]+l1[2*(j+1)]
        if c3>c2:
          c2=c3
      print(c2)
    else:
      c2=l2[k-1]+l1[2*k]
      for j in range(k,len(l2)-1):
        c3=l2[j]-l2[j-k]+l1[2*(j+1)]
        if c3>c2:
          c2=c3
      c3=l2[-1]-l2[-1-k]
      if c3>c2:
        c2=c3
      print(c2)
else:
  if k>=(len(l1)//2)+1:
    print(n)
  else:
    l2=[l1[0]]
    c1=l1[0]
    if len(l1)%2==1:
      for i in range(1,(len(l1)//2)+1):
        c1+=l1[2*i]+l1[2*i-1]
        l2.append(c1)
      c2=l2[k-1]+l1[2*k-1]
      for i in range(k,len(l2)-1):
        c3=l2[i]-l2[i-k]+l1[i*2+1]
        if c3>c2:
          c2=c3
      c3=l2[len(l2)-1]-l2[len(l2)-1-k]
      if c3>c2:
        c2=c3
      print(c2)
    else:
      for i in range(1,(len(l1)//2)):
        c1+=l1[2*i]+l1[2*i-1]
        l2.append(c1)
      c2=l2[k-1]+l1[2*k-1]
      for i in range(k,len(l2)):
        c3=l2[i]-l2[i-k]+l1[i*2+1]
        if c3>c2:
          c2=c3
      print(c2)
print((int(input())-1//2)

### FIXED CODE ###

print((int(input())-1)//2)
A,B,C=map(int,input().split())

S=set{A,B,C}

if len(S)==2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

S={A,B,C}

if len(S)==2:
    print('Yes')
else:
    print('No')
a=int(input())
b=int(input())

if a>9 or b>9:
    print(-1)
else:
    print(a*b)

### FIXED CODE ###

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

if a>9 or b>9:
    print(-1)
else:
    print(a*b)