Harryxun/stf_run huggingface dataset:
import sys
readline = sys.stdin.readline
def partition(A, p, r):
    x = A[r][1]
    i = p - 1
    for j in range(p, r):
        if A[j][1] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i + 1], A[r] = A[r], A[i + 1]
    return i + 1
def quicksort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)
def isStable(A):
    for i in range(0, len(A) - 1):
        if A[i][1] == A[i + 1][1]:
            if A[i][2] > A[i + 1][2]:
                return False
    return True
n = int(input())
f = lambda a: (a[0], int(a[1]))
A = [f(readline().split()) + (i) for i in range(n)]
quicksort(A, 0, n - 1)
print("Stable" if isStable(A) else "Not stable")
print("\n".join(f"{a} {b}" for a, b, c in A))



### FIXED CODE ###

import sys
readline = sys.stdin.readline
def partition(A, p, r):
    x = A[r][1]
    i = p - 1
    for j in range(p, r):
        if A[j][1] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i + 1], A[r] = A[r], A[i + 1]
    return i + 1
def quicksort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)
def isStable(A):
    for i in range(0, len(A) - 1):
        if A[i][1] == A[i + 1][1]:
            if A[i][2] > A[i + 1][2]:
                return "Not stable"
    return "Stable"
n = int(input())
f = lambda a, i: (a[0], int(a[1]), i)
A = [f(readline().split(), i) for i in range(n)]
quicksort(A, 0, n - 1)
print(isStable(A))
print("\n".join(f"{a} {b}" for a, b, c in A))
import numpy as np
n=int(input())
mod=10**9+7
def searchPrimeNum(N):
    max = int(np.sqrt(N))
    searchList = [i for i in range(2,N+1)]
    primeNum = []
    while searchList[0] <= max:
        primeNum.append(searchList[0])
        tmp = searchList[0]
        searchList = [i for i in searchList if i % tmp != 0]
    primeNum.extend(searchList)
    return primeNum
l=len(searchPrimeNum(n))
plist=searchPrimeNum(n)
cnt=[0]*l
for i in range(l):
  k=1 
  while plist[i]**k<n:
    cnt[i]+=n//(plist[i]**k)
    k+=1
ans=1
for i in cnt:
  ans=(ans*(i+1))%mod
print(ans)


### FIXED CODE ###

import sys
import numpy as np
n=int(input())
mod=10**9+7
if n==1:print(1);sys.exit()
def searchPrimeNum(N):
    max = int(np.sqrt(N))
    searchList = [i for i in range(2,N+1)]
    primeNum = []
    while searchList[0] <= max:
        primeNum.append(searchList[0])
        tmp = searchList[0]
        searchList = [i for i in searchList if i % tmp != 0]
    primeNum.extend(searchList)
    return primeNum
l=len(searchPrimeNum(n))
plist=searchPrimeNum(n)
cnt=[0]*l
for i in range(l):
  k=1 
  while plist[i]**k<=n:
    cnt[i]+=n//(plist[i]**k)
    k+=1
ans=1
for i in cnt:
  ans=(ans*(i+1))%mod
print(ans)
_,*aa = map(int, open(1).read().split())

print(max(aa) - min(aa))

### FIXED CODE ###

_,*aa = map(int, open(0).read().split())

print(max(aa) - min(aa))
p=input();h,w=map(int,p().split());w+=2;print("#"*w);print("\n".join(["#"+p().strip()+"#"for _ in[0]*h]));print("#"*w)

### FIXED CODE ###

h,w=map(int,input().split());w+=2;print("#"*w);print("\n".join(["#"+input().strip()+"#"for _ in [0]*h]));print("#"*w)
k = int(input())

a = [0]*k
a[0] = 7
cnt = 0

for i in range(1, k):
    a[i] = (10*a[i-1]+7) % k

print(a.index(0) + 1 if k % 2 != 0 else -1 )

### FIXED CODE ###

import sys
k = int(input())

a = [0]*k
a[0] = 7 % k

for i in range(1, k):
    a[i] = (10*a[i-1]+7) % k

for i in range(k):
    if a[i] == 0:
        print(i+1)
        sys.exit()
print(-1)
def main():
    def func(s):
        return ord(s)-ord('a')

    n=int(input())
    s=input()
    s=[func(s[i]) for i in range(n)]
    sign=0
    ans=0
    for i in range(n-1):

        if ans>(n-i)/2: break

        for j in range(i+1,n):
            if s[j]==s[i+sign] and i+2*sign<j:
                sign+=1

            else:
                if sign>ans: ans=sign
                sign=0
        
        if sign>ans: ans=sign
        sign=0

    print(ans)
        

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    ans=["Sunny","Cloudy","Rainy"]
    print(ans[(ans.index(input())+1)%3])
if __name__ == '__main__':
    main()
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
mod = 10**9+7

n,k = map(int,readline().split())
if n == 1:
  print(k%mod)
  exit()

g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int,readline().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

ans = 1
used = [False]*n
def dfs(now,prev,p):
    global ans
    if k <= p:
      ans = 0
    ans *= k-p
    ans %= mod
    used[now] == True
    if all(used):
      return ans
    cnt = 1
    new = []
    for next in g[now]:
      if next == prev:
        cnt += 1
      else:
        new.append(next)
    for i,next in enumerate(new):
      dfs(next,now,cnt+i)
      
dfs(0,-1,0)
print(ans)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
mod = 10**9+7
sys.setrecursionlimit(4100000)
n,k = map(int,readline().split())
if n == 1:
  print(k%mod)
  exit()

g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int,readline().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

ans = 1
used = [False]*n
def dfs(now,prev,p):
    global ans
    if k <= p:
      ans = 0
    ans *= k-p
    ans %= mod
    used[now] == True
    if all(used):
      return ans
    cnt = 1
    new = []
    for next in g[now]:
      if next == prev:
        cnt += 1
      else:
        new.append(next)
    for i,next in enumerate(new):
      dfs(next,now,cnt+i)
      
dfs(0,-1,0)
print(ans)
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
     print(" ".join([str(s) for s in C[li]]))

### FIXED CODE ###

n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for ni in range(n):
     print(" ".join([str(s) for s in C[ni]]))
x=input()
if x=0:
  print("1")
else:
  print("0")

### FIXED CODE ###

x=int(input())
if x==0:
  print(1)
else:
  print(0)
L,R=map(int,input().split())
M=2019
for i in range(L,R):
    for j in range(i+1,R+1) :
        if (i*j)%2019 < MOD :
            M = (i*j)%2019
print (M)



### FIXED CODE ###

L,R=map(int,input().split())
M=2019
import sys
for i in range(L,R):
    for j in range(i+1,R+1) :
        if (i*j)%2019 < M :
            M = (i*j)%2019
            if M == 0:
                print(M)
                sys.exit()
print (M)
s=[int(input())for _ in range(int(input()))]
t=[int(input())for _ in range(int(input()))]
a=list(set(s))
print(max(0,max(s.count(a[i])-t.count(a[i]) for i in range(len(a)))))

### FIXED CODE ###

s=[input()for _ in range(int(input()))]
t=[input()for _ in range(int(input()))]
a=list(set(s))
print(max(0,max(s.count(a[i])-t.count(a[i]) for i in range(len(a)))))
x = input()
(N, K) = (int(x[0]), int(x[2]))
max_distribution = N - K
if K == 1:
    max_distribution = 0
print(max_distribution)

### FIXED CODE ###

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
if N == 1:
    print(1)
else:
    d_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]
    items = list(set(d_list))
    s = 1
    for item in items:
        c = d_list.count(item)
        if c > s:
            s = c
    print(N - s)
a = int(input())
i = 1
j = 0
ans = 0
while True:
	ans += 1
    j += i
    i += 1
    if j >= a:
      print(ans)
      break

### FIXED CODE ###

a = int(input())
i = 1
j = 0
ans = 0
while True:
    ans += 1
    j += i
    i += 1
    if j >= a:
      print(ans)
      break
N = int(input())
num_list = list(map(int, input().split()))
cumulative_sum_list = [0]
c_s = 0
for i in num_list:
    c_s += i
    cumulative_sum_list.append(c_s)
cumulative_sum_list.sort()
cumulative_sum_set = set(cumulative_sum_list)
cumulative_dif = [0, 0]
for idx, i in enumerate(range(1, 2 * (10 ** 5)), 2):
    cumulative_dif.append(cumulative_dif[idx - 1] + i)
s = 0
for i in cumulative_sum_set:
    s += cumulative_dif[cumulative_sum_list.count(i)]
print(s)


### FIXED CODE ###

from itertools import accumulate
from collections import Counter

N = int(input())
num_list = list(map(int, input().split()))
cumulative_sum_list = list(accumulate(num_list))
cumulative_sum_list.append(0)

c = Counter(cumulative_sum_list)
s = 0
for i in c.values():
    s += i * (i - 1) // 2
print(s)
n = input()
bl = false
for i in 9
    for j in 9
        if n = i * j:
            bl = true
            break
if bl = true:
    print ("Yes")
else:
    print ("No")

### FIXED CODE ###

n = int(input())
bl = 0
for i in range(1,10):
    for j in range(1,10):
        if n == (i * j):
            bl = 1
            break
if bl == 1:
    print ("Yes")
else:
    print ("No")
a,b = map(int,input())

print(a*b)

### FIXED CODE ###

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

print(a[0]*a[1])
import math
N=int(input())
a=math.ceil(N/(1.08))
for i in range(a,N):
    pass in range(a,N):
    if i==N:
        print(a)
        break
    else:
        print(':(')   

### FIXED CODE ###

import math
N=int(input())
a=math.ceil(N/(1.08))
if math.floor(a*1.08)==N:
        print(a)
else:
        print(':(')
2
5 1 1
100 1 1

### FIXED CODE ###

n = int(input())
txy = [[0,0,0]] + [[int(item) for item in input().split()] for _ in range(n)]

for i in range(n+1):
    if i == 0:
        continue
    t, x, y = txy[i-1]
    nt, nx, ny = txy[i]
    if abs(nx - x) + abs(ny - y) > nt - t:
        print("No")
        exit()
    if (abs(nx - x) + abs(ny - y)) % 2 != (nt - t) % 2:
        print("No")
        exit()
print("Yes")
input(s)
ans = 0
for i in s:
    if i == "+":
        ans += 1
    else:
        ans-=1
print(ans)

### FIXED CODE ###

s = input()
ans = 0
for i in s:
    if i == "+":
        ans += 1
    else:
        ans-=1
print(ans)
import math
def P(p, q):
  return math.factorial(p)//math.factorial(p-q)

def cmb(p, q):
  return P(p, q)//math.factorial(q)

n,k = map(int,input().split())
#print(n,k)

ans = []

x = 0
a = 1
if n-k == 1:
  b = 2
elif n-k > 1:
  b = cmb(n-k-1, 1)
else:
  b = 0
x = (2 + a * b)%(1000000007)
ans.append(x)

x = 0
if k == 1:
  a = 1
else:
  a = cmb(k-1, 1)
if n-k == 1:
  b = 1
elif n-k == 2:
  b = cmb(n-k-1, 1) * 2 + 1
else:
  b = cmb(n-k-1, 2) + cmb(n-k-1, 1) * 2 + 1
x = (a * b)%(1000000007)
ans.append(x)

#print(ans)

 
for i in range(3,k+1):
  x = 0
  a = cmb(k-1, i-1)#青玉の並べ方
  if n-k-1 < i-2:
    b = 0
  elif n-k-1 < i-1:
    b = cmb(n-k-1, i-2)
  elif n-k-1 < i:
    b = cmb(n-k-1, i-1) * 2 + cmb(n-k-1, i-2)
  else:
    b = cmb(n-k-1,i) + cmb(n-k-1, i-1) * 2 + cmb(n-k-1, i-2)
  x = (a * b)%(1000000007)
  ans.append(x)

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

### FIXED CODE ###

import math
def P(p, q):
  return math.factorial(p)//math.factorial(p-q)

def cmb(p, q):
  return P(p, q)//math.factorial(q)

n,k = map(int,input().split())
#print(n,k)

ans = []

x = 0
a = 1
if n-k == 1:
  b = 2
  x = (2 + a * b)%(1000000007)
elif n-k > 1:
  b = cmb(n-k-1, 1)
  x = (2 + a * b)%(1000000007)
else:
  x = 1
ans.append(x)

x = 0
if k == 1:
  a = 1
else:
  a = cmb(k-1, 1)
if n-k == 1:
  b = 1
elif n-k == 2:
  b = cmb(n-k-1, 1) * 2 + 1
elif n-k > 2:
  b = cmb(n-k-1, 2) + cmb(n-k-1, 1) * 2 + 1
else:
  b = 0
x = (a * b)%(1000000007)
ans.append(x)

#print(ans)

 
for i in range(3,k+1):
  x = 0
  a = cmb(k-1, i-1)#青玉の並べ方
  if n-k-1 < i-2:
    b = 0
  elif n-k-1 < i-1:
    b = cmb(n-k-1, i-2)
  elif n-k-1 < i:
    b = cmb(n-k-1, i-1) * 2 + cmb(n-k-1, i-2)
  else:
    b = cmb(n-k-1,i) + cmb(n-k-1, i-1) * 2 + cmb(n-k-1, i-2)
  x = (a * b)%(1000000007)
  ans.append(x)

for i in range(k):
  print(ans[i])
H, W = map(int,input().split())

hw = []
hw.append('.'*W)
for _ in range(H):
    edited = input()
    edited = '.' + edited + '.'
    hw.append(edited)
hw.append('.'*W)
#四方を白に囲まれた黒がある場合に達成不可能

for i in range(1,H+1):
    for j in range(1,W+1):
        if hw[i][j] == '#':
            #探索
            if hw[i+1][j] == '.' and hw[i-1][j] == '.' and hw[i][j+1] == '.' and hw[i][j-1] == '.':
                print('No')
                quit()

print('Yes')

### FIXED CODE ###

H, W = map(int,input().split())

hw = []
hw.append('.'*(W+2))
for _ in range(H):
    edited = input()
    edited = '.' + edited + '.'
    hw.append(edited)
hw.append('.'*(W+2))
#四方を白に囲まれた黒がある場合に達成不可能
for i in range(1,H+1):
    for j in range(1,W+1):
        if hw[i][j] == '#':
            #探索
            if hw[i+1][j] == '.' and hw[i-1][j] == '.' and hw[i][j+1] == '.' and hw[i][j-1] == '.':
                print('No')
                quit()

print('Yes')
n = int(input())
a = int(input())
b = int(input())

if n == 1:
    print("Hello World")
else:
    print(a + b)

### FIXED CODE ###

n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)  
exit()
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int

def solve(N, C):
    last = [-1] * N
    pairs = []
    for i, c in enumerate(C):
        prev = last[c - 1]
        if prev >= 0 and prev < i - 1:
            pairs.append((prev, i))
        last[c - 1] = i
    pairs.sort()
    count = [0] * N
    count[0] = 1
    idx = 0
    for i in range(N):
        if i > 0:
            count[i] += count[i - 1]
            count[i] %= MOD
        while idx < len(pairs) and pairs[idx][0] == i:
            count[pairs[idx][1]] += count[i]
            count[pairs[idx][1]] %= MOD
            idx += 1
    print(count[N - 1] % MOD)
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, C)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int
MAX_N = 200000

def solve(N, C):
    last = [-1] * MAX_N
    pairs = []
    for i, c in enumerate(C):
        try:
            prev = last[c - 1]
        except:
            if c >= N:
                return
            else:
                raise Exception()
        if prev >= 0 and prev < i - 1:
            pairs.append((prev, i))
        last[c - 1] = i
    pairs.sort()
    count = [0] * N
    count[0] = 1
    idx = 0
    for i in range(N):
        if i > 0:
            count[i] += count[i - 1]
            count[i] %= MOD
        while idx < len(pairs) and pairs[idx][0] == i:
            count[pairs[idx][1]] += count[i]
            count[pairs[idx][1]] %= MOD
            idx += 1
    print(count[N - 1])
    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, C)

if __name__ == '__main__':
    main()
import sys
from collections import deque

readline = sys.stdin.readline

N, M = map(int, readline().split())
G = [[] for i in range(N)]
for i in range(N-1):
    x, y = map(int, readline().split())
    G[x-1].append((y-1, 2*i))
    G[y-1].append((x-1, 2*i+1))
G0 = [None]*N
used = [0]*N
used[0] = 1
que = deque([0])
while que:
    v = que.popleft()
    g = []
    for e in G[v]:
        w, d = e
        if used[w]:
            continue
        g.append(e)
        used[w] = 1
        que.append(w)
    G0[v] = g
G = G0

memo = [0]*(2*N+1)
def dfs0(v, p, e):
    r = 1
    for w, d in G[v]:
        r = r * (1 + dfs0(w, v, d)) % M
    memo[e] = r
    return r


lv = [0]*(2*N); rv = [0]*(2*N)
ans = [None]*N
def dfs1(v, p, par):
    s = 1 + par
    for w, d in G[v]:
        lv[d] = s
        s = s * (1 + memo[d]) % M
    s = 1
    for w, d in reversed(G[v]):
        rv[d] = s
        s = s * (1 + memo[d]) % M
    for w, d in G[v]:
        memo[d ^ 1] = x = lv[d] * rv[d] % M
        dfs1(w, v, x)


dfs0(0, -1, 2*N)
dfs1(0, -1, 0)
ans = []
for v in range(N):
    r = 1
    for w, d in G[v]:
        r = r * (1 + memo[d]) % M
    ans.append("%d\n" % r)
sys.stdout.writelines(ans)

### FIXED CODE ###

import sys
from collections import deque

readline = sys.stdin.readline

N, M = map(int, readline().split())
G = [[] for i in range(N)]
for i in range(N-1):
    x, y = map(int, readline().split())
    G[x-1].append((y-1, 2*i))
    G[y-1].append((x-1, 2*i+1))

G0 = [None]*N
V = [(0, -1)]
used = [0]*N
used[0] = 1
que = deque([0])
while que:
    v = que.popleft()
    g = []
    for e in G[v]:
        w, d = e
        if used[w]:
            continue
        g.append(e)
        V.append(e)
        used[w] = 1
        que.append(w)
    G0[v] = g

memo = [0]*(2*N+1)
for v, e in reversed(V):
    r = 1
    for w, d in G0[v]:
        r = r * (1 + memo[d]) % M
    memo[e] = r

lv = [0]*(2*N); rv = [0]*(2*N)
for v, e in V:
    s = 1 + memo[e ^ 1]
    for w, d in G0[v]:
        lv[d] = s
        s = s * (1 + memo[d]) % M
    s = 1
    for w, d in reversed(G0[v]):
        rv[d] = s
        s = s * (1 + memo[d]) % M
    for w, d in G0[v]:
        memo[d ^ 1] = lv[d] * rv[d] % M

ans = []
for v in range(N):
    r = 1
    for w, d in G[v]:
        r = r * (1 + memo[d]) % M
    ans.append("%d\n" % r)
sys.stdout.writelines(ans)
n = int(input())//2
s = input()

if [:n] == [n:]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())//2
s = input()
 
if s[:n] == s[n:]:
  print("Yes")
else:
  print("No")
s = [''.join(sorted(input())) for i in range(N)]
 
dic = {}
cnt = 0
for i in range(N):
    if s[i] in dic:
        cnt += dic[s[i]]
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1
print(cnt)
 
 

### FIXED CODE ###

def f(array):
    temp = 'abcdefghijklmnopqrstuvwxyz'
    ret = [0] * len(temp)
    cnt = 0
    for x in array:
        ret[temp.index(x)] += 1
        cnt += 1
        if cnt == 10:
            break
    return ret

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

dic = {}
for i in range(N):
    if s[i] in dic:
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1

cnt = 0
for v in dic.values():
    cnt += v * (v - 1) // 2

print(cnt)
n, a, b = map(int, input().split())

for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i

print(ans)

### FIXED CODE ###

n, a, b = map(int, input().split())
sum = 0
for i in range(n+1):
    isum = 0
    m = i
    while m != 0:
        isum += m%10
        m = m//10
    if isum >= a and isum <= b:
        sum += i
print(sum)
from collections import deque

h,w=map(int,input().split())
maze=[list(input()) for i in range(h)]
distance=[[-1]*w for i in range(h)]

cnt=0
for i in maze:
  cnt+=i.count('#')

Q=deque()
Q=((0,0))
distance[0][0]=1

ans=-1

while Q:
  p=Q.pop(0)
  if p[0]==h-1 and p[1]==w-1:
    ans=h*w-cnt-distance[h-1][w-1]
    break

  dx=[1,-1,0,0]
  dy=[0,0,1,-1]

  for i in range(4):
    nx=p[0]+dx[i]
    ny=p[1]+dy[i]

    if 0<=nx<h and 0<=ny<w and distance[nx][ny]==-1 and maze[nx][ny]!='#':
      Q.append((nx,ny))
      distance[nx][ny]=distance[p[0]][p[1]]+1

print(ans)

### FIXED CODE ###

h,w=map(int,input().split())
maze=[list(input()) for i in range(h)]
distance=[[-1]*w for i in range(h)]

cnt=0
for i in maze:
  cnt+=i.count('#')

Q=[[0,0]]
distance[0][0]=1

ans=-1

while Q:
  p=Q.pop(0)
  if p[0]==h-1 and p[1]==w-1:
    ans=h*w-cnt-distance[h-1][w-1]
    break

  dx=[1,-1,0,0]
  dy=[0,0,1,-1]

  for i in range(4):
    nx=p[0]+dx[i]
    ny=p[1]+dy[i]

    if 0<=nx<h and 0<=ny<w and distance[nx][ny]==-1 and maze[nx][ny]!='#':
      Q.append([nx,ny])
      distance[nx][ny]=distance[p[0]][p[1]]+1

print(ans)
import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
if a <= c and b >= c:
    ans = 'Yes'
else
    ans = 'No'
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
if (a <= c) and (b >= c):
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
N, K = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
H.sort()
for i in range(1,K+1):
  H[N-i] = 0
print(sum(H))

### FIXED CODE ###

import sys
N, K = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
H.sort()
if(N<K):
  print(0)
  sys.exit()
else:
  for i in range(1,K+1):
    H[N-i] = 0
print(sum(H))
a,b,c =int(input())

if a=<b:
  ans=c
elif:
  ans=c-(a-b)
  if ans<0:
    ans=0
    
  
print(ans)

### FIXED CODE ###

a,b,c = map(int,input().split())
ans = 0

if a <= b:
    ans = c
else:
	ans = c-(a-b)
	if ans < 0:
		ans = 0
    
print(ans)
a, b, c, d = map(int, input().split())

if a == 0:
    a = b
if b == 0:
    b = a
if c == 0:
    c = d
if d == 0:
    d = c

if max(a, b) < 0 and max(c, d) > 0:
    A = -min(abs(a), abs(b))
    B = min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) < 0:
    A = min(abs(a), abs(b))
    B = -min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) > 0:
    A = max(abs(a), abas(b))
    B = max(abs(c), abs(d))
else:
    A = min(abs(a), abs(b))
    B = min(abs(c), abs(d))

print(A * B)

### FIXED CODE ###

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

A = a * c
B = a * d
C = b * c
D = b * d

ANS = max(A, B, C, D)

print(ANS)
import sys
import re
import math
from collections import Counter

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N,K=(int(x) for x in input().split())

for i in range(1,K+1):
    print((combinations_count(N-K+1, i)*combinations_count(K-1, i-1))%1000000007)



### FIXED CODE ###

import sys
import re
import math
from collections import Counter

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N,K=(int(x) for x in input().split())

for i in range(1,K+1):
    if i < min(K+1,N-K+2):
        print((combinations_count(N-K+1, i)*combinations_count(K-1, i-1))%1000000007)
    else:
        print(0)
n=int(input())
a=[]
b=[]
ret = 0
for i in range(n):
  a[i],b[i]=map(int,input().split())
for i in range(n):
  ret+=b[-1-i]-(ret+a[-1-i])%b[-1-i]
print(ret)

### FIXED CODE ###

n=int(input())
a=[]
b=[]
ret = 0
for i in range(n):
  s,t=map(int,input().split())
  a+=[s]
  b+=[t]
for i in range(n):
  ret+=(b[-1-i]-(ret+a[-1-i])%b[-1-i])%b[-1-i]
print(ret)
n,k,q = map(int,input().split())
li = [k-q for i in range(n)]
a = 0
for i in range(n):
    a = int(input())
    li[a-1]+=1
for i in range(n):
    if li[i] <= 0:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

n,k,q = map(int,input().split())
attend = [k-q for i in range(n)]
a = 0
for i in range(q):
    a = int(input())
    attend[a-1]+= 1
for i in range(n):
    if (attend[i] <= 0):
        print("No")
    else:
        print("Yes")
a = int(input)
for row in a:
    b += row 
print(b)

### FIXED CODE ###

a = list(input())
b = 0
for i in a:
    b += int(i)
print(b)
c_1 =map(str,input().split())
c_2 =map(str,input().split())
if c_1[0]==c_2[2] 
and c_1[1]==c_2[1] 
and c_1[2]==c_2[0]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a = list(input())
b = list(input())
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print("YES")
else:
  print("NO")