peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())

arms_range_list =[]
for _ in range(N):
    X, L = map(int, input().split())
    arms_range_list.append((X-L, X+L))

arms_range_list = sorted(arms_range_list)


count = 0
max_arm_position_now = -float('inf')
for i in range(N):
    min_arm_position_next = arms_range_list[i][0]
    if min_arm_position_next >= max_arm_position_now:
        max_arm_position_now = arms_range_list[i][1]
        count += 1


print(count)
# Judge status: Accepted
import math
import collections
import sys

#input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

a,b=MI()
print(a+b//2)
# Judge status: Accepted
s=input()
d={}
for i in range(int(len(s))):
    if s[i] not in d:
        d[s[i]]=1
    else:
        print("no")
        exit()
print("yes")
# Judge status: Accepted
A, B, K = map(int, input().split())

count = 0
for i in range(B, 0, -1):
    if A % i == 0 and B % i == 0:
        count += 1
    if count == K:
        print(i)
        exit()
# Judge status: Accepted
s = input()
t = input()
ss = sorted(s)
tt = sorted(t)[::-1]

if ss < tt:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

if 0 in A:
    ans = sum(map(abs, A))
    print(ans)
    exit()
else:
    negs = 0
    for a in A:
        if a < 0:
            negs += 1

    if negs % 2 == 1:
        A = list(map(abs, A))
        A.sort()
        # print(A, sum(A))
        ans = sum(A) - 2 *A[0]
        print(ans)
    else:
        ans = sum(map(abs, A))
        print(ans)
# Judge status: Accepted
s=input()
t=input()
num=len(s)-len(t)
res=[]
for n1 in range(0,num+1):
    count=0
    for n2 in range(0,len(t)):
        if(t[n2]!=s[n1+n2]):
            count+=1
    res.append(count)
print(min(res))
# Judge status: Wrong Answer
def nCr(n,r):
  dividend,divisor = 1,1
  for i in range(r):
    dividend *= n-i
    divisor *= 1+i
    dividend %= MOD
    divisor %= MOD

  return (dividend * pow(divisor, MOD-2, MOD)) % MOD

X,Y = map(int,input().split())
INF = 10**15
MOD = 10**9+7

if X%3!=0 or Y%3!=0:
  print(0)
  exit()

n = (-X + 2*Y) // 3
m = (2*X - Y) // 3

if n<0 or m<0:
  print(0)
  exit()

print(nCr(n+m, n))
# Judge status: Accepted
N, K = map(int, input().split())

mod = 10**9+7 #出力の制限

res = 0
for i in range(K, N+2):
    ma = (2*N-i+1)*i/2
    mi = (i-1)*i/2
    res += (ma-mi+1)%mod

print(int(res%mod))
# Judge status: Accepted
N,K = map(int, input().split())
p = 0
while True:
    if N < K**p:
        break
    p += 1
print(p)
# Judge status: Accepted
print("".join(map(lambda string: string[0], input().split())))
# Judge status: Accepted
a,b,c,x,y=map(int, input().split( ))
#超過してよい
#x,y<=10000
ans=10**15

for i in range(0,max(x,y)+7):
    tmp = 2*i*c
    tmp+=max(0,(x-i)*a)
    tmp+=max(0,(y-i)*b)
    ans=min(ans, tmp)
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
r = [0]*n
for i in range(m):
  a,b = map(int,input().split())
  r[a-1]+=1
  r[b-1]+=1
for i in r: print(i)
# Judge status: Wrong Answer
s = int(input())
mod = 10**9 + 7
n = s // 3
if n == 0:
    print(0)
    exit()
amari = [0]*(n+1)
for i in range(1, n+1):
    amari[i] = s - 3*i


ans = 0
for i in range(1, n+1):
    ans = (ans + pow(i, amari[i])) % mod
print(ans % mod)
# Judge status: Accepted
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
if a.count(x)==1 and a.count(y)==1:
    print("Yes")
elif b.count(x)==1 and b.count(y)==1:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())

ans = []
ans.append(a*b)
ans.append(a*d)
ans.append(b*c)
ans.append(b*d)

print(max(ans))
# Judge status: Wrong Answer
X=int(input())
count=0
i = 100
while X>=i:
    i = int(i * (1+0.01))
    count = count +1

print(count)
# Judge status: Wrong Answer
x,y = input().split(' ')
x = int(x)
y = int(y)

if y % x == 0:
  print(-1)
else:
  print(x)
# Judge status: Accepted
S = input()
T = input()

ls = len(S)
lt = len(T)
left = -1

for i in range(ls-lt+1):
    for j in range(lt):
        if S[i+j] != "?" and S[i+j] != T[j]:
            break
    else:
       left = i
if left == -1:
    ans = "UNRESTORABLE"
else:
    ans = S[:left]+T+S[left+lt:]
    ans = ans.replace("?", "a")
print(ans)
# Judge status: Wrong Answer
import math
R = int(input())
C = 2 * math.pi * R
print("%.10ef" % C)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
if len(set(l)) == len(l):
    mean = (sum(l))//len(l)
else:
    mean = (sum(set(l)))//(n-1)
print(sum(pow(i - mean, 2) for i in l))
# Judge status: Accepted
x = int(input())
num = 0
for i in range(1,1000000):
    num += i
    if num >= x:
        print(i)
        exit()
# Judge status: Wrong Answer
import re
a = input()
if re.match("[A-Z]", a):
  print(a.lower())
else:
  print(a.upper())
# Judge status: Accepted
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):
    print(i)
# Judge status: Wrong Answer
n = int(input())
ans = 0
for a in range (1,n):
  for b in range (1,n):
    if n < (a * b):
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
a = [int(input()) for i in range(n)]
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

print(lcm(a))
# Judge status: Wrong Answer
N, M = map(int, input().split())
if N == 2 or M == 2:
    print(0)
elif N == 1 or M == 1:
    print(max(N, M)-2)
else:
    print((N-2)*(M-2))
# Judge status: Accepted
from math import pi
r = int(input())

print(2*r*pi)
# Judge status: Accepted
di = {'Sunny':'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}
x = input()
print(di[x])
# Judge status: Accepted
def ABC162C(a,b):#ユークリッドの互除法#最大公倍数
    p=a*b
    while b != 0:
        a %= b
        if a == 0:break
        b %= a
    return p//max(a,b)

n=int(input())
a=list()
for i in range(n):
    a.append(int(input()))
p=a[-1]
for i in a[:-1]:
    p=ABC162C(p,i)
print(p)
# Judge status: Accepted
# Set given variables
inputVec = input().split(' ')
s_x = int(inputVec[0])
s_y = int(inputVec[1])
t_x = int(inputVec[2])
t_y = int(inputVec[3])

# Calculate difference
d_x = t_x - s_x
d_y = t_y - s_y

# move 1
result = 'R' * d_x + 'U' * d_y

# move 2
result += 'L' * d_x + 'D' * d_y

# move 3
result += 'D' + 'R' * (d_x + 1) + 'U' * (d_y + 1) + 'L'

# move 4
result += 'U' + 'L' * (d_x + 1) + 'D' * (d_y + 1) + 'R'

print(result)
# Judge status: Accepted
a, b, c = map(int, input().split())

if a - b < c:
    print(c - (a - b))
else:
    print(0)
# Judge status: Accepted
A,B=input().split()
A=int(A)
B=int(B[:-3])*100+int(B[-2:])

print((A*B)//100)
# Judge status: Accepted
N = list(map(int, list(input())))[::-1]
L = len(N)

answer = 0
for i, n in enumerate(N):
    if n < 5:
        answer += n
    elif n > 5:
        answer += 10 - n
        if i < L - 1:
            N[i + 1] += 1
        else:
            answer += 1
    else:
        answer += 5
        if i < L - 1:
            if N[i + 1] >= 5:
                N[i + 1] += 1

print(answer)
# Judge status: Wrong Answer
A,B = map(int,input().split())

su = abs(A -B)
count = 0
for i in range(A, B):
    aa =str(i)
    rslt = aa[::-1]
    if aa == rslt:
        count += 1
print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

import bisect
a.sort()

center = a[-1]//2

index = bisect.bisect_left(a,center)

if a[index] != center:
    if index > 0 and center - a[index-1] < a[index] - center:
        index -= 1
        
if index == n-1:
    index -= 1
    
print(a[-1],a[index])
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=1)
if N % 2:
    ans = A[0]+2*sum(A[1:N//2])+A[N//2]
else:
    ans = A[0]+2*(sum(A[1:N//2]))
print(ans)
# Judge status: Accepted
s = list(input())
s.sort()
if s == ['a', 'b', 'c']:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
min=10000
index=0
for i in range(N):
    #print(abs(A-(T-H[i]*0.006)))
    if int(abs(H[i]*0.006+A-T))<min:
        index = i
        #print(i)
        min=int(abs(H[i]*0.006+A-T))
        #print(int(abs(A-(T-H[i]*0.006))))

print(index+1)
# Judge status: Accepted
K=int(input())
if K % 2 ==0:
  print(int(K*K/4))
else:
  print(int((K+1)*(K-1)/4))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

K, X = mapint()
print(*range(max(-10000000, X-K+1), min(10000001, X+K)))
# Judge status: Accepted
(n, m), h, *r = [[*map(int, i.split())] for i in open(0)]
g =[] + h

for i in r:
    g[i[0]-1] *= h[i[0]-1] > h[i[1]-1]
    g[i[1]-1] *= h[i[1]-1] > h[i[0]-1]
print(len([i for i in g if i !=0]))
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
b=int(b)
print((b-a)*(b-a-1)/2)
# Judge status: Accepted
n,k=map(int,input().split())
P=list(map(int,input().split()))

S=[0]
for i in range(n):
   S.append(S[i]+P[i])
ans=0
for j in range(n-k+1):
   ans=max(ans,(S[j+k]-S[j]))

print((ans+k)/2)
# Judge status: Accepted
n, m = map(int,input().split())
li = list(map(int, input().split()))
 
res = n - sum(li)
if res >= 0:
	print(res)
else:
    print(-1)
# Judge status: Accepted
H,A = map(int,input().split())
i = 1
while A < H:
        H = H - A
        i += 1 
print(i)
# Judge status: Accepted
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    max_antena = max(a,b,c,d,e)
    min_antena = min(a,b,c,d,e)

    print('Yay!' if max_antena - min_antena <= k else ':(')

if __name__ == '__main__':
    main()
# Judge status: Accepted
l=[51]*26
N = int(input())

for s in [input() for _ in range(N)]:
  for i in range(26): 
    c=s.count(chr(97+i))
    l[i]=min(l[i],c)
ans=''
for i in range(26):
  if l[i]<51: ans += chr(97+i)*l[i]
print(ans)
# Judge status: Accepted
s = input()
l = set(s)
if len(l) == 1:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
A,B,C=map(int,input().split())
if C>=A and C<=B:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n,x = IL()
    l = list(IL())
    ans = 0
    cur = 0
    for rep in l:
        ans += 1
        cur += rep
        if x < cur: break
    print(ans)
    return

if __name__=='__main__':
    Main()
# Judge status: Accepted
import fractions
a, b = map(int, input().split())

def factorize(n: int) -> int:
    b = 2
    ret = []
    while b*b <= n:
        while n%b == 0:
            n //= b
            ret.append(b)
        b = b + 1

    if n > 1:
        ret.append(n)

    return list(set(ret))

g = fractions.gcd(a, b)
print(len(factorize(g))+1)
# Judge status: Wrong Answer
a,b = map(int, input().split())
if (a * b %2 == 0) :
    print('even')
else:
    print('odd')
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))

XX = sorted(X)
before = XX[N//2 -1]
after = XX[N//2]

for i in X:
    if i <= before:
        print(after)
    else:
        print(before)
# Judge status: Wrong Answer
size = int(input())
li = list(map(int,input().split()))
ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
# Judge status: Accepted
s = input()
K = int(input())

S = [ord(i)-97 for i in s]

last = K
for i in range(len(S)):
    if S[i] != 0:
        if 26 - S[i] <= last:
            last -= 26 - S[i]
            S[i] = 0

if last > 0:
    S[-1] += last
    S[-1] %= 26

S = [chr(i+97) for i in S]
print(''.join(S))
# Judge status: Accepted
x = int(input())
def function(a,b):
    return a**5-b**5

a = 0
for i in range(-119,119):
    for j in range(i+1,120):
        if function(j,i)==x:
            print(j,i)
            a = 1
            break
    if a == 1:
        break
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]

A.reverse()
ans = []

for i in range(0,N,2):
    ans.append(A[i])

A.reverse()

for i in range(N%2,N,2):
    ans.append(A[i])

[print(i,end=' ') for i in ans]
# Judge status: Accepted
# AtCoder Regular Contest 099
# C - Minimization 

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

ans=0

a=N-K
ans+=1

if a>0:
    ans+=a//(K-1)
    if a%(K-1)==0:
        pass
    else:
        ans+=1
else:
    pass

print(ans)
# Judge status: Accepted
h,n = map(int,input().split())
A = sum(map(int, input().split()))
print('Yes' if A >=h else 'No')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
p = [0 for i in range(n+1)]
ans = 0
q = []
for i in reversed(range(1,n+1)):
    if sum(p[i:n+1:i]) % 2 != a[i-1]:
        p[i] += 1
        ans += 1
        q.append(i)
print(ans)
print(*q)
# Judge status: Accepted
n = int(input())
s = input()

x = 0
l = [0]
for i in range(0, n):
    if s[i] == 'I':
        x += 1
    elif s[i] == 'D':
        x -= 1
    l.append(x)

print(max(l))
# Judge status: Wrong Answer
x, y = map(int, input().split())
num = x
for i in range(2, y//x+1):
    num *= 2
    if num > y:
        print(i - 1)
        exit()
# Judge status: Wrong Answer
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys
input = sys.stdin.readline
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

x = inp()
ans = 360/x
import math
print(int(math.ceil(ans)))
# Judge status: Accepted
a,b=map(int,input().split())
c=(a+b)/2
if c%1>0:
  print(int(c+1))
else:
  print(int(c))
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))
c = []
other = 0
for a in A:
    if a< 400:c.append(1)
    elif a < 800: c.append(2)
    elif a < 1200: c.append(3)
    elif a < 1600: c.append(4)
    elif a < 2400: c.append(5)
    elif a < 2800: c.append(6)
    elif a < 3200: c.append(7)
    else: other+=1
c = set(c)
if c: print(len(c), len(c)+other)
else: print(1, other)
# Judge status: Accepted
a,b = map(int,input().split())

d = a*b

if a >= 10 or b >= 10:
    print("-1")
elif a <= 0 or b <= 0:
    print("-1")
else:
    print(d)
# Judge status: Accepted
d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)

fuman=[]
for i in range(26):
    fuman.append(c[i]*66795)

for i in range(d):
    p=fuman.index(max(fuman))
    print(p+1)
    q=364-i
    fuman[p]=(q**2+q)*c[p]//2
    for j in range(26):
        if j!=p:
            fuman[j]-=c[j]*(i+1)
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0
for i in range(2):
    if a < b:
        ans += b
        b -= 1
    else:
        ans += a
        a -= 1
print(ans)
# Judge status: Wrong Answer
from collections import deque
n,m = map(int, input().split())
g = [[] for _ in range(n)]

for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    g[a].append(b)
    g[b].append(a)

stack = deque([0])
dist = [-1] * n
dist[0] = 0

while stack:
    v = stack.popleft()
    for nv in g[v]:
        if dist[nv] == -1:
            dist[nv] = v+1
            stack.append(nv)
print("YES")
print(*dist[1:], sep="\n")
# Judge status: Accepted
N = int(input())
S = input()
alfa = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lis = []
for s in S:
    for i in range(26):
        if s == alfa[i]:
            lis.append((i+N)%26)
            break
for i in range(len(S)):
    print(alfa[lis[i]],end = '')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
N,K,X,Y= [int(input()) for i in range(4)]
if N>K:
    print(K*X+(N-K)*Y)
elif N<=K:
    print(K*X)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

for i in range(X+1):
    if i*2+(X-i)*4==Y:
        print('Yes')
        exit()
print('No')
# Judge status: Accepted
N=int(input())
d=[]
for i in range(10):
    for k in range(10):
        d.append(i*k)
if N in d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
if c >= a and b >= c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')
# Judge status: Wrong Answer
from itertools import accumulate
from bisect import bisect_left
 
n,m,k=map(int,input().split())
a=list(accumulate([0]+list(map(int,input().split()))))
b=list(accumulate([0]+list(map(int,input().split()))))
#print(b)
mx=0
for i in range(n+1):
  if a[i]>k:continue
  #print('a[i];'+str(a[i]))
  idx=max(bisect_left(b,k-a[i])-1, 0)
  #print(idx)
  if a[i]+b[idx]>k:continue
  mx=max(mx,i+idx)
print(mx)
# Judge status: Accepted
n=int(input(""))
lisa=input("").split(" ")
t=0
s=int(lisa[0])
for i in lisa:
    if(s<int(i)):
        s=int(i)
    else:
        t+=s-int(i)
print(t)
# Judge status: Accepted
S = list(input())
if sorted(S) == sorted(["a","b","c"]):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if c in list(range(a,b)):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
T = [int(input()) for i in range(N)]

from fractions import gcd

def mygcd(a,b):
    gcd_list = []
    for i in range(1,int(min(a,b)**0.5)+1):
        if a%i == 0 and b%i == 0:
            gcd_list.append(i)
    return max(gcd_list)

number = T[0]

for i in range(1,N):
    number = number*T[i]//gcd(number,T[i])
    
print(number)
# Judge status: Accepted
n,p = map(int,input().split())
l = list(map(int,input().split()))
l1 = []
for i in l:
  if i%2==0:
    l1.append(0)
  else:
    l1.append(1)
    


a = l1.count(1)
b = l1.count(0)
if a!=0:
  cou = (2**(b))*(2**(a-1))
  print(cou)
else:
  if p%2==0:
    print(2**b)
  else:
    print(0)
# Judge status: Wrong Answer
N = int(input())
a = N//7
b = N//4
print(a)
print(b)
for i in range(a+1):
    for j in range(b+1):
        if 7*i+4*j == N:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
import math
a, b, h, m = map(int, input().split())

B = (math.pi)*m/30
A = (math.pi)*h/6 + B/12

print(((a**2) + (b**2) - 2*a*b*(math.cos(B-A)))**(1/2))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort()
s = 0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if a[i]<a[j] and a[j]<a[k] and a[k]<a[i]+a[j]:
        ##print(i,j,k)
        s += 1
print(s)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, C, K = mapint()

Ts = [int(input()) for _ in range(N)]
Ts.sort()
last_cus = Ts[0]
cum = 1
bus = 0
for i in range(1, N):
    t = Ts[i]
    if t-last_cus>K:
        bus += 1
        cum = 0
    cum += 1
    last_cus = t
    if cum==C:
        bus += 1
        cum = 0
        last_cus = 10**18
if cum!=0:
    print(bus+1)
else:
    print(bus)
# Judge status: Wrong Answer
from math import sqrt


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

ans = 1
for i in range(1, int(sqrt(M)) + 1):
    if M % i == 0 and M / N >= i:
        ans = i

if N == 1:
    ans = M

print(ans)
# Judge status: Accepted
S = input()
T = input()
koho = []

for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j] != '?' and S[i+j] != T[j]:
            break
    else:
        koho.append(S[:i]+T+S[i+len(T):])
result = sorted([s.replace('?', 'a') for s in koho])
print('UNRESTORABLE' if result == [] else result[0])
# Judge status: Wrong Answer
import math

H = int(input())
n = math.ceil(math.log2(H))
print(2**(n)-1)
# Judge status: Accepted
from re import match
s, t = input().replace('?', '.'), input()

for i in range(len(s) - len(t) + 1)[::-1]:
    if match(s[i:i + len(t)], t):
        key = s.replace(s[i:i + len(t)], t).replace('.', 'a')
        s = s.replace('.', 'a')
        print(s[:i] + t + s[i + len(t):])
        #print(key)
        break
else:
    print('UNRESTORABLE')
# Judge status: Accepted
n,m=map(int,input().split())
red=[1]+[0]*(n-1)
pink=[1]*n
for _ in range(m):
    x,y=map(int,input().split())
    x-=1
    y-=1
    if red[x] and pink[x]==1:
        red[x]=0
        red[y]=1
    elif red[x] and pink[x]>1:
        red[y]=1
    pink[x]-=1
    pink[y]+=1
print(red.count(1))
# Judge status: Accepted
in_all = list(map(int, input().split()))

total = 0
for n in range(1, in_all[0]+1):
    all = 0
    tmp = n
    while tmp!=0:
        all += tmp%10
        tmp = tmp//10
    if all>=in_all[1] and all<=in_all[2]:
        total += n

print(total)
# Judge status: Accepted
n = int(input())
cnt = 0
for _ in range(n):
    a, b = map(int, input().split())
    if a == b:
        cnt += 1
    else:
        cnt = 0
    if cnt >= 3:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
N = int(input())

ans = int((N-1) * (1+N-1)/2)
if N == 1:
    print(0)
    exit()
print(ans)
# Judge status: Accepted
def resolve():
    c = input()
    ans = chr(ord(c) + 1)
    print(ans)
resolve()
# Judge status: Accepted
(n,an,bn) = list(map(int,input().split()))
s = list(input())
count = 1
foreign = 1
for i in s:

  if i=='a' and an+bn >= count:
    print('Yes')
    count += 1
  elif i=='b' and an+bn >= count and bn >= foreign:
    print('Yes')
    count += 1
    foreign += 1
  else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
i1 = list(map(int, input().split()))
i2 = list(map(int, input().split()))

max = 0
for i in range(n):
  tempmax = 0
  tempmax += sum(i1[:i])
  tempmax += sum(i2[i-1:])
  
  if tempmax > max:
    max = tempmax
    
print(max)
# Judge status: Accepted
S = input ()
Z = ''.join(list(reversed(S)))
Z = Z.replace('resare', '')
Z = Z.replace('esare', '')
Z = Z.replace('remaerd', '')
Z = Z.replace('maerd', '')
z = len (Z)
if z == 0:
    print ('YES')
else:
    print ('NO')
# Judge status: Accepted
from sys import stdin
input = stdin.readline

n, x, y = list(map(int, input().split()))
x -= 1
y -= 1
ans = [0 for _ in range(n)]
for i in range(n):
    for j in range(i+1, n):
        ans[min([abs(i-j), abs(i-x)+abs(j-y)+1, abs(i-y)+abs(j-x)+1])] += 1
for i in range(1, n):
    print(ans[i])
# Judge status: Accepted
a=0
x=y=''
for i,s in enumerate(input()[::-1]):
  y+=s
  if x!=y:
    a+=1
    x=y
    y=''
print(a)
# Judge status: Accepted
n,t=map(int,input().split())
ans=10**20
for i in range(n):
  c,tt=map(int,input().split())
  if tt<=t:ans=min(ans,c)
if ans==10**20:print("TLE")
else:print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import itertools
import math
n = int(input())
x = [0] * n
y = [0] * n
l = list(range(n))
ans = 0
for i in range(n):
    x[i], y[i] = map(int, input().split())
for v in itertools.permutations(l, 2):
    ans += math.sqrt((x[v[0]] - x[v[1]])**2 + (y[v[0]] - y[v[1]])**2)
print(ans/n)
# Judge status: Accepted
l, r = map(int, input().split())
res = 2019
for i in range(l, r):
  for j in range(i + 1, r + 1):
    res = min(res, ((i * j) % 2019))
    if res == 0:
      print(0)
      exit()
print(res)
# Judge status: Wrong Answer
N=int(input())
S=[]
a=0
b=0
for i in range(N):
  A=int(input())
  S.append(A)
  for j in range(i):
    if S[j]==A:
      a=a+1
      b=b-1
      break
  if a==0:
    b=b+1
  a=0
  
print(b)
# Judge status: Accepted
numbers = [int(x) for x in input().split()]
numbers.sort(reverse=True)

print(10 * numbers[0] + numbers[1] + numbers[2])
# Judge status: Wrong Answer
N = 26
D = int(input())
C = [int(i) for i in input().split()]

S = []
for i in range(D):
  s = max([int(i) for i in input().split()])
  S.append(s)

for i in S:
  print(i)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
for _ in range(min(k, 50)):
    b = [0]*(n+1)
    for i in range(n):
        b[max(0, i-a[i])] += 1
        b[min(i+a[i]+1, n)] -= 1
    for i in range(1, n+1):
        b[i] += b[i-1]
    for i in range(n):
        a[i] = b[i]
print(*a)
# Judge status: Accepted
A, B = map(int, input().split())

ans = 0
consent = 1

while consent < B:
    ans += 1
    consent -= 1
    consent += A
print(ans)
# Judge status: Accepted
n=int(input())

print(int(n+n**2+n**3))