Harryxun/stf_run huggingface dataset:
N, M = map(int,input().split())

tg = [input() for _ in range(N)]

#tmpl0〜M-1
tmpl = [input() for _ in range(M)]

#tg0〜N-Mにつき、tmpl0を探し、一致したら同じ添字のtmpl1~M-1を探す
for i in range(0,N-M+1):
  for j in range(0,N-M+1):
    if tmpl[0] == tg[i][j:j+M]:
      if N == 1:
        print('Yes')
        exit()
      for k in range(i+1,i+M):
        if tmpl[k] != tg[i+k][j:j+M]: break
      else:
        print('Yes')
        exit()
print('No')


### FIXED CODE ###

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

tg = [input() for _ in range(N)]

#tmpl0〜M-1
tmpl = [input() for _ in range(M)]

#tg0〜N-Mにつき、tmpl0を探し、一致したら同じ添字のtmpl1~M-1を探す
for i in range(0,N-M+1):
  for j in range(0,N-M+1):
    if tmpl[0] == tg[i][j:j+M]:
      if N == 1:
        print('Yes')
        exit()
      for k in range(1,M):
        if tmpl[k] != tg[i+k][j:j+M]: break
      else:
        print('Yes')
        exit()
print('No')
a = input()
b = input()

ans1 = a * b
ans2 = 2 * ( a + b )

print ans1,
print ' ',
print ans2

### FIXED CODE ###

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

ans1 = a * b
ans2 = 2 * ( a + b )

print ans1 , ans2
import sys
readline = sys.stdin.buffer.readline
r1,c1,r2,c2 = map(int,readline().split())
mod = 10**9+7
def pow(n,p,mod=10**9+7): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod
def factrial_memo(n=2*10**6+1,mod=10**9+7):
    fact = [1, 1]
    for i in range(2, n + 1):
        fact.append((fact[-1] * i) % mod)
    return fact
def fermat_cmb(n, r, mod=10**9+7): #needs pow,factrial_memo(only fact). return nCk
    return fact[n] * pow(fact[r],mod-2) * pow(fact[n-r],mod-2) %mod
fact = factrial_memo()
r1,c1,r2,c2 = r1+1,c1+1,r2+1,c2+1
al = fermat_cmb(r2+c2,r2)
sub_r = fermat_cmb(r1-1+c2,r1-1)
sub_c = fermat_cmb(r2+c1-1,c1-1)
add_rc = fermat_cmb(r1-1+c1-1,r1-1)

al -= sub_r+sub_c
al += add_rc

print(al%mod)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline
r1,c1,r2,c2 = map(int,readline().split())
mod = 10**9+7
def pow(n,p,mod=10**9+7): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod
def factrial_memo(n=3*10**6+1,mod=10**9+7):
    fact = [1, 1]
    for i in range(2, n + 1):
        fact.append((fact[-1] * i) % mod)
    return fact
def fermat_cmb(n, r, mod=10**9+7): #needs pow,factrial_memo(only fact). return nCk
    return fact[n] * pow(fact[r],mod-2) * pow(fact[n-r],mod-2) %mod
fact = factrial_memo()
r1,c1,r2,c2 = r1+1,c1+1,r2+1,c2+1
al = fermat_cmb(r2+c2,r2)
sub_r = fermat_cmb(r1-1+c2,r1-1)
sub_c = fermat_cmb(r2+c1-1,c1-1)
add_rc = fermat_cmb(r1-1+c1-1,r1-1)

al -= sub_r+sub_c
al += add_rc

print(al%mod)
from collections import Counter

n = int(input())
v = list(map(int, input().split(' ')))

v1 = v[::2]
v2 = v[1::2]

counter1 = Counter(v1)
x1 = counter1.most_common()[0][0]
counter2 = Counter(v2)
x2 = counter2.most_common()[0][0]

x1_count = counter1.most_common()[0][1]
x2_count = counter2.most_common()[0][1]

n = n//2
ans = 0
if x1 == x2:
    if x1_count > x2_count:
        ans = (n - x1_count) + (n - counter2.most_common()[1][1])
    else:
        ans = (n - x2_count) + (n - counter1.most_common()[1][1])
else:
    ans = (n - x1_count) + (n - x2_count)
print(ans)

### FIXED CODE ###

from collections import Counter

n = int(input())
v = list(map(int, input().split(' ')))

v1 = v[::2]
v2 = v[1::2]

counter1 = dict(Counter(v1))
counter2 = dict(Counter(v2))
x1 = max(counter1, key=counter1.get)
x2 = max(counter2, key=counter2.get)
x1_c = counter1[x1]
x2_c = counter2[x2]
del counter1[x1]
del counter2[x2]
y1_c = 0
y2_c = 0
if len(counter1) != 0:
    y1_c = max(counter1.values())
if len(counter2) != 0:
    y2_c = max(counter2.values())

n = n//2
ans = 0
if x1 == x2:
    ans = min((n - x1_c) + (n - y2_c), (n - y1_c) + (n - x2_c))
    """
    if x1_c > x2_c:
        ans = (n - x1_c) + (n - y2_c)
    else:
        ans =  (n - y1_c) + (n - x2_c)
    """
else:
    ans = (n - x1_c) + (n - x2_c)

print(ans)
K=int(input())
N=int(input())
li=[]
for i in range(0,K):
  fruit=int(input())
  li.append(fruit)
  li.sort()
  sum1=0
  for i in range(0,N):
    sum1=sum1+li[i]
  print(sum1) 

### FIXED CODE ###

K, N = (map(int,input().split()))
li=list(map(int,input().split()))
li.sort()
sum1=0
for i in range(0,N):
    sum1=sum1+li[i]
print(sum1)
import math

a , b , h, m = map(int , input())

x = 360/12
y = ((h/12)+(m/45))*x
z = math.radians(y)
ans = (a**2+b**2)-2*a*b*cos(z)

print(ans)

### FIXED CODE ###

import math
a, b, h, m = map(int, input().split())
     
mr = 6*m
hr = 360*(h/12+m/720)
r = math.radians(abs(mr-hr))
ans = math.sqrt((a**2)+(b**2)-2*a*b*math.cos(r))
print(ans)
A, B = map(int, input().split())

res1 = A + B
res2 = A - B
res3 = A * B

if res1 > res2:
  if (res1 > res3):
    return res1
  else:
  	return res3
else:
  if (res2 > res3):
    return res2
  else:
    return res3
    


### FIXED CODE ###

A, B = map(int, input().split())
 
res1 = A + B
res2 = A - B
res3 = A * B
 
if res1 > res2:
  if (res1 > res3):
    print (res1)
  else:
  	print (res3)
else:
  if (res2 > res3):
    print (res2)
  else:
    print (res3)
N, D = map(int, input())
x = N//((2*D)+1)
if(x*((2*D)+1)>= N):
	print(N//((2*D)+1))
else:
	print((N//((2*D)+1)+1))

### FIXED CODE ###

N, D = map(int, input().split())
x = N//((2*D)+1)
if(x*((2*D)+1)>= N):
	print(N//((2*D)+1))
else:
	print((N//((2*D)+1)+1))
a = input()
count = 0

for i in range(len(a)):
  if i = 'R':
    count += 1

print(count)

### FIXED CODE ###

a = str(input())

if a[0] == 'R' and a[1] == 'R' and a[2] == 'R':
  print(3)
elif a[1] == 'R' and a[2] == 'R' and a[0] != 'R':
  print(2)
elif a[0] == 'R' and a[1] == 'R' and a[2] != 'R':
  print(2)
elif 'R' not in a:
  print(0)
else:
  print(1)
n=input()
lst=map(int,input().split())

print(min(lst),max(lst),sum(lst))


### FIXED CODE ###

n=input()
lst=[int(x) for x in input().split()]
print(min(lst),max(lst),sum(lst))
from _collections import deque
h,w,k=map(int,input().split())
S=[input() for _ in range(h)]
A=deque([])
cnt=1

def func(X):
    global cnt
    ANS=''
    c=X.count('#')
    a=0
    for x in X:
        ANS+=str(cnt)
        if x=='#':
            cnt+=1
            a+=1
            if a==c:
                ANS+=str(cnt-1)*(w-len(ANS))
                break
    A.append(ANS)



for i in range(h):
    if S[i].count('#')==0 and i!=0:
        A.append(A[-1])
    elif S[i].count('#')!=0:
        func(S[i])

if S[0].count('#')==0:
    A.appendleft(A[0])

for ans in A:
    print(*[int(n) for n in ans])

### FIXED CODE ###

from _collections import deque
h,w,k=map(int,input().split())
S=[input() for _ in range(h)]
A=deque([])
cnt=1

def func(X):
    global cnt
    ANS=[]
    c=X.count('#')
    a=0
    for x in X:
        ANS.append(cnt)
        if x=='#':
            cnt+=1
            a+=1
            if a==c:
                for _ in range(w-len(ANS)):
                    ANS.append(cnt-1)
                break
    A.append(ANS)



for i in range(h):
    if S[i].count('#')==0 and i!=0 and len(A)!=0:
        A.append(A[-1])
    elif S[i].count('#')!=0:
        func(S[i])

if len(A)!=h:
    for _ in range(h-len(A)):
        A.appendleft(A[0])

for ans in A:
    print(*ans)
n = int(input())
a = map(int, input().split())
s = sum(a)
k = 1 - a[0]
ans = 1

for i in range(1,n+1):
  if k*2 <= s:
    k *= 2
  else:
    k = s
  ans += k
  k -= a[i]
  s -= a[i]

if k == 0 and s == 0:
  print(ans)
else:
  print(-1)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = sum(a)
k = 1-a[0]
s -= a[0]
ans = 1

for i in range(1,n+1):
  if k*2 <= s:
    k *= 2
  else:
    k = s
  ans += k
  k -= a[i]
  s -= a[i]

if k == 0 and s == 0:
  print(ans)
else:
  print(-1)
def main():
    N, Q = [int(i) for i in input().split()]
    E = [tuple(int(i) for i in input().split()) for _ in range(N - 1)]
    V = [set() for _ in range(N)]
    for a, b in E:
        V[a - 1].add(b - 1)
        V[b - 1].add(a - 1)
    O = [tuple(int(i) for i in input().split()) for _ in range(Q)]
    C = [0] * N
    for p, x in O:
        C[p - 1] += x
    def add(n, x):
        C[n] += x
        for c in V[n]:
            V[c].remove(n)
            add(c, C[n])
    add(0, 0)
    print(' '.join(str(c) for c in C))

main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def main():
    N, Q = [int(i) for i in input().split()]
    V = [set() for _ in range(N)]
    for _ in range(N - 1):
        a, b = [int(i) - 1 for i in input().split()]
        V[a].add(b)
        V[b].add(a)
    C = [0] * N
    for _ in range(Q):
        p, x = [int(i) for i in input().split()]
        C[p - 1] += x
    cur = [(0, 0)]
    while cur:
        nxt = []
        for n, x in cur:
            C[n] = x = C[n] + x
            for c in V[n]:
                V[c].remove(n)
                nxt.append((c, x))
        cur = nxt
    print(' '.join(str(c) for c in C))

main()
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()

A = []
tmp = 0
for i in range(1, X):
    tmp += i
    A.append(tmp)
    if tmp > X:
        break

for i in range(1, len(A)+1):
    tmp += i
    if X <= A[i]:
        print(i+1)
        break


### FIXED CODE ###

import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()

A = []
tmp = 0
for i in range(1, X+1):
    tmp += i
    A.append(tmp)
    if tmp >= X:
        print(i)
        break
import scipy.misc.comb
n = int(input())
h = list(map(int, input().split()))
def triangle(n,h):
    x = comb(n, 3, exact = True)
    for i in range(0,n-2):
        for j in range(i+1,n-1):
            for k in range(j+1, n):
                if h[i] >= h[j] + h[k] or h[j] >= h[i] + h[k] or h[k] >= h[j] + h[i]:
                    x = x - 1
    return x
print(triangle(n,h))

### FIXED CODE ###

import bisect
N = int(input())
#ソートしておく
L = sorted(list(map(int, input().split())))
ans = 0
 
#短い2辺を総当たりで選択
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    #小さい順に並べた時の成立条件
    # l1 + l2 > l3
    l12 = L[i] + L[j]
    #l2の隣から　l12以下のところまで全部が対象、成立しない場合
    #ans += max(bisect.bisect_left(L, l12) - j - 1, 0)
    ans += bisect.bisect_left(L, l12) - j - 1
print(ans)
from sys import exit

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())

k = [-1]*N
for i in range(M):
    s,c = S[i],C[i]
    if k[s-1]==-1:
        k[s-1] = c
    else:
        if k[s-1]!=c:
            print(-1)
            exit()

ans = [0]*N
for i in range(N):
    if k[i]==-1:
        ans[i] = 0
    else:
        ans[i] = k[i]


if N==1:
    if mask[0]==1:
        print(ans[0])
    else:
        print(-1)
    exit()

if ans[0]==0:
    print(-1)
    exit()

print(*ans,sep='')

### FIXED CODE ###

from sys import exit

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())

k = [-1]*N
for i in range(M):
    s,c = S[i],C[i]
    if k[s-1]==-1:
        k[s-1] = c
    else:
        if k[s-1]!=c:
            print(-1)
            exit()

ans = [0]*N
for i in range(N):
    if k[i]==-1:
        ans[i] = 0
    else:
        ans[i] = k[i]


if N==1:
    print(ans[0])
    exit()

if ans[0]==0:
    f=True
    for i,j in zip(S,C):
        if i==1 and j==0:
            f = False
            break
    if f:
        ans[0] = 1
    else:
        print(-1)
        exit()

print(*ans,sep='')
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

def buffet(N,x,y,z):
  a = sum(y)
  for i in range(N-1):
    if x[i+1] - x[i] == 1:
      a = a + z[i+1]
  print(a)

if __name__ == '__main__':
  buffet(N,A,B,C)

### FIXED CODE ###

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

def buffet(N,x,y,z):
  a = sum(y)
  for i in range(N-1):
    if x[i+1] - x[i] == 1:
      a = a + z[x[i]-1]
  print(a)

if __name__ == '__main__':
  buffet(N,A,B,C)
N, M, P = map(int, input().split())

class Edge:
    def __init__(self, from_, to_, point):
        self.from_, self.to_, self.point = from_, to_, point
    
edge_list = [Edge(*[int(s)for s in input().split()]) for _ in range(M)]
end_point = max(edge.to_ for edge in edge_list)
end_edge_list = [edge for edge in edge_list if edge.to_ == end_point]


def backToStart(edge, T=1, via=[], infinite=False):
    if edge.from_ == 1:
        return edge, T, via, infinite
    if edge.to_ == edge.from_:
        if edge.point - P > 0:
            ls = [edge_ for edge_ in edge_list if edge_.to_ == edge.from_ and edge_.to_ != edge_.from_]
            if len(ls) == 1:
                return backToStart(ls[0], T+1, infinite=True)
            else:
                return [backToStart(edge, T+1, infinite=True) for edge in ls]
        else:
            return "DEADEND"
    edge_list_ = [edge_ for edge_ in edge_list if edge_.to_ == edge.from_]
    via_ = via[:]
    via_.append(edge)
    if len(edge_list_) == 1:
        return backToStart(edge_list_[0], T+1, via_)
    else:
        return [backToStart(edge, T+1, via_) for edge in edge_list_]

def multiEdges(edge_list):
    return [backToStart(edge) for edge in edge_list]

origin_edge_list = multiEdges(end_edge_list)

# print(origin_edge_list)

while True:
    if 'DEADEND' in origin_edge_list:
        origin_edge_list.remove('DEADEND')
    elif [] in origin_edge_list:
        origin_edge_list.remove([])
    else:
        break

def hoge():
    point_list = []
    for route in origin_edge_list:
        if route[3]:
            return -1
        ls = route[2][:]
        ls.append(route[0])
        point_list.append(sum(e.point for e in ls) - route[1] * P)
    return point_list

ans = hoge()
if isinstance(ans, int):
    print(ans)
else:
    ans.append(0)
    print(max(ans))


### FIXED CODE ###

import sys
input = sys.stdin.readline
n, m, p = map(int, input().split())
edges = []
forward_edges = [[] for _ in range(n)]
for _ in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    edges.append((a, b, p-c))
    forward_edges[a].append(b)


can_reach = [0]*n
stack = [0]
while stack:
    v = stack.pop()
    if can_reach[v]:
        continue
    can_reach[v] = 1
    for v2 in forward_edges[v]:
        if can_reach[v2]:
            continue
        stack.append(v2)


INF = 10**10
dist = [INF]*n
dist[0] = 0
for i in range(n):
    for v, v2, c in edges:
        if dist[v2] <= dist[v]+c:
            continue
        dist[v2] = dist[v]+c

negative = [0]*n
for i in range(n):
    for v, v2, c in edges:
        if dist[v2] <= dist[v]+c:
            continue
        if not can_reach[v2]:
            continue
        dist[v2] = -INF
        negative[v2] = 1

if negative[-1]:
    print(-1)
else:
    print(max(0, -dist[-1]))
N = int(input())

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



b = sorted(list(set(A)))

x = set(b)

res = x

if b[0]==1:
    print(1)
    exit()

if b[0]==b[-1]:
    print(0)
    exit()


daburi = {}
for i in range(1,N):
    if b[i] == b[i-1]:
        daburi.add(b[i])


i = 0
while len(x) > 0 :
    tmp = b[i]
    for j in range(2,10**5+3):
        c = tmp* j
        if c in x:
            x.discard(c)
        if b[-1] <= c:
            break
    if len(x) == i:
        break
    i+=1
        

print(len(x)- len(daburi))


### FIXED CODE ###

N = int(input())

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


b = sorted(list(A))
dp = [0]*(max(A)+1)

m_a = max(A)+1
for i in b:
    dp[i] += 1
    if dp[i]==1 :
        for j in range(i*2, m_a,i):
            dp[j] +=100

print(dp.count(1))
N_str, q_str = raw_input().spilit()
N = int(N_str)
q = int (q_str)
A =[]
B =[]
total =0

for i in N:
    t = raw_input().spilit()
    A.append(t[0],int(t[1]))

while A:
    name, time = A.pop(0)
    if time <= q:
        total += time
        B.append(name+" "+ str(total))
       
    else:
        time -= q
        total += q
        A.append([name, time])

print '\n'.join(B)

### FIXED CODE ###

N_str, q_str = raw_input().split()
N = int(N_str)
q = int (q_str)
A =[]
B =[]
total =0

for i in range(N):
    t = raw_input().split()
    A.append([t[0],int(t[1])])

while A:
    name, time = A.pop(0)
    if time <= q:
        total += time
        B.append(name+" "+ str(total))
       
    else:
        time -= q
        total += q
        A.append([name, time])

print '\n'.join(B)
x, y = int(input().split())
print(x + (y//2))

### FIXED CODE ###

x, y = map(int, input().split())
print(x + (y//2))
import sys
N = int(input())
A = [int(x) for x in input().split()]

def solve(N, A):
    S = 0
    C = [A[0]]
    for i in range(1,N):
        if A[i] == C[-1]:
            continue
        C.append(A[i])
    A = C
    C = [(A[0], '-' if A[0] <A[1] else '+')]
    for i in range(1,len(A)-1):
        if C[-1] ==  A[i]:
            continue
        if A[i-1] > A[i] <= A[i+1]:
            C.append((A[i], "-"))
        elif A[i-1] < A[i] >= A[i+1]:
            C.append((A[i], "+"))
    if C[-1][0] != A[-1]:
        C.append((A[-1], '+' if A[-1] > C[-1][0] else '-'))

    S = 0
    m = 1000
    if C and C[0][1] == '+':
        C = C[1:]
    if C and C[-1][1] == '-':
        C = C[:-1]
    #print(C,file=sys.stderr) 

    for p, s in C:
        m_ = m
        S_ = S
        if s == '+':
            m += p * S 
            S = 0
        else:
            # buy stock
            m -= (m_ // p) * p
            S = (m_ // p)
        #print(s, p, "money(%d -> %d)"%(m_, m), "stock(%d -> %d)"% (S_, S))
    print(m)

solve(N, A)




### FIXED CODE ###

import sys
N = int(input())
A = [int(x) for x in input().split()]

def solve(N, A):
    S = 0
    C = [A[0]]
    for i in range(1,N):
        if A[i] == C[-1]:
            continue
        C.append(A[i])
    A = C
    if len(C) == 1:
        print(1000)
        return
    C = [(A[0], '-' if A[0] <A[1] else '+')]

    for i in range(1,len(A)-1):
        if C[-1] ==  A[i]:
            continue
        if A[i-1] > A[i] <= A[i+1]:
            C.append((A[i], "-"))
        elif A[i-1] < A[i] >= A[i+1]:
            C.append((A[i], "+"))
    if C[-1][0] != A[-1]:
        C.append((A[-1], '+' if A[-1] > C[-1][0] else '-'))

    S = 0
    m = 1000
    if C and C[0][1] == '+':
        C = C[1:]
    if C and C[-1][1] == '-':
        C = C[:-1]
    #print(C,file=sys.stderr) 

    for p, s in C:
        m_ = m
        S_ = S
        if s == '+':
            m += p * S 
            S = 0
        else:
            # buy stock
            m -= (m_ // p) * p
            S = (m_ // p)
        #print(s, p, "money(%d -> %d)"%(m_, m), "stock(%d -> %d)"% (S_, S))
    print(m)

solve(N, A)
mountain=[]
for i in range(10):
 mountain[i]=int(input())
mountain.sort()
for i in range(3):
 print(mountain[i])
 

### FIXED CODE ###

mountain=[]
for i in range(10):
 mountain.append(int(input()))
mountain.sort()
mountain.reverse()
for i in range(3):
 print(mountain[i])
count = 0       #初期値を0とするcount変数を作る.
n,k = map(int,input().split())      #整数とn進数を入力する。

while True:         #nをkで割った商が0になるまでcountに1を足し続ける。
    count = count +1
    n, amari = divmod(n,k)
    if n == 0:
        break

print(count)

### FIXED CODE ###

n,r=map(int,input().split())

if n >= 10:
  print(r)
else:
	in_rate = r + 100 * (10-n)
	print(in_rate)
int(input())

if ((x%100)+4)//5 > x//100:
    print(0)
else:
    print(1)



### FIXED CODE ###

x = int(input())
while(x>=0):
    if x%100==0:
        print("1")
        break
    elif x<100:
        print("0")
        break
    elif x%100>=5:
        x -= 105
        continue
    else:
        x-=(x%100)+100
        continue
s, w = int(input()).split()
if w >= s:
  print("unsafe")
else:
  print("safe")

### FIXED CODE ###

s, w= map(int, input().split())
if w >= s:
  print("unsafe")
else:
  print("safe")
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
#N = I()
#A = [LI() for _ in range(N)]

a,b = MI()

if a % 2 == 0:
    if b % 2 == 0:
        if (b-a) % 4 == 2:
            print(b + 1)
        else:
            print(b)
    else:
        if (b-a) % 4 == 1:
            print(1)
        else:
            print(0)
else:
    if b % 2 == 0:
        if (b-a) % 4 == 1:
            bst = bin(b)
            ast = bin(a)
            anst = '0b'
            if len(bst) - len(ast) > 0:
                for i in range(len(bst) - len(ast)):

                    anst += bst[2+i]
            for i in range(len(ast) -2):
                if ast[-len(ast) + 2 + i] == bst[-len(ast) + 2 + i]:
                    anst += '0'
                else:
                    anst += '1'
                aa = int(anst[2:],2)
            print(aa)

        else:
            print(aa+1)
    else:
        if (b-a) % 4 == 2:
            print(a-1)
        else:
            print(a)

### FIXED CODE ###

import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
#N = I()
#A = [LI() for _ in range(N)]

a,b = MI()

if a % 2 == 0:
    if b % 2 == 0:
        if (b-a) % 4 == 2:
            print(b + 1)
        else:
            print(b)
    else:
        if (b-a) % 4 == 1:
            print(1)
        else:
            print(0)
else:
    if b % 2 == 0:
        if (b-a) % 4 == 1:
            bst = bin(b)
            ast = bin(a)
            anst = '0b'
            if len(bst) - len(ast) > 0:
                for i in range(len(bst) - len(ast)):

                    anst += bst[2+i]
            for i in range(len(ast) -2):
                if ast[-len(ast) + 2 + i] == bst[-len(ast) + 2 + i]:
                    anst += '0'
                else:
                    anst += '1'
                aa = int(anst[2:],2)
            print(aa)

        else:
            bst = bin(b)
            ast = bin(a)
            anst = '0b'
            if len(bst) - len(ast) > 0:
                for i in range(len(bst) - len(ast)):
                    anst += bst[2 + i]
            for i in range(len(ast) - 2):
                if ast[-len(ast) + 2 + i] == bst[-len(ast) + 2 + i]:
                    anst += '0'
                else:
                    anst += '1'
                aa = int(anst[2:], 2)
            print(aa - 1)
    else:
        if (b-a) % 4 == 2:
            print(a-1)
        else:
            print(a)