Harryxun/stf_run huggingface dataset:
# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import statistics
import string


def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):#最大公約数 math.gcdが使えない時の手段として入れとく。pythonが更新されたらいらなくなるはず
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

N, M = splitintinput()
restriction = {}
flag = 1
ans = ''
for i in range(M):
    s,c = splitintinput()
    if s in restriction:
        if restriction[s] != str(c):
            flag = 0
            break
    else:
        restriction[s] = str(c)
if N != 1 and restriction[1] == "0":
    flag = 0

if flag == 0:
    print(-1)
else:
    for i in range(M):
        if i+1 in restriction:
            ans += restriction[i+1]
        else:
            if i == 0 and M != 1:
                ans += "1"
            else:
                ans += "0"
    print(ans)


### FIXED CODE ###

# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import statistics
import string


def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):#最大公約数 math.gcdが使えない時の手段として入れとく。pythonが更新されたらいらなくなるはず
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

N, M = splitintinput()
restriction = {}
flag = 1
ans = ''
for i in range(M):
    s,c = splitintinput()
    if s in restriction:
        if restriction[s] != str(c):
            flag = 0
            break
    else:
        restriction[s] = str(c)


if flag == 0:
    print(-1)
else:
    for i in range(N):
        if i+1 in restriction:
            ans += restriction[i+1]
        else:
            if i == 0 and N != 1:
                ans += "1"
            else:
                ans += "0"
    if N != 1 and ans[0] == "0":
        print(-1)
    else:
        print(ans)
while 1:
	r,c,q = map(int,raw_input().split())
	if r == 0: break
	R = [[0,0] for i in range(r)]
	C = [[0,0] for i in range(r)]
	for i in range(1,q+1):
		A,B,order = map(int,raw_input().split())
		if A == 0:
			R[B] = [i,order]
		else:
			C[B] = [i,order]
	ans = 0
	for ri in range(r):
		ans += sum(R[ri][1] if R[ri][0] > C[ci][0] else C[ci][1] for ci in range(c))
	print ans

### FIXED CODE ###

from bisect import *
while 1:
	r,c,q = map(int,raw_input().split())
	if r == 0: break
	R = [[0,0] for i in range(r)]
	C = [[0,0] for i in range(c)]
	for i in range(1,q+1):
		A,B,order = map(int,raw_input().split())
		if A == 0:
			R[B] = [i,order]
		else:
			C[B] = [i,order]
	CC =  [sorted(C[ci][0] for ci in range(c) if C[ci][1] == 1)]
	CC += [sorted(C[ci][0] for ci in range(c) if C[ci][1] == 0)]
	ans = r*sum(C[ci][1] for ci in range(c))
	ans -= sum((-1)**R[ri][1]*bisect(CC[R[ri][1]],R[ri][0]) for ri in range(r))
	print ans
A = map(int, input().split())

if A[0] + A[1] + A[2] > 22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

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

if sum(A) <= 21:
  print('win')
else:
  print('bust')
#16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input())

y=x**3

print("y")


### FIXED CODE ###

# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)
data = ["{0} {1}".format(s, r) for s in ('S', 'H', 'C', 'D') for r in range(1, 13, + 1)]

count = int(input())
for c in range(count):
    card = input()
    data.remove(card)

for c in data:
    print(c)

### FIXED CODE ###

data = [
    "{0} {1}".format(s, r)
    for s in ('S', 'H', 'C', 'D')
    for r in range(1, 13 + 1)
]
count = int(input())
for c in range(count):
    card = input()
    data.remove(card)
 
for c in data:
    print(c)
A = int(input(stdin))
B = int(input(stdin))
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")

### FIXED CODE ###

A, B = map(int,input().split())
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")
n = int(input())
a = list(map(int, input().split()))
while(len(a) != 1):
    a.sort()
    for i in range(1, len(a) - 1):
        a[i] = a[i] % a[0]
        if a[i] <= 0:
            del a[i]
    if len(a) == 2:
        a[1] = a[1] % a[0]
        a.sort()
        if a[0] == 0:
            del a[0]
            break
        a[1] = a[1] % a[0]
        a.sort()
        del a[1]
    if len(a) == 1:
        break
    
print(a[0])


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = a
while(len(a) != 1):
    a = s
    s = []
    a.sort()
    for i in range(len(a)):
        if i == 0:
            pass
        else:
            a[i] = a[i] % a[0]
    # print(len(a))
    for j in range(len(a)):
        if a[j] > 0:
            s.append(a[j])
    if len(a) == 1:
        break
print(a[0])
n=int(input())
stones=list(map(int, input.split()))
infini=(10**4)*(10**5)
dp = [infini for _ in range(n)]
dp[0]=0
dp[1]=stones[1]
for pos in range(1, n):
  dp[pos] = stones[pos] + min(dp[pos-1], dp[pos-2])

### FIXED CODE ###


n=int(input())
stones=list(map(int, input().split()))
infini=(10**4)*(10**5)
dp = [infini for _ in range(n)]
dp[0]=0

for pos in range(0, n-1):
   dp[pos+1] = min(dp[pos+1], dp[pos] + abs(stones[pos] - stones[pos+1]))
   if pos <= n-3:
      dp[pos+2] = min(dp[pos+2], dp[pos] + abs(stones[pos] - stones[pos+2]))
print(dp[-1])
a,b = map(int,input())
prin(a*b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
def fib_memo(n):
  memo = [0]*(n+1)
  def _fib(n):
    if n <= 1:
      return n
    if memo[n] != 0:
      return memo[n]
    memo[n] = _fib(n-1) + _fib(n-2)
    return memo[n]
  return _fib(n)
  
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
# A = range(M)
B = range(M)
for i in range(M):
  if i == 0:
    diff = A[i] - 1
    B[0] = fib_memo(diff + 1)
  elif i == (M - 1):
    diff = N - A[M - 1] -1
    B[M-1] = fib_memo(diff + 1)
  else:
    diff = A[i] - A[i-1]
    if diff == 0:
      print(0)
      break
    B[i] = fib_memo(diff + 1)
Ans = reduce(lambda a, b: a*b, B)
# Ans = 10
print(Ans % 1000000007)
    


### FIXED CODE ###

N, M = map(int, input().split())
A = [True] * (N+1)
for _ in range(M):
  idx = int(input())
  A[idx] = False

step = [0] * (N+1)
step[0] = 1
for i in range(1, N+1):
  if A[i]:
    step[i] = step[i-1] + step[i-2]
  else:
    step[i] = 0
print(step[N]%(10**9+7))
import fractions
import math
from functools import reduce

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

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

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

a=10**9+7
N=int(input())
A=list(map(int,input().split()))

common=lcm_list(A)
B=[]
for i in range(N):
    B.append(common//A[i])
print(sum(B)%a)

### FIXED CODE ###

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

a=10**9+7
N=int(input())
A=list(map(int,input().split()))

common=lcm(A)
ans=0
for i in range(N):
    ans+=common//A[i]
print(ans%a)
a,b,c = map(int,input.split(" "))
print((a*b)/2)

### FIXED CODE ###

a,b,c = map(int,input().split(" "))
print(int((a*b)/2))
N = int(input())
a=[int(x) for x in input().split()]
Kisuu = 0
YonBaisuu = 0
NiBaisuu = 0

for j in range(N):
  if a[j]%2 == 1:
    Kisuu += 1
  elif a[j]%4 == 0:
    YonBaisuu += 1
  else :
    NiBaisuu +=1

  
if Kisuu == YonBaisuu:
  print('Yes')
else :
  if NIBaisuu == 0:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

print("Yes" if four >= one or (four == one - 1 and two == 0) else "No")
N=int(input())
S=str(N)
A=len(S)
int(S[i])
for i in range(A):
M=M+S[i] 
if M%9==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N=int(input())
if N%9==0:
  print("Yes")
else:
  print("No")
N, M = map(int, input().split())
Edge = [[]for _ in range(N)]
Far = [-1]*N
for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    Edge[x].append(y)


def long(x):
    if len(Edge[x]) == 0:
        Far[x] = 0
        return 0
    if Far[x] >= 0:
        return Far[x]
    r = 0
    for i in Edge[x]:
        l = long(i) + 1
        r = max(r, l)
        Far[x] = r
    return r



for i in range(N):
    long(i)
print(max(Far))




### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = map(int, input().split())
Edge = [[]for _ in range(N)]
Far = [-1]*N
for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    Edge[x].append(y)


def long(x):
    if len(Edge[x]) == 0:
        Far[x] = 0
        return 0
    if Far[x] >= 0:
        return Far[x]
    r = 0
    for i in Edge[x]:
        l = long(i) + 1
        r = max(r, l)
    Far[x] = r
    return r


for i in range(N):
    long(i)
print(max(Far))
n=int(input())
s=input()
if n%2!=0:
  print("No")
  exit()
for i in range(n//2+1):
  if a[i]!=a[-i-1]:
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

n=int(input())
s=input()
if n%2==1:
  print("No")
  exit()
for i in range(n//2):
  if s[i]!=s[n//2+i]:
    print("No")
    exit()
print("Yes")
n = int(intput())
str = input()
print(str.count('ABC'))

### FIXED CODE ###

n = int(input())

s = input()

print(s.count('ABC'))
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

### FIXED CODE ###

from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(2)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)
a,b=input().split()
print(int(a)*int(float(b)*100)//100)

### FIXED CODE ###

n=int(input())
al=list()
bl=list()
for i in range(n):
    a,b=map(int,input().split())
    al.append(a)
    bl.append(b)
al.sort()
bl.sort()
l=n//2
if n%2==0:
    print(bl[l-1]+bl[l]-al[l-1]-al[l]+1)
else:
    print(bl[l]-al[l]+1)
n,k = map(int, input().split())
binary = [0 for _ in range(n)]
ls = list(map(int, input().split()))
for i in ls:
    binary[i-1] += 1
binary = sorted(binary)
binary.pop(binary.index(0))
print(binary)
ans = 0
i = 0
while k < len(binary) - binary.count(0):
    if binary[i] != 0:
        ans += binary[i]
        binary.pop(i)
    i+=1
print(ans)

### FIXED CODE ###

from collections import Counter

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

c = Counter(A)
d = sorted(c.values())
l = len(d)
print(sum(d[0:l-K]))
s = input()
t = input()

i = 0
his = []
length = len(s)
flag = True
for i in range(0, length-1):
	ss = s[i:i+1]
	tt = t[i:i+1]
	if ss != tt:
		if tt in his:
			flag = False
			break
		else:
			his.append(tt)
			it1 = re.finditer(ss, s)
			it2 = re.finditer(tt, s)
			for match in it1:
				s = s[:match.start()] + tt + s[match.end():]
			for match in it2:
				s = s[:match.start()] + ss + s[match.end():]

if flag:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

s = input()
t = input()

start = [-1] * 26
goal = [-1] * 26
flag = True
length = len(s)
dict = { chr(97 + i):i for i in range(26) }
for i in range(0, length):
	a = dict[s[i]]
	b = dict[t[i]]

	if start[a] != -1 or goal[b] != -1:
		if start[a] != b or goal[b] != a:
			flag = False
			break
	else:
		start[a] = b;
		goal[b] = a;
if flag:
	print("Yes")
else:
	print("No")
a, b = map(int, input().split())
print(max(a,b) + max(max(a,b)-1, min(a,b))


### FIXED CODE ###

a, b = map(int, input().split())
print(max(a,b) + max(max(a,b)-1, min(a,b)))
INF=int(float('inf'))

a,b=map(int,input().split())
if(a>=10):
    print(b)
else:
    print(b+(100*(10-a)))

### FIXED CODE ###



a,b=map(int,input().split())
if(a>=10):
    print(b)
else:
    print(b+(100*(10-a)))
a, b, c = map(int, input().split)
if a < b < c :
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a<b<c:
    print("Yes")
else:
    print("No")
# use faster method than input()
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def manhattan(pos1, pos2):
    return abs(pos1[0]-pos2[0]) + abs(pos2[1]-pos1[1])


H, W, D = map(int, input().split())
A = [(0, 0)]*(H*W)
for r in range(H):
    l = list(map(int, input().split()))
    for c in range(W):
        A[l[c]-1] = (r, c)

dist = [0]*(H*W)
for i in range(D, H*W):
    dist[i] = dist[i-D]+manhattan(A[i], A[i+D])


Q = int(input())
L = []

ans_list = [0]*Q
for i in range(Q):
    ans = 0
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    ans = dist[b]-dist[a]
    ans_list[i] = ans

for ans in ans_list:
    print(ans)


### FIXED CODE ###

# use faster method than input()
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def manhattan(pos1, pos2):
    return abs(pos1[0]-pos2[0]) + abs(pos2[1]-pos1[1])


H, W, D = map(int, input().split())
A = [(0, 0)]*(H*W)
for r in range(H):
    l = list(map(int, input().split()))
    for c in range(W):
        A[l[c]-1] = (r, c)

dist = [0]*(H*W)
for i in range(D, H*W):
    dist[i] = dist[i-D]+manhattan(A[i], A[i-D])


Q = int(input())
L = []

ans_list = [0]*Q
for i in range(Q):
    ans = 0
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    ans = dist[b]-dist[a]
    ans_list[i] = ans

for ans in ans_list:
    print(ans)
s=input()
j=0
for i in "AKIHABARA":
    if i==s[j] or i=="A":
        j+=1
    else:
        print("NO")
        exit()
print("YES") 

### FIXED CODE ###

a=["KIH","B","R",""]
ans=[]
aaa=[]
for i in range(16):
    b=""
    for j,k in enumerate(a):
        if ((i >> j) & 1):
            b+="A"
        b+=k
    ans.append(b)
print("YES" if input() in ans else "NO")
n, q = [int(el) for el in input().split(' ')]
data = [0] * n
ex_result = 0
for _ in range(q):
    a, v = [int(el) for el in input().split(' ')]
    data[a-1] += v
    if v < 0:
        result = ex_result
    else:
        result = max(data)
    print(data.index(result)+1, result)
    ex_result = result

### FIXED CODE ###

n, q = [int(el) for el in input().split(' ')]
data = [0] * n
result, index = 0, 1
for _ in range(q):
    a, v = [int(el) for el in input().split(' ')]
    data[a-1] += v
    if v > 0:
        if result < data[a-1]:
            result, index = data[a-1], a
        elif result == data[a-1]:
            index = min(index, a)
    else:
        if index == a:
            result = max(data)
            index = data.index(result) + 1
    print(index, result)
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = []
for i in range(a[0]):
	b[i] = abs(b[i]-a[1])
b.sort()
if a[0] == 1:
	c = b
else:
	for i in range(a[0]-1):
		c.append(b[i+1]-b[i])
c.sort()
if c[0] == 0:
	c.remove(0)
if len(c) == 0:
	c = b[0]
for i in range(len(c)):
	if c[i] % c[0] != 0:
		c[0] = 1
		break
print(c[0])


### FIXED CODE ###

import functools
import fractions
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = []
d = []
co = 0
for i in range(a[0]):
	c.append(abs(b[i]-a[1]))
	if b[i]-a[1] > 0 and co == 0:
		c.insert(i,0)
		co += 1
if co == 0:
	c.append(0)

for i in range(len(c)-1):
	d.append(abs(c[i+1]-c[i]))
print(functools.reduce(fractions.gcd, d))
n, m, x = map(int, input().split())
a = list(map(int, input().split()))

left = 0
right = 0

for ai in a:
    if ai < x:
        lef += 1
    else:
        right += 1
print(min(left, right))

### FIXED CODE ###

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

to_0 = 0
if A[-1] < X:
    to_0 = M
    to_N = 0
elif A[0] < X < A[-1]:
    for i in A:
        if i < X:
            to_0 += 1
    to_N = M - to_0
elif X < A[0]:
    to_0 = 0
    to_N = M
print(min(to_0, to_N))
N, K = map(int, input().split())
L = list(map(int, input().split()))

ans = 0
for i in range(K):
    ans += L.pop(max(L))

print(ans)

### FIXED CODE ###

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

L.sort(reverse=True)
print(sum(L[:K]))
# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
#aの合計を求める(suma)
suma=0
for i in range(n):
  suma+=numlista[i]
#1~10000がそれぞれいくつあるのか調べる(numkosuu)
numkosuu=[]
for i in range(100000):
  numkosuu.append(numlista.count(i+1))
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化量を求める
  k=c-b
  o=numkosuu[b-1]
#変化したところのみ計算する
  suma+=k*o
#個数を更新する
  numkosuu[b]+=numkosuu[b-1]
  numkosuu[b-1]=0
  print(suma)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
import collections
numkosuu=collections.Counter(numlista)
suma=0
for i in numlista:
  suma+=i
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化したところのみ計算する
  suma+=(c-b)*numkosuu[b]
#個数を更新する
  numkosuu[c]+=numkosuu[b]
  numkosuu[b]=0
  print(suma)
posX,posY=0,0
H,W=map(int,input().split())
while not(H==W==0):
    tile=[[False for i in range(W)] for j in range(H)]
    tileinfo=[['' for i in range(W)] for j in range(H)]
    for i in range(H):
        tileinfo[i]=input().rstrip()
    while True:
        if tileinfo[posX][posY]=='>':
            posX+=1
        elif tileinfo[posX][posY]=='<':
            posX-=1
        elif tileinfo[posX][posY]=='v':
            posY+=1
        elif tileinfo[posX][posY]=='^':
            posY-=1
        elif tileinfo[posX][posY]=='.':
            print('{} {}'.format(posX,posY))
            break
        if tile[posX][posY]==True:
            print('LOOP')
            break
        else:
            tile[posX][posY]=True

### FIXED CODE ###

H,W=1,1
while True:
    posX,posY=0,0
    H,W=map(int,input().split())
    if (H==W==0)==True:
        break
    tile=[[False for i in range(W)] for j in range(H)]
    tileinfo=[['' for i in range(W)] for j in range(H)]
    for i in range(H):
        tileinfo[i]=input().rstrip()
    while True:
        if tile[posY][posX]==True:
            print('LOOP')
            break
        else:
            tile[posY][posX]=True
        if tileinfo[posY][posX]=='>':
            posX+=1
        elif tileinfo[posY][posX]=='<':
            posX-=1
        elif tileinfo[posY][posX]=='v':
            posY+=1
        elif tileinfo[posY][posX]=='^':
            posY-=1
        elif tileinfo[posY][posX]=='.':
            print('{} {}'.format(posX,posY))
            break
N = int(input())
ans = 0
for i in range(N):
    l, r = input().split()
    ans += (r - l) + 1
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(N):
    l, r = map(int, input().split())
    ans += (r - l) + 1
print(ans)
N =int(input())
a =list(map(int,input().split()))

#print(a)
count = 0
D = []
for i in range(N+1):
    if i % 2 == 0:
        D.append(i)

#print(D)   

for j in D:
    if a[j] % 2 != 0:
        count += 1
        

print(count)


### FIXED CODE ###

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

for k in range(N+1):
    if k % 2 == 0:
        continue
    else:
        if a[k-1] % 2 != 0:
            count += 1

print(count)
import re
print(len(re.sub("B+","B",re.sub("W+","W",S)))-1)


### FIXED CODE ###

S=list(input())

def transform(S):
    r_S=[S[0]]
    now_c=S[0]
    for item in S:
        if now_c==item:
            pass
        else:
            now_c=item
            r_S.append(item)

    return r_S

print(len(transform(S))-1)
n = input()
print(48-n)

### FIXED CODE ###

M = int(input())
print(48-M)
N = input().split()

l = list(map(int,input().split()))

c = 0

for i in l:
	if i >= (sum(l) - i):
		c += 1
    
if c == 0:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

T,X = map(int,input().split())

ans = float(T/X)

print(ans)
import sys
import numpy as np
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    h, w, m = MII()
    bombs = [MIIZ() for _ in range(m)]
    a = [0]*h
    b = [0]*w
    for y,x in bombs:
        a[y] += 1
        b[x] += 1
    maxa = max(a)
    maxb = max(b)
    sumv = maxa + maxb
    c = a.count(maxa)*b.count(maxb) - sum(a[y]+b[y] == sumv for y,x in bombs)
    print(sumv - (c<=0))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import numpy as np
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    h, w, m = MII()
    bombs = [MIIZ() for _ in range(m)]
    a = [0]*h
    b = [0]*w
    for y,x in bombs:
        a[y] += 1
        b[x] += 1
    maxa = max(a)
    maxb = max(b)
    sumv = maxa + maxb
    c = a.count(maxa)*b.count(maxb) - sum(a[y]+b[x] == sumv for y,x in bombs)
    print(sumv - (c<=0))

if __name__ == '__main__':
    main()
a, b, x = map(int, raw_input().split())

i = a
count = 0
while i < b + 1:
    if x%i == 0:
        count = count + 1

print count


### FIXED CODE ###

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

i = a
count = 0
count_b = 0
count_a = 0

count_b = b/x
count_a = (a-1)/x


print count_b - count_a
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    N = int(input())
    xy = XLMIIS(N)
    

    def distance(x1,y1,x2,y2):
        return ((x1-x2)**2 + (y1-y2) ** 2) ** 0.5

    def f(n):
        ans = n
        if n <= 0:
            return 1
        for i in range(1,n):
            ans *= i
        return ans
    

    sumdis = 0
    for i in range(N):
        for j in range(i+1,N):
            sumdis += distance(*xy[i],*xy[j])
    summ = sumdis  / N * 2
    print(summ)


if __name__ == '__main__':
    main()

### FIXED CODE ###

#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    N = int(input())
    xy = XLMIIS(N)
    

    def distance(x1,y1,x2,y2):
        return ((x1-x2)**2 + (y1-y2) ** 2) ** 0.5

    def f(n):
        ans = n
        if n <= 0:
            return 1
        for i in range(1,n):
            ans *= i
        return ans
    

    sumdis = 0
    for i in range(N):
        for j in range(i+1,N):
            sumdis += distance(xy[i][0],xy[i][1],xy[j][0],xy[j][1])
    summ = sumdis  / N * 2
    print(summ)


if __name__ == '__main__':
    main()
while True:
    a,b = map(int,input().split())
    print (len(str(a+b)))

### FIXED CODE ###

while True:
    try:
        a,b = map(int,input().split())
        print (len(str(a+b)))
    except EOFError:
        break