Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
    s[i], c[i] = map(int, input().split())
    
A = []
x = 0

for i in range(M):
  if s[i] == 1 and c[i] == 0:
    x = 1
  for j in range(i+1,M):
    if s[i] == s[j] and c[i] != c[j]:
      x = 2
      
import numpy as np
import math
from functools import reduce
B = np.zeros(N)
B[0] = 1

if max(s) == 1 and max(c) == 0:
  print(0)

elif x == 1 or x == 2:
  print("-1")
  
else:
  for i in range(M):
    B[s[i]-1] = c[i]
  ans = reduce( lambda a,b:10*a+b, B)
  print(math.floor(ans))

### FIXED CODE ###

N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
    s[i], c[i] = map(int, input().split())
    
A = []
x = 0

for i in range(M):
  if s[i] == 1 and c[i] == 0:
    x = 1
  for j in range(i+1,M):
    if s[i] == s[j] and c[i] != c[j]:
      x = 2
      
import numpy as np
import math
from functools import reduce
B = np.zeros(N)
B[0] = 1

if M == 0:
  if N == 1:
    print(0)
  else:
    ans = reduce( lambda a,b:10*a+b, B)
    print(math.floor(ans))

elif N == 1 and max(s) == 1 and max(c) == 0:
  print(0)

elif x == 1 or x == 2:
  print("-1")
  
else:
  for i in range(M):
    B[s[i]-1] = c[i]
  ans = reduce( lambda a,b:10*a+b, B)
  print(math.floor(ans))
import numpy as np
a = []
for i in range(4):
    a.append(np.zeros((3,10), dtype = int))
border = '#'*20
n = int(input())
for i in range(n):
    b,f,r,v = map(int,input().split())
    a[b-1][f-1][r-1] += v
    
for i in range(4):
    for k in a[i]:
        c = 0
        for l in k:
            c += 1
            if c !=10:
                print('{} '.format(l), end ='')
            elif c == 10:
                print('{}'.format(l), end ='')
        print()
    if i != 3:
        print(border)


### FIXED CODE ###

a = [[[0 for i in range(10)]for i in range(3)]for i in range(4)]
border = '#'*20
n = int(input())
for i in range(n):
    b,f,r,v = map(int,input().split())
    a[b-1][f-1][r-1] += v
    
for i in range(4):
    for k in a[i]:
        for l in k:
                print(' {}'.format(l), end ='')
        print()
    if i != 3:
        print(border)
from collections import Counter

n = int(input())
v = [int(i) for i in input().split()]

ki = v[::2]
gu = v[1::2]

ki = Counter(ki)
gu = Counter(gu)

ki = ki.most_common()
gu = ki.most_common()

if ki[0][0] == gu[0][0] :
    if(len(ki) == len(gu)) :
        print(n/2)
    else :
        if(ki[1][1] > gu[1][1]) :
            print(n-ki[1][1]-gu[0][1])
        else :
            print(n-ki[0][1]- gu[1][1])

else :
    print(n-ki[0][1]-gu[0][1])

### FIXED CODE ###

from collections import Counter

n = int(input())
v = [int(i) for i in input().split()]

ki = v[::2]
gu = v[1::2]

ki = Counter(ki)
gu = Counter(gu)

ki = ki.most_common()
gu = gu.most_common()

if ki[0][0] == gu[0][0] :
    if len(ki) == 1 and len(gu) == 1 :
        print(int(n/2))
    else :
        if ki[1][1] > gu[1][1] :
            print(n-ki[1][1]-gu[0][1])
        else :
            print(n-ki[0][1]- gu[1][1])

else :
    print(n-ki[0][1]-gu[0][1])
N, M = map(int, input().split())
a = int(input())
P = [0]*(N+1)
P[0] = 1
if a == 1:
  P[1] = 0
  try:
    a = int(input())
  except EOFError:
    pass
    
else:
  P[1] = 1

for i in range(2,N+1):
  if i == a:
    P[i] = 0
    try:
      a = int(input())
    except EOFError:
      continue
  else:
    P[i] = P[i-1] + P[i-2]
print(P[-1]%1000000007)

### FIXED CODE ###

N, M = map(int, input().split())
try:
  a = int(input())
except EOFError:
  a = 0
P = [0]*(N+1)
P[0] = 1
if a == 1:
  P[1] = 0
  try:
    a = int(input())
  except EOFError:
    pass
    
else:
  P[1] = 1

for i in range(2,N+1):
  if i == a:
    P[i] = 0
    try:
      a = int(input())
    except EOFError:
      continue
  else:
    P[i] = P[i-1] + P[i-2]
print(P[-1]%1000000007)
n = input()
digit = n % 10
if digit == 3:
  print('bon')
elif digit == 0 or digit == 1 or digit == 6 or digit == 8:
  print('pon')
else:
  print('hon')


### FIXED CODE ###

ninput = input() #これはstr型
n = int(ninput) #これでint型に直す
digit = n % 10
if digit == 3:
  print('bon')
elif digit == 0 or digit == 1 or digit == 6 or digit == 8:
  print('pon')
else:
  print('hon')
import numpy as np
N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[i] = A.index(i+1)
np.add(ls+1)
print(*ls)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[A[i]-1] = i+1
print(*ls)
a = int(input())
b = int(input())
 
if (a * b) % 2 == 0:
	print("Even")
else:
	print("Odd")

### FIXED CODE ###

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

if (a * b) % 2 == 0:
	print("Even")
else:
	print("Odd")
a, b = map(int(), input())
x = 0
for i in range(b - a):
    x += x + i
    print(x - a)

### FIXED CODE ###

a, b = map(int, input().split())
c = int(b - a)
d =int( c * (c - 1) // 2 + c  -b)
print(d)
n, m = map(int, input().split())
l, r = list(map(int, [input().split() for i in range(m)]))

max_l = max(l)
min_r = min(r)
print(max(min_r - max_l, 0))
    

### FIXED CODE ###

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

if a >= 13:
  print(b)
elif 6 <= a <= 12:
  print(int(b/2))
else:
  print(0)
#!/usr/bin/env python

def func():
    n,m = [int(i) for i in input().split(" ")]
    pibot = 10**(m-1)
    dic = {}

    for i in range(m):
        tmp = [int(i) for i in input().split(" ")]

        if tmp[0] not in dic.keys():
            dic[tmp[0]] = tmp[1]
        else:
            if dic[tmp[0]] != tmp[1]:
                print("-1")
                return

    a = [0] * m
    for key in dic.keys():
        print(key)
        a[key-1] = dic[key]

    tmp_s = ""
    for i in a:
        tmp_s += str(i)

    if int(tmp_s) < pibot:
        print("-1")
        return
    else:
        print(tmp_s)

    print("")

if __name__ == "__main__":
    func()

### FIXED CODE ###

#!/usr/bin/env python

n, m = input().split(" ")
n = int(n)
m = int(m)
s_len = []
c_len = []
dig = 10**(n-1)

for i in range(m):
    tmp = input().split(" ")
    s_len.append(int(tmp[0]))
    c_len.append(int(tmp[1]))

for i in range(0, dig*10):
    flag = False
    if len(str(i)) < n:
        continue
    for j,s in enumerate(s_len):
        if str(i)[s-1] != str(c_len[j]) and flag == False:
            flag = True
            break
    if flag==False:
        print(i)
        exit()

print("-1")
from itertools import combinations
while 1:
 n,s=map(int,input().split())
 if n:print(sum(1 for p in combinations(range(10),n)if sum(p)==s))


### FIXED CODE ###

import itertools
for e in iter(input,'0 0'):
 n,s=map(int,e.split())
 print(sum(s==sum(p)for p in itertools.combinations(range(10),n)))
import sys

H,W = map(int,input().split())    
A = [0]*H
for i in range(H):
  A[i] = input()

def L1(x1,y1,x2,y2):
  return abs(x1-x2)+abs(y1-y2)

b_ij = []
for i in range(H):
  for j in range(W):
    if A[i][j] == '#':
      b_ij.append({'x': i, 'y': j})
l = len(b_ij)
m_list = []
for i in range(H):
  for j in range(W):
    if A[i][j] == '.':
      m = sys.maxsize
      for k in range(l):
        m = min(m,L1(b_ij[k].get('x'),b_ij[k].get('y'),i,j))
      m_list.append(m)
print(max(m_list))

### FIXED CODE ###

from collections import deque

H,W = map(int,input().split()) 
A = [[0]*W for _ in range(H)]
M = 0
queue = deque()
for i in range(H):
  s = input()
  for j in range(W):
    if s[j]== '#':
      queue.append([i,j,0])
      A[i][j] = '#'
while queue:
  i,j,cost = queue.popleft()
  M=max(M,cost)
  if i+1 < H and A[i+1][j] != '#':
    queue.append([i+1,j,cost+1])
    A[i+1][j] = '#'
  if i-1 >= 0 and A[i-1][j] != '#':
    queue.append([i-1,j,cost+1])
    A[i-1][j] = '#'
  if j+1 < W and A[i][j+1] != '#':
    queue.append([i,j+1,cost+1])
    A[i][j+1] = '#'
  if j-1 >= 0 and A[i][j-1] != '#':
    queue.append([i,j-1,cost+1])
    A[i][j-1] = '#'
print(M)
from math import factorial
 
N, M = map(int, input().split())
if N != 0 and M != 0 and N != 1 and M != 1:
  if N==1 and M==1:
    print(0)
  else:
    Ncon = factorial(N) // factorial(2) // factorial(N - 2)
    Mcon = factorial(M) // factorial(2) // factorial(M - 2)
    print(Ncon+Mcon)
if N ==0 or N == 1:
  print(factorial(M) // factorial(2) // factorial(M - 2))
if M == 0 or M==1:
  print(factorial(N) // factorial(2) // factorial(N - 2))
if N==1 and M==1:
  print(0)

### FIXED CODE ###

from math import factorial
 
N, M = map(int, input().split())
if N != 0 and M != 0 and N != 1 and M != 1:
  Ncon = factorial(N) // factorial(2) // factorial(N - 2)
  Mcon = factorial(M) // factorial(2) // factorial(M - 2)
  print(Ncon+Mcon)
if N ==0 or N == 1:
  if M!=1:
    print(factorial(M) // factorial(2) // factorial(M - 2))
if M == 0 or M==1:
  if N!=1:
    print(factorial(N) // factorial(2) // factorial(N - 2))
if N==1 and M==1:
  print(0)
N,K = map(int,input().split())
ans1 = N - K
ans2 = abs(ans1 - K)
print(min(ans1,ans2)

### FIXED CODE ###

N,K = map(int,input().split())
ans1 = N % K
ans2 = abs(ans1-K)
print(min(ans1,ans2))
import sys
a= str(input())
kaibun = list(a)
n = int(len(kaibun))
answer = "No"
strongn1 = int((n-1)/2)
strongn2 = int((n+3)/2)
for i in reversed(range((int((n+1)/2)),n)):
    if kaibun[i] == kaibun[n-i-1]:
        answer = "Yes"
    else:
        answer = "No"
        print(answer)
        sys.exit()
for i in range(int(strongn1/2)):
    if kaibun[i] == kaibun[strongn1-i]:
        answer = "Yes"
    else:
    	answer="No"
    	print(answer)
    	sys.exit()
for i in reversed(range(strongn2,n,int(strongn1/2))):
    if kaibun[i] == kaibun[i-strongn2]:
        answer = "Yes"
    else:
      	answer = "No"
print(answer)

### FIXED CODE ###

a= str(input())
kaibun = list(a)
n = int(len(kaibun))
answer = "No"
strongn1 = int((n-1)/2)
strongn2 = int((n+3)/2)
for i in reversed(range((int((n+1)/2)),n)):
    if kaibun[i] == kaibun[n-i-1]:
        answer = "Yes"
    else:
        answer = "No"
        break

if answer == "Yes":
    for i in range(int(strongn1/2)):

        if kaibun[i] == kaibun[strongn1-i-1]:
            answer = "Yes"
        else:
            answer="No"
            break
if answer == "Yes":
    for i in reversed(range(strongn2+int(strongn1/2)-1,n)):
        if kaibun[i] == kaibun[strongn2-2-i+n]:
            answer = "Yes"
        else:
            answer = "No"
            break
print(answer)
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    count = 0
    Ai = -1
    Ci = -1
    for i in range(N):
        if Ai<N-1:
            while A[Ai+1]<B[i]:
                Ai += 1
                if Ai == N-1:
                    break
        if Ci<N:
            while C[Ci+1]<=B[i]:
                Ci += 1
                if Ci==N-1:
                    break
        count += (Ai+1) * (N-(Ci+1))

    return count

if __name__ == '__main__':
    print(main())


### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    count = 0
    Ai = -1
    Ci = -1
    for i in range(N):
        if Ai<N-1:
            while A[Ai+1]<B[i]:
                Ai += 1
                if Ai == N-1:
                    break
        if Ci<N-1:
            while C[Ci+1]<=B[i]:
                Ci += 1
                if Ci==N-1:
                    break
        count += (Ai+1) * (N-(Ci+1))

    return count

if __name__ == '__main__':
    print(main())
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n = II()
    s = S()
    t = S()
    for i in range(n):
        if s[i:] == t[: n - i]:
            print(n + i)
            return
    primt(2 * n)
    return


#main
if __name__ == '__main__':
    solve()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n = II()
    s = S()
    t = S()
    for i in range(n):
        if s[i:] == t[: n - i]:
            print(n + i)
            return
    print(2 * n)
    return


#main
if __name__ == '__main__':
    solve()
n,m,r = map(int, input().split())
dn = [[0] * m for _ in range(n)]

for i in range(n):
  dn[i][:] = map(int, input().split())

  dn = np.array(dn)
  cost = []
  sh = 0
  inf = 10e8
  cost = inf
  k = np.zeros(m+1)

  def secom(j,k,cost):
    if j == n:

      if np.all(k>=r):
        print(k)
        cost = min(cost,k[0])
        return cost
      else:
        return cost

      cost1 = secom(j+1,k,cost)
      k += dn[j]
      cost2 = secom(j+1,k,cost)
      k -= dn[j]

      return min(cost1,cost2)


    cost = secom(0,k,cost)
    if cost == inf:
      print(-1)
      else:
        print(int(cost))


### FIXED CODE ###

prev = input()
prev_l = list(prev)

now = input()
now_l = list(now)
n = len(now_l)

if now_l[:n-1] == prev_l:
    print("Yes")
else:
    print("No")
# cook your dish here
s=input()
m=s.split()
n=int(s[0]);
l=int(s[2]);
list=[]
for i in range(n):
    st=input()
    list.append(st)
list.sort()
for i in list:
    print(i,end="")



### FIXED CODE ###

a,b=map(int,input().split())
S=[input() for i in range(a)]
S.sort()
print("".join(S))
r=0
if n < k:
    for i in range(1, n+1):
        r=r+(1/n)*0.5**math.ceil(math.log2(k/i))
    print(r)
else:
    r=1-(k/n)
    for i in range(1, k+1):
        r=r+(1/n)*0.5**math.ceil(math.log2(k/i))
    print(r)

### FIXED CODE ###

import math
n, k = map(int, input().split())
r=0
if n < k:
    for i in range(1, n+1):
        r=r+(1/n)*0.5**math.ceil(math.log2(k/i))
    print(r)
else:
    r=1-(k/n)
    for i in range(1, k+1):
        r=r+(1/n)*0.5**math.ceil(math.log2(k/i))
    print(r)
s=input()
for i in range(ord("a"),ord("z")+1):
  if chr(i) in s:
    print(chr(i))
    break
else:
  print("None)

### FIXED CODE ###

s=input()
for i in range(ord("a"),ord("z")+1):
  if chr(i) not in s:
    print(chr(i))
    break
else:
  print("None")
n = int(input())
a = []
hist = []
for i in range(N):
    a.append(int(input()))
pos = 1
count = 0
while True:
    if pos == 2:
        print(count)
        break
    if pos in hist:
        print(-1)
        break
    hist.append(pos)
    pos = a[pos-1]
    count += 1

### FIXED CODE ###

N = int(input())
a = [int(input()) for i in range(N)]
ans = 0
turn = 1
while True:
    if a[turn-1] == 2:
        ans += 1
        break
    if a[turn-1] == 0:
        ans = -1
        break
    next_turn = a[turn-1]
    a[turn-1] = 0
    ans += 1
    turn = next_turn

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

li_a = [1] * a
li_b = [0] * b
li_c = [-1] * c

li_a.extend(li_b)
li_a.extend(li_c)
li_k = li_a.copy()

print(sum(li_k[:k]))

### FIXED CODE ###

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

cnt_a = 0
cnt_b = 0
cnt_c = 0

if (a > 0) & (a > k):
    cnt_a = k
    k = 0
else:
    cnt_a = a
    k = k - cnt_a

if (b > 0) & (b > k):
    cnt_b = k
    k = 0
else:
    cnt_b = b
    k = k - cnt_b

if c > 0:
    cnt_c = k

result = cnt_a * 1 + cnt_b * 0 + cnt_c * (-1)
print(result)
n,k = (int(i) for i in input().split())
x = [[int(i) for i in input().split()] for i in range(n)]
x.sort()
num = 0
for i in x:
	num += i[1]
	if num>=k:
		print(i[0])
		break

### FIXED CODE ###

a,b,c = (int(i) for i in input().split())
if a<=c and c<=b: print("Yes")
else: print("No")
K = int(input())
a,b = map(int,input().split())
for i in range(a,b+1)
if i%K == 0
  print('OK')
else:
  print('No')


### FIXED CODE ###

K = int(input())
a,b = map(int,input().split())
c = 'NG'
for i in range(a,b+1):
  if i % K == 0:
    c = 'OK'
    break
print(c)
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
h = [int(x) for _ in input().split()]
init = 10**9
dp = [init] * N
dp[0] = 0

for i in range(1, N):
    if i - K < 0:
        dp[i] = min(dpk + abs(h[i]-hk) for dpk, hk in zip(dp[:i], h[:i]))
    else:
        dp[i] = min(dpk + abs(h[i]-hk) for dpk, hk in zip(dp[i-K:i], h[i-K:i]))

print(dp[-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
h = [int(x) for x in input().split()]
dp = [0] * N

for i, hi in enumerate(h):
    if i == 0:
        continue
    if i - K < 0:
        dp[i] = min(dpk + abs(hi-hk) for dpk, hk in zip(dp[:i], h[:i]))
    else:
        dp[i] = min(dpk + abs(hi-hk) for dpk, hk in zip(dp[i-K:i], h[i-K:i]))

print(dp[-1])
w, h, x, y = map(int, input().split())

s = w * h / 2
if (int(w / x) == 2) and (int(h / y) == 2):
    print(s, 1)
else:
    print(s, 0)

### FIXED CODE ###

w, h, x, y = map(int, input().split())

s = w * h / 2
if (x * 2 == w) and (y * 2 == h):
    print(s, 1)
else:
    print(s, 0)
A, B, C, K = map(int, input().split())

nokori = K - A - B

wa = 0
wa += A

if nokori == 0:
    a    
elif C >= nokori:
    wa -= nokori
else:
    wa -= C

print(wa)

### FIXED CODE ###

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

nokori = K - A - B

wa = 0
while True:
    if A >= K:
        wa += K
        break
    else:
        wa += A
    if C >= nokori:
        wa -= nokori
        break
    else:
        wa -= C
        break

print(wa)
import math
a,b=map(int,input().split())
print((a*b)//math.gcd(a,b))

### FIXED CODE ###

import math

def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
      a, b = b, a % b
    return b


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

a, b = map(int, input().split())
print(lcm(a, b))
s,t=list(input()),list(input())
print(sum(s==t))

### FIXED CODE ###

s,t=list(input()),list(input())
print(sum(x==y for x,y in zip(s,t)))
lis = list(input())
cou = 0
ans = 0
for i in range(len(lis)):
	if lis[i] == "g":
		if cou > 0:
        	cou -= 1
        	ans += 1
		else:
        	cou += 1
	else:
		if cou > 0:
        	cou -= 1
		else:
			cou += 1
			ans -= 1
print(max(0,ans))


### FIXED CODE ###

j = input().split()
a = int(j[2])
b = int(j[1])
c = int(j[0])
if a == b and b== c:
 print("1")
elif a == b:
 print("2")
elif b == c:
 print("2")
elif a==c:
 print("2")
else:
 print("3")
#!/usr/bin/env python
# coding: utf-8

# In[28]:


n = int(input())
S = []
for _ in range(n):
    S.append(input())


# In[29]:


myset = set(S[0])
mycnt = {}
for i in range(len(myset)):
    mylist = list(myset)
    tmp = mylist[i]
    mycnt[tmp] = S[0].count(tmp)
for i in range(1,n):
    myset = myset & set(S[i])
    for i in range(len(myset)):
        mylist = list(myset)
        tmp = mylist[i]
        mycnt[tmp] = min(mycnt[tmp], S[i].count(tmp))


# In[30]:


ans = ""
for x in myset:
    print(x)
    cnt = mycnt[x]
    ans += x*cnt
print("".join(sorted(ans)))


# In[ ]:






### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

# In[ ]:


MAX_N = 50
n = int(input())
C = [[0] * 26 for _ in range(n)]
for i in range(n):
    S = input()
    for s in S:
        C[i][ord(s) - ord('a')] += 1
res = ''
for i in range(26):
    t = MAX_N + 1
    for j in range(n):
        t = min(t, C[j][i])
    res += chr(i + ord('a')) * t
print(res)
S = str(input())
N = len(S)
L = list(S)
L = set(L)
if N != 26: #含まないものがある
  for i in range(26):
    temp = chr(i+97)
    if temp not in L:
      ans = S+temp
      print(ans)
      exit()
M = []
for i in range(25):
  now = 25-i
  if S[now] > S[now-1]:
    ans = S[:now-1]+min(M)
    print(ans)
    exit()
  M.append(S[now])
print(-1)  

### FIXED CODE ###

S = str(input())
N = len(S)
L = list(S)
L = set(L)
if N != 26: #含まないものがある
  for i in range(26):
    temp = chr(i+97)
    if temp not in L:
      ans = S+temp
      print(ans)
      exit()
M = []
All = [chr(97+i) for i in range(26)]
#print(All)
for i in range(25):
  now = 25-i
  M.append(S[now])
  if S[now] > S[now-1]:
    M.sort()
    for x in M:
      if x > S[now-1]:
        temp = x
        ans = S[:now-1]+temp
        print(ans)
        exit()
  
print(-1)
from functools import lru_cache

def main():
    n,m = map(int,input().split())
    A = []
    for _ in range(m):
        a = int(input())
        A.append(a)
    mod = 10**9+7
    @lru_cache(maxsize=100000)
    def root(n):
        if n==0 or n==1:
            return 1
        else:
            if n-1 in A and n-2 in A:
                return 0
            elif n-1 in A and n-2 not in A:
                return pow(root(n-2),1,mod)
            elif n-1 not in A and n-2 in A:
                return pow(root(n-1),1,mod)
            else:
                return pow(root(n-1)+root(n-2),1,mod)
    print(root(n))

if __name__ == "__main__":
    main()

### FIXED CODE ###

from functools import lru_cache

def main():
    n,m = map(int,input().split())
    import numpy as np
    ans = np.ones(n+1,dtype=int)*-1
    ans[0] = 1
    mod = 10**9+7
    for _ in range(m):
        a = int(input())
        ans[a]=0
    if ans[1]!=0:
        ans[1]=1
    for i in range(2,n+1):
        if ans[i]!=0:
            ans[i] = (ans[i-1]+ans[i-2])%mod
    print(ans[-1])
        

if __name__ == "__main__":
    main()
a,b,c,d = input()
if a*b > c*d:
    print a*b
elif c*d > a*b:
    print c*d
else:
    print a*b


### FIXED CODE ###

#!/usr/bin/env python
s = raw_input()
array_num = [ int(each_num) for each_num in s.split()]
first_area = array_num[0] * array_num[1]
second_area = array_num[2] * array_num[3] 
if first_area > second_area:
	print(first_area)
elif first_area < second_area:
	print(second_area)
else:
	print(first_area)
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            ans += min(abs(cnt-num),cnt)
            cnt = 1
            num = data[i]
print(ans)

### FIXED CODE ###

from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            if cnt < data[i-1]:
                ans += cnt
            else:
                ans += (cnt-data[i-1])
            cnt = 1
            num = data[i]
    print(ans)
n = int(input())
t,a = map(int, input().split())
h = [int(i) for i in input().split()]
candidates = list(map(lambda x: abs(a - t - x * 0.006), h))
print(candidates.index(min(candidates)) + 1)


### FIXED CODE ###

a,b= map(int, input().split())
print(a + int(b/2))