Harryxun/stf_run huggingface dataset:
y = [] 
x = 0

def slv(h, i):
    if x == h or i >= x:
        if x == h:
            y.append(i - 1)
        return
    slv(h+i, i+1)  # jump
    slv(h, i+1)  # stay

if __name__ == '__main__':
    x = abs(int(input()))
    slv(0, 0)

    if len(y) == 0:
        print(2)
    else:
        print(min(y))

### FIXED CODE ###

if __name__ == '__main__':
    x = abs(int(input()))

    s = 0
    for i in range(0,10 ** 9):
        if s > x: 
            print(i - 1)
            break
        elif s == x:
            print(i - 1)
            break
        s += i
def f():
  A=[raw_input() for _ in range(h)]
  x,y=0,0
  while 1:
    A[y]=A[y][0:x]+'x'+A[y][x+1:]
    if s==">": x+=1
    elif s=="<": x-=1
    elif s=="v": y+=1
    elif s=="^"3: y-=1
    elif s==".": return " ".join(map(str,[x,y]))
    else: return "LOOP"
  
while 1:
  h,w=map(int,raw_input().split())
  if h==w==0: break
  print f()

### FIXED CODE ###

while 1:
  h,w=map(int,raw_input().split())
  if h==w==0: break
  A=[list(raw_input()) for _ in range(h)]
  x,y=0,0
  while 1:
    s=A[y][x]
    A[y][x]='x'
    if s==">": x+=1
    elif s=="<": x-=1
    elif s=="v": y+=1
    elif s=="^": y-=1
    elif s==".": B=[x,y]; break
    else: B=["LOOP"]; break
  for e in B: print e,
  print
import sys

s = c = 0
for line in sys.stdin:
    x, y = map(int line.split())
    s += x * y
    c += y
print(s, round(s / c))

### FIXED CODE ###

import sys

s = c = n = 0
for line in sys.stdin:
    x, y = map(int, line.split(','))
    s += x * y
    c += y
    n += 1
print(s)
print(int(c / n + 0.5))
import sys

N=int(input())
if N<1 or N>20 :
    print("error")
    sys.exit()

V=list(map(int,input().strip().split()))
C=list(map(int,input().strip().split()))
# print(V[0],V[1],V[2])                                                                              

for i in range(N):
    if C[i]<1 or C[i]>20 or V[i]<1 or v[i]>20:
        print("error")
        sys.exit()

    # try:                                                                                           
    #     inp=dic[input('[Y]es/[N]o? >> ').lower()]                                                  
    #     break                                                                                      
    # except:                                                                                        
    #     pass                                                                                       

diff=0
max_profit=0



for i in range(N):
    # print(V[i],type(V[i]),C[i],type(C[i]))                                                         
    diff=V[i]-C[i]
    if diff >=0 :
        max_profit=max_profit+diff

print(max_profit)


### FIXED CODE ###

import sys

N=input()
if N.isdecimal() == 0 or int(N)<1 or int(N)>20 :
    print("error")
    sys.exit()

N=int(N)

V=list(map(int,input().strip().split()))
C=list(map(int,input().strip().split()))
# print(V[0],V[1],V[2])                                                                              

for i in range(N):
    if C[i]<1 or C[i]>50 or V[i]<1 or V[i]>50:
        print("error")
        sys.exit()

diff=0
max_profit=0



for i in range(N):
    # print(V[i],type(V[i]),C[i],type(C[i]))                                                         
    diff=V[i]-C[i]
    if diff >=0 :
        max_profit=max_profit+diff

print(max_profit)
h, w = map(int,input().split())
a = [list(map(int,input().split())) for i in range(h)]
b = [list(map(int,input().split())) for i in range(h)]

ab = [[0]*w for i in range(h)]
for ch in range(h):
    for cw in range(w):
        ab[ch][cw] = abs(a[ch][cw] - b[ch][cw])

ab0 = ab[0][0]
size = 80*(h+w)
dp = [[[False]*(1+size) for ww in range(w)] for hh in range(h)]
dp[0][0][size//2 + ab0] = True # size//2が0に相当
dp[0][0][size//2 - ab0] = True
for ch in range(h):
    for cw in range(w):
        for ck in range(1 + size): 
            if dp[ch][cw][ck]:
                if ch < h-1:
                    dp[ch+1][cw][ck + ab[ch+1][cw]] = True
                    dp[ch+1][cw][ck - ab[ch+1][cw]] = True
                if cw < w-1:
                    dp[ch][cw+1][ck + ab[ch][cw+1]] = True
                    dp[ch][cw+1][ck - ab[ch][cw+1]] = True

for i in range(1 + size//2):
    for j in [1, -1]:
        if dp[h-1][w-1][size//2 + i*j]:
            print(i)
            exit()

### FIXED CODE ###

h, w = map(int,input().split())
a = [list(map(int,input().split())) for i in range(h)]
b = [list(map(int,input().split())) for i in range(h)]

ab = [[0]*w for i in range(h)]
for ch in range(h):
    for cw in range(w):
        ab[ch][cw] = abs(a[ch][cw] - b[ch][cw])

ab0 = ab[0][0]
size = 80*(h+w)
dp = [[0]*w for hh in range(h)]
dp[0][0] |= 2**(size + ab0)
dp[0][0] |= 2**(size - ab0)
for ch in range(h):
    for cw in range(w):
        if ch < h-1:
            dp[ch+1][cw] |= dp[ch][cw] << ab[ch+1][cw]
            dp[ch+1][cw] |= dp[ch][cw] >> ab[ch+1][cw]
        if cw < w-1:
            dp[ch][cw+1] |= dp[ch][cw] << ab[ch][cw+1]
            dp[ch][cw+1] |= dp[ch][cw] >> ab[ch][cw+1]

a = dp[h-1][w-1]>>size
m = a&(-a)
print(m.bit_length()-1)
n=int(input())
a=list(map(int,input().split()))
print(abs(max(a)-min(a))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
print(abs(max(a)-min(a)))
H,W,D=map(int,input().split())
A=[]
for i in range(H):
    a=list(map(int,input().split()))
    A.append(a)
Q=int(input())
L=[]
R=[]

lst=[[]for _ in range(H*W+1)]
for i in range(H):
    for j in range(W):
        lst[A[i][j]].append(i)
        lst[A[i][j]].append(j)
#print(lst)
#print(lst[1][1])
d=[]
for i in range(D):

    if i==0:
        tmp=D
        cnt=[0]*(H*W+1)
        sx=lst[tmp][0]
        sy=lst[tmp][1]
        cnt[tmp]=0
    else:
        tmp=i
        cnt=[0]*(H*W+1)
        #print(tmp)
        sx=lst[tmp][0]
        sy=lst[tmp][1]
        cnt[i]=0
    while(1):
        sx=lst[tmp][0]
        sy=lst[tmp][1]
        tmp=tmp+D
        #print(tmp)
        x=lst[tmp][0]
        y=lst[tmp][1]
        val=abs(sx-x)+abs(sy-y)
        cnt[tmp]=cnt[tmp-D]+val
        if (tmp+D)>(H*W):
            break
    d.append(cnt)
ans=[]
#print(cnt)
#print(d)
for i in range(Q):
    l,r=map(int,input().split())
    ll=l%D
    count=d[ll]
    #print(count)
    vall=count[l]
    valr=count[r]
    val=valr-vall
    #print(val)
    ans.append(val)

for i in range(Q):
    print(ans[i])

### FIXED CODE ###

H,W,D=map(int,input().split())
A=[]
for i in range(H):
    a=list(map(int,input().split()))
    A.append(a)
Q=int(input())
L=[]
R=[]

lst=[[]for _ in range(H*W)]
for i in range(H):
    for j in range(W):
        lst[A[i][j]-1].append(i)
        lst[A[i][j]-1].append(j)
#print(lst)
#print(lst[1][1])
d=[]
for i in range(D):
    cnt=[0]
    for j in range(i+D,H*W,D):
        cnt.append(cnt[-1]+abs(lst[j][0]-lst[j-D][0])+abs(lst[j][1]-lst[j-D][1]))
    d.append(cnt)
ans=[]
#print(cnt)
#print(d)
for i in range(Q):
    l,r=map(int,input().split())
    ll=(l-1)%D
    count=d[ll]
    r-=1
    l-=1
    #print(count)
    vall=count[l//D]
    #print(l//D)
    #print(r//D)
    valr=count[r//D]
    val=valr-vall
    #print(val)
    ans.append(val)

for i in range(Q):
    print(ans[i])
a= int(input())
b= int(input())
print(a*b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
n,a,b = map(int,input().split())
x=n//(a+b)
y=n - x*(a+b)
if y >= a
    y=a
print(a*y+x)

### FIXED CODE ###

n,a,b = map(int,input().split())
x=n//(a+b)
y=n - x*(a+b)
if y >= a:
  y=a
print(a*x+y)
N, K, X, Y, = map(int, input().split())

if N <= K:
    answer = N * X
    print(answer)

else:
    answer = K * X + (N - K) * Y
    print(answer)



### FIXED CODE ###

N = int(input())    # 宿泊数
K = int(input())    # 単価が切り替わる泊数
X = int(input())    # 単価a
Y = int(input())    # 単価b


if N <= K:
    a = N * X
else:
    a = K * X + Y * (N - K)

print(a)
import fractions

from numba import njit
import numpy as np
from sys import stdin


@njit(cache=True)
def calc_ans(a, lcm):
    ans = 0

    for ai in a:
        ans += lcm // ai

    ans %= 10 ** 9 + 7

    return ans


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))
    sa = set(a)
    a = np.array(a)

    lcm = 1

    for ai in sa:
        lcm = (ai * lcm) // fractions.gcd(ai, lcm)

    print(calc_ans(a, lcm))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import fractions

from sys import stdin


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))
    sa = set(a)

    lcm = 1

    for ai in sa:
        lcm = (ai * lcm) // fractions.gcd(ai, lcm)

    ans = 0

    for ai in a:
        ans += lcm // ai
    ans %= 10 ** 9 + 7

    print(ans)


if __name__ == "__main__":
    main()
# D
N,C = map(int, input().split())
T_MAX = int(1e5)
t = [0]*(T_MAX+1)
for _ in range(N):
    si,ti,ci = map(int, input().split())
    t[si-1] += 1
    t[ti+1] -= 1
ans = 1
wa = 0
for ti in t:
    wa += ti
    ans = max(ans, wa)
print(ans)
    

### FIXED CODE ###

# D
N,C = map(int, input().split())
st = [[] for _ in range(C)]
for _ in range(N):
    si,ti,ci = map(int, input().split())
    st[ci-1].append((si,ti))
    
T_MAX = int(1e5)
imos = [0]*(T_MAX+1)
for ch in range(C):
    if st[ch]==[]: continue
    st[ch].sort()
    prev_s, prev_t = st[ch][0]
    for si,ti in st[ch][1:]:
        if si!=prev_t:
            imos[prev_s-1] += 1
            imos[prev_t] -= 1
        else:
            imos[prev_s-1] += 1
            imos[prev_t-1] -= 1
        prev_s,prev_t = si,ti
    else:
        imos[prev_s-1] += 1
        imos[prev_t] -= 1
# print(imos)
ans = 1
wa = 0
for imosi in imos:
    wa += imosi
    ans = max(ans, wa)
print(ans)
while True:
    m=input().split()
    h=int(m[0])
    w=int(m[1])
    if (a==0)&(b==0):
      break
    for i in range(h):
       print("#"*w)
    print()
    


### FIXED CODE ###

while True:
    v=input().split()
    a=int(v[0])
    b=int(v[1])
    if a==0 and b==0:
       break
    for i in range (a):
        print('#'*b)
    print()
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()

def segfunc(x, y):
    return max(x, y)

ide_ele = -1

class SegTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化 O(N)
    update(k, x): k番目の値をxに更新 O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
    """
    def __init__(self, init_val, segfunc, ide_ele):
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

    def update(self, k, x):
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1

    def query(self, l, r):
        res = self.ide_ele

        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res

seg = SegTree([0]*N, segfunc, ide_ele)
for _ in range(N):
    a = int(input())
    maxi = seg.query(max(0, a-K-1), min(N, a+K+1))
    seg.update(a-1, maxi+1)
print(seg.query(0, N))

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()

def segfunc(x, y):
    return max(x, y)

ide_ele = 0

class SegTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化 O(N)
    update(k, x): k番目の値をxに更新 O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
    """
    def __init__(self, init_val, segfunc, ide_ele):
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

    def update(self, k, x):
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1

    def query(self, l, r):
        res = self.ide_ele

        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res

size = 10**5*3+10
seg = SegTree([0]*size, segfunc, ide_ele)
for _ in range(N):
    a = int(input())
    maxi = seg.query(max(0, a-K), min(size, a+K+1))
    seg.update(a, maxi+1)
print(seg.query(0, size))
from collections import Counter
a=list(map(int,input().split()))
dic=Counter(a)
for i in dic.values():
	if i==2:
		print("Yes")
        exit()
print("No")


### FIXED CODE ###

from collections import Counter
a=list(map(int,input().split()))
dic=Counter(a)
for i in dic.values():
    if i==2:
        print("Yes")
        exit()
print("No")
input_list = raw_input.split()
output = x[0] for x in input_list
print ''.join(output)

### FIXED CODE ###

input_line1 = raw_input()
input_list = input_line1.split()
output = [x[0] for x in input_list]
print ''.join(output)
inf = 10**18

N,Ma,Mb = map(int,input().split())
abc = [list(map(int,input().split())) for _ in range(N)]
inf = 10**9
dp = [[inf for i in range(N*10)] for i in range(N*10)]
dp[0][0] = 0
max_a = 0
max_b = 0
for i in range(N):
    max_a += abc[i][0]
    max_b += abc[i][1]
    for ai in range(abc[i][0],max_a+1)[::-1]:
        for bi in range(abc[i][1],max_b+1)[::-1]:
            dp[ai][bi] = min(dp[ai][bi],dp[ai-abc[i][0]][bi-abc[i][1]]+abc[i][2])
ans = inf
for i in range(1,min(max_a//Ma,max_b//Mb)):
    ans = min(ans,dp[i*Ma][i*Mb])
if ans == inf:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

N,Ma,Mb = map(int,input().split())
abc = [list(map(int,input().split())) for _ in range(N)]
inf = 10**9
dp = [[inf for i in range(N*10+1)] for i in range(N*10+1)]
dp[0][0] = 0
max_a = 0
max_b = 0
for i in range(N):
    max_a += abc[i][0]
    max_b += abc[i][1]
    for ai in range(abc[i][0],max_a+1)[::-1]:
        for bi in range(abc[i][1],max_b+1)[::-1]:
            dp[ai][bi] = min(dp[ai][bi],dp[ai-abc[i][0]][bi-abc[i][1]]+abc[i][2])
ans = inf
for i in range(1,min(max_a//Ma,max_b//Mb)):
    ans = min(ans,dp[i*Ma][i*Mb])
if ans == inf:
    print(-1)
else:
    print(ans)
import math

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

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

a = int((A - 1) / C)
b = int(B / C)

c = int((A - 1) / D)
d = int(B / D)

l = lcm(C, D)

e = int((A - 1) / l)
f = int(B / l)

res = (B - A + 1) - ((b - a) + (d - c)) + (f - e)

print(res)

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

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

a = (A - 1) // C
b = B // C

c = (A - 1) // D
d = B // D

l = lcm(C, D)

e = (A - 1) // l
f = B // l
    
res = (B - A + 1) - ((b - a) + (d - c) - (f - e))

print(res)
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations, permutations
from copy import deepcopy
import sys
import numpy as np
sys.setrecursionlimit(4100000)
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


if __name__ == '__main__':
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    mod = len(A)%K
    prev = None
    L = 0

    for i in range(N-K+1):
        check = A[i:i+K]
        if i==0:
            acc = 1
            for c in check:
                acc *= c
                prev = acc
        else:
            acc = 1
            for c in check:
                acc *= c
            if prev<acc:
                print("Yes")
            else:
                print("No")
            prev = acc

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
ACC = []
ACC.append(0)
sum = 0
for a in A:
    sum += a
    ACC.append(sum)


L = N-K+1
prev = ACC[K] - ACC[0]
for i in range(1, L):
    score = ACC[i+K] - ACC[i] 
    if prev < score:
        print("Yes")
    else:
        print("No")
    prev = score
A = int(input())
B = int(input())
H = int(input())
M = int(input())

t = H * 60 + M
CC = A**2 + B **2 - 2 * A * B * math.cos(((pi/60)-(pi/360))*t)
print(c ** (1/2))

### FIXED CODE ###

import math
 
PI = math.pi
A, B, H, M = map(int, input().split())
 
arg_a = (float(H) + float(M)/60) / 12.0 * 360
arg_b = float(M) / 60.0 * 360
 
 
C = math.sqrt(A*A + B*B - 2*A*B* math.cos((arg_a-arg_b)/360*2*PI))
print(C)
import math
a, b, c = map(int, input().split())

if (4 * math.sqrt(a * b)) < (c - a - b):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(a[K-1])
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = dict(sorted(s.items(), key=lambda x: x[1]))
m = s.values()[0]

ans = []
for i in s:
  if s[i] == m:
    ans.append(i)

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

### FIXED CODE ###

class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = list(sorted(s.items(), key=lambda x: -x[1]))
m = s[0][1]

ans = []
for key, value in s:
  if value == m:
    ans.append(key)
  else:
    break

ans.sort()

print('\n'.join(ans))
import math


def inputIntList():
    return [int(s) for s in input().split()]


def inputInt():
    return int(input())


def main():
    N, K = inputIntList()
    h = inputIntList()
    h.extend([0] * K)
    dp = [float("inf") for _ in range(N + K)]
    dp[0] = 0
    for i in range(N):
        for k in range(1, K + 1):
            if abs(h[i] - h[i + k]) + dp[i] < dp[i + k]:
                dp[i + k] = abs(h[i] - h[i + k]) + dp[i]
        # print(dp)
    return dp[N - 1]


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


### FIXED CODE ###

import math


def inputIntList():
    return [int(s) for s in input().split()]


def inputInt():
    return int(input())


def main():
    N = inputInt()
    h = inputIntList()
    h.append(0)
    dp = [float("inf") for _ in range(N + 2)]
    dp[0] = 0
    for i in range(N - 1):
        if abs(h[i] - h[i + 1]) + dp[i] < dp[i + 1]:
            dp[i + 1] = abs(h[i] - h[i + 1]) + dp[i]

        if abs(h[i] - h[i + 2]) + dp[i] < dp[i + 2]:
            dp[i + 2] = abs(h[i] - h[i + 2]) + dp[i]

    return dp[N - 1]


if __name__ == "__main__":
    print(main())
N = int(input())
S = input() 
print('Yes' if N%2==0 and S[:a]==S[a:] else 'No')

### FIXED CODE ###

N = int(input())
S = input() 
a=int(N/2)
if N%2==0 and S[:a]==S[a:]:
    print('Yes')
else:
    print('No')
N, A, B, C, D = map(int, input().split())
s = list(input())

A -= 1
B -= 1
C -= 1
D -= 1


def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == '#':
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans

ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
#s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)
 
N, A, B, C, D = map(int, input().split())
s = list(input())
 
A -= 1
B -= 1
C -= 1
D -= 1
 
for i in range(len(s)):
    if i == len(s) - 1:
        continue
    else:
        if s[i] == '#' and s[i+1] == '#' and max(C, D) < i and i <= C:
            print("No")
            exit()
 
if D < C:
    tmp = 0
    for i in range(len(s)):
        if i == len(s) - 2 or i == len(s) - 1:
            continue
        else:
            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' and B <= i + 1 <= D:
                tmp = 1
    if tmp != 1:
        print("No")
        exit()
 
 
 
def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == '#':
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans
 
ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
#s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")
a=input()
if a%2==0:
  for i in range(int(len(a)/2)):
    if a[2*i]=="R" or a[2*i]=="U" or a[2*i]=="D":
      b=b+1
    if a[2*i+1]=="L" or a[2*i+1]=="U" or a[2*i+1]=="D":
      b=b+1
  if b=len(a):
    print("Yes")
  else:
    print("No")
if a%2==1:
  for i in range(int(len(a)/2)+1):
    if a[2*i]=="R" or a[2*i]=="U" or a[2*i]=="D":
      b=b+1
  for i in range(int(len(a)/2)):
    if a[2*i+1]=="L" or a[2*i+1]=="U" or a[2*i+1]=="D":
      b=b+1
  if b=len(a):
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

a=input()
b=0
if (len(a))%2==0:
  for i in range(int(len(a)/2)):
    if a[2*i]=="R" or a[2*i]=="U" or a[2*i]=="D":
      b=b+1
    if a[2*i+1]=="L" or a[2*i+1]=="U" or a[2*i+1]=="D":
      b=b+1
  if b==len(a):
    print("Yes")
  else:
    print("No")
if (len(a))%2==1:
  for i in range(int(len(a)/2)+1):
    if a[2*i]=="R" or a[2*i]=="U" or a[2*i]=="D":
      b=b+1
  for i in range(int(len(a)/2)):
    if a[2*i+1]=="L" or a[2*i+1]=="U" or a[2*i+1]=="D":
      b=b+1
  if b==len(a):
    print("Yes")
  else:
    print("No")
N = int(input())
A = int(input())
B = int(input())

i = 0
for i in range(N +1)
    if A <= sum( [int(s) for s in str(i)] ) <= B:
        i = i+1
print(i)

### FIXED CODE ###

n, a, b = map(int, input().split())
c = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        c += i
print(c)
import heapq

n,m = map(int,input().split())
a_list = list(map(int,input().split()))
move = [list(map(int,input().split())) for _ in range(m)]

heapq.heapify(a_list)
a_list = sorted(a_list, key=lambda x: x[1],reverse=True)

for elem in move:
    for i in range(elem[0]):
        _min = heapq.heappop(a_list)
        if _min < elem[1]:
            heapq.heappush(a_list,elem[1])
        else:
            heapq.heappush(a_list,_min)
            break

print(sum(a_list))

### FIXED CODE ###

import heapq

n,m = map(int,input().split())
a_list = list(map(int,input().split()))
move = [list(map(int,input().split())) for _ in range(m)]

heapq.heapify(a_list)
move = sorted(move, key=lambda x: x[1],reverse=True)

for elem in move:
    for i in range(elem[0]):
        _min = heapq.heappop(a_list)
        if _min < elem[1]:
            heapq.heappush(a_list,elem[1])
        else:
            heapq.heappush(a_list,_min)
            break

print(sum(a_list))
string = str(input())

def take_zero_one(target, cnt=0):
    if len(target) <= 1:
        return (target, cnt)
    elif len(set(target)) == 1:
        return (target, cnt)

    prev = target[0]
    idx = 1
    while idx < len(target):
        if prev != target[idx]:
            cnt += 2
            remaining = target[:idx-1] + target[idx+1:]
            break

        prev = target[idx]
        idx += 1

    remaining, cnt = take_zero_one(remaining, cnt)

    return (remaining, cnt)

_, cnt = take_zero_one(string)
print(cnt)

### FIXED CODE ###

string = str(input())
zero = 0
one = 0
chars = set(string)
for char in string:
    if char == list(chars)[0]:
        zero += 1
    else:
        one += 1

if zero == 0 or one == 0:
    print(0)
else:
    print(min(zero, one) * 2)
a,b,c=map(int,list(input(),split()))
if a==1:
  a=9
elif a==9:
  a=1
if b==1:
  b=9
elif b==9:
  b=1
if c==1:
  c=9
elif c==9:
  c==1
print({}{}{}.format(a,b,c))

### FIXED CODE ###

a=int(input())
print(1110-a)