Harryxun/stf_run huggingface dataset:
def main():
    N, S = open(0).read().split('\n')
    print(S.count('ABC'))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = input()
    S = input()
    print(S.count('ABC'))


if __name__ == '__main__':
    main()
import sys
 
args = sys.argv

print(args[0])
 
a = int(args[1])
b = int(args[2])
 
sum = a + b
minus = a - b
sub = a * b
 
if (sum - minus) > 0:
  print("足し算のが引き算より大きい")
  if (sum - sub) > 0:
    print("足し算のが掛け算より大きい")
    print(sum)
  else:
    print("掛け算のが足し算より大きい")
    print(sub)
else:
  print("引き算のが足し算より大きい")
  if (minus - sub) > 0:
    print("引き算のが掛け算より大きい")
    print(minus)
  else:
    print("掛け算のが引き算より大きい")
    print(sub)


### FIXED CODE ###

import sys

a, b = map(int, input().split())
 
sum = a + b
minus = a - b
sub = a * b
 
if (sum - minus) > 0:
  if (sum - sub) > 0:
    print(sum)
  else:
    print(sub)
else:
  if (minus - sub) > 0:
    print(minus)
  else:
    print(sub)
n=int(input())
x=list(map(int,input().split()))

digits=0
ans=1

for i in list:
  digits+=len(i)
  if digits >=18:
   print(-1)
  else:
    ans=ans*i

print(ans)

### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
ans=1
for i in x:
  if i==0:
    print(0)
    exit()

for i in x:
    ans=ans*i
    if ans>10**18:
      ans=-1
      break
print(ans)
# -*- coding: utf-8 -*-
p,q,r=map(int,input().split())
ptint(min(p+q,q+r,r+p))

### FIXED CODE ###

# -*- coding: utf-8 -*-
p,q,r=map(int,input().split())
print(min(p+q,q+r,r+p))
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
from collections import defaultdict
h, w = map(int, input().split())
table = [list(map(int, input().split())) for _ in range(10)]
dd = defaultdict(int)
for _ in range(h):
    for x in map(int, input().split()):
        if x == -1:
            continue
        dd[x] += 1

trans_table = list(zip(*table))
scores = shortest_path(csr_matrix(trans_table), indices=1)

ans = 0
for k, v in dd.items():
    ans += int(scores[k])*v
print(ans)

### FIXED CODE ###

from collections import defaultdict, deque
h, w = map(int, input().split())
table = [list(map(int, input().split())) for _ in range(10)]
dd = defaultdict(int)
for _ in range(h):
    for x in map(int, input().split()):
        if x == -1:
            continue
        dd[x] += 1

INF = 10**9
scores = [INF]*10
decided = [0]*10
queue = deque()
trans_table = list(zip(*table))
for i in range(10):
    x = trans_table[1][i]
    scores[i] = x

MIN = min(set(scores) ^ {0})

while 0 in decided:
    for idx, score in enumerate(scores):
        if score <= MIN:
            decided[idx] = 1

    for i in range(10):
        if i == 1:
            continue
        if decided[i]:
            for j in range(10):
                if not decided[j]:
                    queue.append((i, j))

    while queue:
        i, j = queue.popleft()
        x = trans_table[i][j]
        scores[j] = min(scores[j], scores[i]+x)

    MIN += 1



ans = 0
for k, v in dd.items():
    ans += scores[k]*v
print(ans)
N, K = map(int, input().split())
S = input()

res = 0
pre = None
add = {2: 0}
if S[0] == S[-1] and S[0] == "L":
    add[0] = 1

for s in S:
    if pre is None:
        pass
    elif pre == s:
        res += 1
    elif pre == "R":
        add[2] += 1
    pre = s

if add[2] > K:
    res += 2 * K
    print(res)
else:
    res += 2 * add[2]
    K -= add[2]
    if K > 0:
        res += add[1]
    print(res)





### FIXED CODE ###

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

res = 0
pre = None
add = {2: 0}
add[1] = 0 if S[0] == S[-1] else 1
for s in S:
    if pre is None:
        pass
    elif pre == s:
        res += 1
    elif pre == "R":
        add[2] += 1

    pre = s

if add[2] > K:
    res += 2 * K
    print(res)
else:
    res += 2 * add[2]
    K -= add[2]
    if add[1] == 1 and S[-1] == "L":
        res -= 2
    if K > 0:
        res += add[1]
    print(res)
import numpy as np

class Employee():
    def __init__(self,id,p,q):
        self.id = id
        self.total = p*q
    
    def add_total(self,total):
        self.total += total

class Manager():
    def __init__(self):
        self.employees = list()
        self.count = 0
    
    def add(self,e):
        if len(self.employees) == 0:
            self.employees.append(e)
        else:
            if self.employees[-1].id == e.id:
                self.employees[-1].add_total(e.total)
            else:
                self.employees.append(e)
            
    def pprint(self):
        for i,e in enumerate(self.employees):
            if e.total >= 1000000:
                print(e.id)
                self.count+=1
        if self.count == 0:
            print("NA")

def main():
    while(True):
        m = Manager()
        n = int(input())
        if n==0:
            break
        l = list()
        for i in range(n):
            s = list(map(int,input().split()))
            l.append(s)
        l = sorted(l)
        for x in l:
            m.add(Employee(*x))
        m.pprint()
    

if __name__=="__main__":
    main()

### FIXED CODE ###

while(True):
    n = int(input())
    if n==0: break
    d = {}
    c = 0
    l = list()
    for _ in range(n):
        id_,p,q = map(int,input().split())
        if id_ in d:
            d[id_] += p*q
        else:
            d[id_] = p*q
            l.append(id_)
    for i in l:
        if d[i] >= 1000000:
            print(i)
            c += 1
    if c == 0:
        print('NA')
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def calc(p, x, li, ans):
    ans[p] += x
    s = li[p]
    for b in s:
        #print(b)
        #print(ans)
        calc(b, x, li, ans)

n, q = na()
li = [[] for i in range(n+1)]
ans = [0 for i in range(n+1)]
for i in range(n-1):
    a, b = na()
    li[a].append(b)

for i in range(q):
    p, x = na()
    #print(p,x)
    calc(p, x, li, ans)
ans.pop(0)
print(*ans)







### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def dfs(v, par):
    for nv in g[v]:
        if nv == par:
            continue
        memo[nv] += memo[v]
        dfs(nv, v)

n, q = na()
g = [deque() for _ in range(n)]
for i in range(n-1):
    a, b = na()
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)
memo = [0] * n
for i in range(q):
    #seen = [False] * n
    p, x = na()
    p -= 1
    memo[p] += x

dfs(0, -1)
print(*memo)
n=int(input())
d={}
for i in range(n):
  a=sorted(input())
  if a in d.keys():
    d[a]+=1
  else:
    d[a]=1
l=list(d.values())
c=0
for i in l:
  c+=(i*(i-1))//2
print(c)
  

### FIXED CODE ###

from collections import Counter as co
n=int(input())
a=[str(sorted(input())) for _ in range(n)]
d=co(a)
l=d.values()
c=0
for i in l:
  c+=(i*(i-1))//2
print(c)
n=int(input()
p=list(map(int,input().split())

min=10000000000
ans=0
       
for i in p:
  if i <= min:
    ans+=1
    min=i
print(ans)

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))

min=10000000000
ans=0
       
for i in p:
  if i <= min:
    ans+=1
    min=i
print(ans)
s=input()
print('ABC' if s='ARC' else 'ARC')

### FIXED CODE ###

s=input()
print('ABC' if s=='ARC' else 'ARC')
n = int(input())
s=[]
alp = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
word = []
while n > 0:
    s.append(n % 26)
    n = n // 26
for index, m in enumerate(s):
    if m == 0:
        word.append[z]
    else:
        word.append(alp[m-1])
word.reverse()
L = "".join(word)
print(L)




### FIXED CODE ###

from collections import deque
n = int(input())
st  = deque()
while n > 0:
    num = (n - 1) % 26
    n = (n - 1) // 26
    st.appendleft(chr(num + 97))
print(*st, sep = "")
import sys


def dfs(v, parent, depth):
    parents[v] = parent
    self_depths[v] = depth
    sd = 0
    for u in links[v]:
        if u == parent:
            continue
        res = dfs(u, v, depth + 1)
        sd = max(sd, res + 1)

    subtree_depths[v] = sd
    return sd


def solve(u, v):
    ans = 0
    while u != v:
        ans = max(ans, self_depths[u] + subtree_depths[u] - 1)
        u = parents[u]
    return ans


n, u, v = map(int, input().split())
u -= 1
v -= 1
links = [set() for _ in range(n)]
for line in sys.stdin:
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    links[a].add(b)
    links[b].add(a)

parents = [-1] * n
self_depths = [0] * n
subtree_depths = [0] * n
dfs(v, -1, 0)
# print(parents)
# print(self_depths)
# print(subtree_depths)
print(solve(u, v))


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 5)


def dfs(v, parent, depth):
    parents[v] = parent
    self_depths[v] = depth
    sd = 0
    for u in links[v]:
        if u == parent:
            continue
        res = dfs(u, v, depth + 1)
        sd = max(sd, res + 1)

    subtree_depths[v] = sd
    return sd


def solve(u):
    ans = 0
    catch = self_depths[u] // 2
    while self_depths[u] > catch:
        ans = max(ans, self_depths[u] + subtree_depths[u] - 1)
        u = parents[u]
    return ans


n, u, v = map(int, input().split())
u -= 1
v -= 1
links = [set() for _ in range(n)]
for line in sys.stdin:
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    links[a].add(b)
    links[b].add(a)

parents = [-1] * n
self_depths = [0] * n
subtree_depths = [0] * n
dfs(v, -1, 0)
# print(parents)
# print(self_depths)
# print(subtree_depths)
print(solve(u))
def main():
    import math

    H = int(input())
    if H == 1:
        print(1)
    else:
        count = int(math.log(H, 2))
        ans = 0
        for i in range(count+1):
            ans += 2 ** (i)
            print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###


def main():
    H, A = map(int, input().split())
    count = 0
    while True:
        H -= A
        count += 1
        if H <= 0:
            break

    print(count)





if __name__ == "__main__":
    main()
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]

bc.sort(key = lambda x:x[1], reverse = True)

a.sort()

a_count = 0
for b, c in bc:
        if c > a[a_count]:
                for i in range(b):
                        if c > a[a_count]:
                                a[a_count] = c
                                a_count += 1
                        else:
                                break

        else:
                break

        if a_count == n:
                break        

print(sum(a))

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]

bc.sort(key = lambda x:x[1], reverse = True)

a.sort()

a_count = 0
for b, c in bc:
        if c > a[a_count]:
                for i in range(b):
                        if c > a[a_count]:
                                a[a_count] = c
                                a_count += 1    
                        else:
                                break
                        if a_count == n:
                                        break

        else:
                break
        if a_count == n:
                break        

print(sum(a))
import sys
# row = sys.stdin.readline
row = open('input.txt', 'r').readline
def read_string(row):
    return row().rstrip()
  
inp = read_string(row)
print(chr(ord(inp) + 1))

### FIXED CODE ###

import sys

row = sys.stdin.readline
# row = open('input.txt', 'r').readline
def read_string(row):
    return row().rstrip()
  
inp = read_string(row)
print(chr(ord(inp) + 1))
n=int(input())
a = [int(i) for i in input().split()] 
A=0
B=0
for i in range(n):
  if i%2==0:
    A += max(a)
    del a(a.index(max(a))
  else :
    B += max(a)
    del a(a.index(max(a))      
          
print(A-B)          

### FIXED CODE ###

n=int(input())
a = [int(i) for i in input().split()] 
A=0
B=0
C=0
k=0
for i in range(n):
  if i%2==0:
    k=max(a)
    A += k
    del a[a.index(k)]
  else :
    k=max(a)      
    B += k
    del a[a.index(k)]   
  
C=A-B          
print(C)
if B * 2 >= A:
  print 0
else:
  print A-B*2

### FIXED CODE ###

ABInput = str(input())
 
AB = ABInput.split(" ")
 
A = int(AB[0])
B = int(AB[1])
 
TotalCartain = B * 2
 
if TotalCartain > A or TotalCartain == A:
  print (0)
else:
  print (A-TotalCartain)
A = int(input())
B = int(input())
C = int(input())

C = C - (A - B)
if C < 0:
    C = 0
print(C)

### FIXED CODE ###

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

C = C - (A - B)
if C < 0:
    C = 0
print(C)
n=input()
a=[]

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

b=[0]*100000
c=0
while c <= n-2:
    b[a[c]]+=1
    c+=2

d=[0]*100000
e=1
while e <= n-1:
    d[a[e]]+=1
    e+=2

f=sorted(b)[-2]
g=sorted(d)[-2]



if max(b) == n/2 and max(d) == n/2 and b.index(max(b)) == d.index(max(d)):
    print(n/2)
elif max(b) == n/2 and max(d) == n/2 and b.index(max(b)) != d.index(max(d)):
    print(0)
elif b.index(max(b)) == d.index(max(d)):
    print(n-max(b)-max(f,g))
else:
    print(n-max(b)-max(d))
~                              

### FIXED CODE ###

n=input()
a=[]

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

b=[0]*100001
c=0
while c <= n-2:
    b[a[c]]+=1
    c+=2

d=[0]*100001
e=1
while e <= n-1:
    d[a[e]]+=1
    e+=2

f=sorted(b)[-2]
g=sorted(d)[-2]



if max(b) == n/2 and max(d) == n/2 and b.index(max(b)) == d.index(max(d)):
    print(n/2)
elif max(b) == n/2 and max(d) == n/2 and b.index(max(b)) != d.index(max(d)):
    print(0)
elif b.index(max(b)) == d.index(max(d)):
    print(n-max(b)-max(f,g))
else:
    print(n-max(b)-max(d))
a, b, n = map(int, input().split())


def function(x, a=a, b=b):
    return int(a * x / b) - a * int(x / b)


ans = function(0)
for i in (n):
    if i * b - 1 > n:
        ans = max(ans, function(n))
        break
    ans = max(ans, function(i * b - 1))

print(ans)

### FIXED CODE ###

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


def function(x, a=a, b=b):
    return int(a * x / b) - a * int(x / b)
    

ans = function(0)
for i in range(b):
    if i * b - 1 > n:
        ans = max(ans, function(n))
        break
    ans = max(ans, function(i * b - 1))

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

if False:
    n = 4
    a = 1
    b = 2
    k = 5

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)
    
def mod_inv(a, mod):
    return (pow(a,mod-2,mod))

def mod_combination(n, k, mod):
    return fact[n]*mod_inv(fact[k], mod)*mod_inv(fact[n-k], mod) % mod

g = gcd(k, gcd(a, b))
a //= g
b //= g
k //= g

mod = 998244353
fact = [1] + [0] * n
for i in range(n):
    fact[i+1] = (fact[i] * (i+1)) % mod
# print(fact)
if a < b:
    tmp = a
    a = b
    b = tmp

ans = 0
# print("n, a, b =", n, a, b)
# print((k-b*n)//a, k//a+1)
for x in range(max(-int(-(k-b*n)//a),0), k//a+1):
    if (k-x*a) % b == 0:
        y = (k-x*a)//b
        
        # print("n, x, y, mod", n, x, y, mod)
        # print(mod_combination(n, x, mod))
        # print(mod_combination(n, y, mod))
        
        ans += mod_combination(n, x, mod) * mod_combination(n, y, mod)
        ans %= mod
    
print(ans)

### FIXED CODE ###

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

mod = 998244353
fact = [1] + [0] * n
inv_fact = [0] * (n+1)
for i in range(n):
    fact[i+1] = (fact[i] * (i+1)) % mod

for i in range(n+1):
    inv_fact[i] = pow(fact[i],mod-2,mod)
    
def cb(n, k, mod):
    return (fact[n] * inv_fact[k] * inv_fact[n-k]) % mod

ans = 0
for x in range(n+1):
    if (k-x*a) % b == 0:
        y = (k-x*a)//b
        if y >= 0:
            if x > n or y > n:
                pass
            else:
                ans += cb(n, x, mod) * cb(n, y, mod)
                ans %= mod
    
print(ans)
N, K = map(int, input().split())
friends = map(int, input().split())


n = len([1 for x in friends if x>=K])

print(n)

### FIXED CODE ###

from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input())

if N%2==0:
    odd_count = N//2
else:
    odd_count = N//2+1
print('{:.10f}'.format(odd_count/N))
n = int(input())
s = input()
l = []
for i in range(1,len(s)-1):
    a = set(list(s[:i]))
    b = set(list(s[i:]))
    l.append(len(a & b))
print(max(l))

### FIXED CODE ###

n = int(input())
s = input()
l = []
if n==2:
    if s[0]==s[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(1,len(s)-1):
        a = set(list(s[:i]))
        b = set(list(s[i:]))
        l.append(len(a & b))
    print(max(l))
list = list(map(int, input().split()))

time = list[0] / list [2]

if time <= list[1]:
  print("Yes")
 else:
  print("No)

### FIXED CODE ###


def resolve():
    num = list(map(int, input().split()))
    time = num[0] / num[2]
    if time <= num[1]:
        print("Yes")
    else:
        print("No")
resolve()
import sys

S = input()

# S = 'akasaka'

N = len(S)

S_rev = S[::-1]
if S != S_rev:
    print('No')
    sys.exit(1)

sub_S = S[:int((N - 1)/2)+1]
sub_S_rev = S[int((N + 3)/2)-1:]
if sub_S != sub_S_rev:
    print('No')
    sys.exit(1)

print('Yes')

### FIXED CODE ###

import sys

S = input()

# S = 'akasaka'

N = len(S)

S_rev = S[::-1]
if S != S_rev:
    print('No')
    sys.exit(0)

sub_S = S[:int((N - 1)/2)]
sub_S_rev = S[int((N + 3)/2)-1:]
if sub_S != sub_S_rev:
    print('No')
    sys.exit(0)

print('Yes')
import sys
import os
from operator import itemgetter


N,M= map(int, input().split())
A= list(map(int,input().split()))
B=[0]*M
C=[0]*M
for i in range(M):
    B[i], C[i] = map(int, input().split())
A.sort()
#print(A)

D=[list(x) for x in zip(*sorted(zip(C, B), key=itemgetter(0),reverse=True))]
B=D[1]
C=D[0]
k=0
#print(B)
#print(C)
for i in range(M):#C(i) i=1..M
    for j in range(B[i]):#B(i)の個数分C(i)を入れる j=0...Bi
        if A[k]>=C[i]:
            break
        else:
            A[k]=C[i]
            k=k+1
            continue
        break


Asum=sum(A)
#print(A)
print(Asum)

### FIXED CODE ###

import sys
import os
from operator import itemgetter


N,M= map(int, input().split())
A= list(map(int,input().split()))
B=[0]*M
C=[0]*M
for i in range(M):
    B[i], C[i] = map(int, input().split())
A.sort()
#print(A)

D=[list(x) for x in zip(*sorted(zip(C, B), key=itemgetter(0),reverse=True))]
B=D[1]
C=D[0]
k=0
#print(B)
#print(C)
for i in range(M):#C(i) i=1..M
    for j in range(B[i]):#B(i)の個数分C(i)を入れる j=0...Bi
        if k>N-1:
            break
        if A[k]>=C[i]:
            break
        else:
            A[k]=C[i]
            k=k+1
            continue
        break


Asum=sum(A)
#print(A)
print(Asum)
n=int(input())
a=list(map(int,input().split()))

ans=1
for i in a:
  ans=ans*i
  if str(ans)>18:
    ans=-1
    break
    
print(ans)

### FIXED CODE ###

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

ans=1
for i in a:
  ans=ans*i
  if ans>(10**18):
    ans=-1
    break
    
print(ans)
a,b,n = map(int,input().split())
print(min([n*a,b])

### FIXED CODE ###

n,a,b = map(int,input().split())
print(min([n*a,b]))
S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T)):
    diff = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            diff += 1
print(min(ans, diff))

### FIXED CODE ###

S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            diff += 1
    ans = min(ans, diff)
    
print(ans)
a = int(input("整数を入力してください"))
b = int(input("整数を入力してください"))
c = a*b
if c % 2 ==0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a,b = map(int,input().split())
c = a*b
if c % 2 ==0:
  print("Even")
else:
  print("Odd")
n,m=map(int,input().split())
if n>m:
  print(n+n-1)
elif n<b:
  print(m+m-1)
else:
  print(n+m)

### FIXED CODE ###

a,b=map(int,input().split())
if a>b:
  print(a+a-1)
elif a<b:
  print(b+b-1)
else:
  print(a+b)
a = input()
b = input()
c = input()
s = set([a, b, c]]
print len(s)

### FIXED CODE ###

a,b,c = map(int, raw_input().split())
s = set([a, b, c])
print len(s)
import math
import numpy as np
N,K=map(int,input().split())
a=[0]*N
a=list(map(int,input().split()))
A=np.array(a)
b=np.zeros(N)
for i in range(K):
    b=np.zeros(N)
    for j in range(N):

        minmin=max(0,math.ceil(j-A[j]-0.5))

        maxmax=min(N,math.floor(j+A[j]+0.5)+1)

        if(minmin==maxmax):
            maxmax=maxmax+1
            if(N<=maxmax):
                minmin=N-1
                maxmax=N

        for k in range(minmin,maxmax):
            b[k]=b[k]+1

    A=b
A=A.astype(np.int)
da=list(A)
L=[str(a) for a in da]

da=" ".join(L)
print(da)


### FIXED CODE ###

import math
N,K=map(int,input().split())
A=[0]*N
A=list(map(int,input().split()))

da=[0 for i in range(N)]
for k in range(K):
    B=[0 for i in range(N)]
    for i in range(N):
        l=max(0,i-A[i])
        r=min(N-1,i+A[i])
        B[l]=B[l]+1
        if(r+1<N):
            B[r+1]=B[r+1]-1
    for i in range(1,N):
        B[i]=min(N,B[i]+B[i-1])
    if(A==B):
        break
    A=B
b=[str(i) for i in B]
b=" ".join(b)
print(b)
import math
n,k = map(int,input().split())
print(int(math.ceil(1/math.log(k,n))))

### FIXED CODE ###

n,k = map(int,input().split())
count = 1
while(n >= k):
    count += 1
    n /= k
print(count)
O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")
----


### FIXED CODE ###

O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")
import math
 
R = int(input())
 
print(2*math.pi*R)

### FIXED CODE ###

nm = input().split(' ')

N, M = int(nm[0]), int(nm[1])

A = input().split()

A_sum = 0

for i in A:
    A_sum += int(i)

if A_sum - N <= 0:
    print( N - A_sum )
else:
    print(-1)
N = int(input())
A = list(map(int, input().split()))

from math import gcd # Python versions 3.5 and above
from functools import reduce # Python version 3.x


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

# def lcm(denominators):
#     return reduce(lambda a,b: a*b // gcd(a,b), denominators)

res = reduce(lcm, A, 1)
# res = lcm(A)
print(sum(res // A[i] for i in range(N)) % (10 ** 9 + 7))

### FIXED CODE ###


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

# from math import gcd # Python versions 3.5 and above
from functools import reduce # Python version 3.x


def computeGCD(x, y):
    while (y):
        x, y = y, x % y
    
    return x

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

# def lcm(denominators):
#     return reduce(lambda a,b: a*b // gcd(a,b), denominators)

res = reduce(lcm, A, 1)
# res = lcm(A)
print(sum(res // A[i] for i in range(N)) % (10 ** 9 + 7))
N = int(input())
ans = 0
for i in range(1, N):
    ans += (N-1) // i

print(ans)
N = int(input())
ans = 0
for i in range(1, N):
    ans += (N-1) // i

print(ans)


### FIXED CODE ###

N = int(input())
ans = 0
for i in range(1, N):
    if N % i == 0:
        ans += (N // i) - 1
    else:
        ans += N // i

print(ans)
S, T = input().split()
print("Yes" if "S" == "T[:-2]" else "No")

### FIXED CODE ###

S = input()
T = input()
print("Yes" if S == T[:-1] else "No")
n,m=map(int, input().split()) 
a=list(map(int, input().split()))
s=[list(map(int, input().split())) for i in range(m)]
ans=sum(a)
cnt=0
a.sort()
s=sorted(s, key=lambda x :x[1])
s.reverse()

for i in range(m):
    
        
        for j in range(cnt,s[i][0]+cnt):
            if s[i][1]>a[j]:
                ans+=s[i][1]-a[j]
                cnt+=1
            else:
                break
                
print(ans)

### FIXED CODE ###

n,m=map(int, input().split()) 
a=list(map(int, input().split()))
s=[list(map(int, input().split())) for i in range(m)]

ans=sum(a)
cnt=0

a.sort()
s=sorted(s, key=lambda x :x[1])
s.reverse()

for i in range(m):
    
        
        for j in range(cnt,s[i][0]+cnt):
            if s[i][1]>a[j]:
                ans+=s[i][1]-a[j]
                cnt+=1
                if j==n-1:
                    print(ans)
                    exit()
            else:
                break
                
print(ans)