Harryxun/stf_run huggingface dataset:
def find_min_fuka_idx(lst, x):
  ok = -1
  ng = len(lst)
  while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if x>=lst[mid]:
      ok = mid
    else:
      ng = mid
  return ng

a,b,q = map(int, input().split())
s = [-10**18]
s_mid = [int(input()) for i in range(a)]
s.extends(s_mid)
s.append(10**18)

t = [-10**18]
t_mid = [int(input()) for i in range(b)]
t.extends(t_mid)
t.append(10**18)

for i in range(q):
  x = int(input())
  si = find_min_fuka_idx(s, x)
  tj = find_min_fuka_idx(t, x)
  print(min(abs(x-s[si])+abs(s[si]-t[tj]),\
            abs(x-s[si])+abs(s[si]-t[tj-1]),\
           abs(x-t[tj])+abs(t[tj]-s[si]),\
            abs(x-t[tj])+abs(t[tj]-s[si-1]),\
            abs(x-s[si-1])+abs(s[si-1]-t[tj]),\
            abs(x-s[si-1])+abs(s[si-1]-t[tj-1]),\
           abs(x-t[tj-1])+abs(t[tj-1]-s[si]),\
            abs(x-t[tj-1])+abs(t[tj-1]-s[si-1])))


### FIXED CODE ###

import bisect
def find_min_fuka_idx(lst, x):
  ok = -1
  ng = len(lst)
  while abs(ok-ng)>1:
    mid = (ok+ng)//2
    if x>=lst[mid]:
      ok = mid
    else:
      ng = mid
  return ng

a,b,q = map(int, input().split())
s = [-10**18]
s_mid = [int(input()) for i in range(a)]
s.extend(s_mid)
s.append(10**18)

t = [-10**18]
t_mid = [int(input()) for i in range(b)]
t.extend(t_mid)
t.append(10**18)

for i in range(q):
  x = int(input())
  si = bisect.bisect_right(s, x)
  tj = bisect.bisect_right(t, x)
  print(min(abs(x-s[si])+abs(s[si]-t[tj]),\
            abs(x-s[si])+abs(s[si]-t[tj-1]),\
           abs(x-t[tj])+abs(t[tj]-s[si]),\
            abs(x-t[tj])+abs(t[tj]-s[si-1]),\
            abs(x-s[si-1])+abs(s[si-1]-t[tj]),\
            abs(x-s[si-1])+abs(s[si-1]-t[tj-1]),\
           abs(x-t[tj-1])+abs(t[tj-1]-s[si]),\
            abs(x-t[tj-1])+abs(t[tj-1]-s[si-1])))
N, K = map(int, input().split())
A = (map(lambda s: int(s) % K, input().split()))

counts = [0] * K
counts2 = [0] * K

cumAm1 = [1] 
for i, Ai in enumerate(A):
    cumAm1.append((-1 + cumAm1[-1] + Ai) % K)

for i in range(N + 1):
    if i >= K:
        counts[cumAm1[i - K]] -= 1

    cur = cumAm1[i]
    counts2[cur] += counts[cur]

    counts[cur] += 1

print(sum(counts2))


### FIXED CODE ###

from collections import Counter

N, K = map(int, input().split())
A = list(map(lambda s: int(s) % K, input().split()))

cumAm1 = [1] + A
for i in range(1, N + 1):
    cumAm1[i] = (-1 + cumAm1[i - 1] + cumAm1[i]) % K

counts = Counter()
ans = 0
for i in range(N + 1):

    if i >= K:
        counts[cumAm1[i - K]] -= 1

    cur = cumAm1[i]
    ans += counts[cur]

    counts[cur] += 1

print(ans)
import math
A,B,C,D=map(int,input().split())

if A%C==0:
    x=B//C-A//C+1
else:
    x=B//C-A//C
if A%D==0:
    y=B//D-A//D+1
else:
    y=B//D-A//D
E=C*D/math.gcd(C,D)
if A%E==0:
    z=B//E-A//E+1
else:
    z=B//E-A//E
print(round(B-A+1-(x+y-z)))


### FIXED CODE ###

def g(m,n):
    x=max(m,n)
    y=min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z
from decimal import Decimal
A,B,C,D=map(lambda x:Decimal(int(x)),input().split())



if A%C==0:
    x=B//C-A//C+1
else:
    x=B//C-A//C
if A%D==0:
    y=B//D-A//D+1
else:
    y=B//D-A//D
E=Decimal(C*D//g(C,D))
if A%E==0:
    z=B//E-A//E+1
else:
    z=B//E-A//E
print(B-A+1-(x+y-z))
i = input().split()
if i < 10:
  print(i[0] * i[1])

### FIXED CODE ###

a,b = map(int,input().split())
if a < 10 and b < 10:
  print(a * b)
else:
  print(-1)
n, _ = map(int,input().split())
a = list(map(int, input().split()))
dic = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}
dp = [0] * (n + 1)


def calc(num, new):
    if num == 0:
        return 0
    num_str = str(num)
    new_str = str(new)
    sstr_list = list(str(num)) + list(str(new))
    sstr_list.sort(reverse=True)
    return int("".join(sstr_list))


s = set()
for x in range(2, 8):
    for i in a:
        if x > dic[i]:
            dp[x] = max(dp[x], calc(dp[x - dic[i]], i))
        elif x == dic[i]:
            dp[x] = max(dp[x], i)
    if dp[x]:
        for num in str(dp[x]):
            s.add(int(num))

for x in range(n + 1):
    for i in s:
        if x > dic[i]:
            dp[x] = max(dp[x], calc(dp[x - dic[i]], i))

print(dp[n])


### FIXED CODE ###

n, _ = map(int, input().split())
L = list(map(int, input().split()))
weight = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [-1] * (n+1)
dp[0] = 0

for i in range(n+1):
    for a in L:
        if i+weight[a] < n+1:
            dp[i+weight[a]] = max(dp[i+weight[a]], dp[i]*10+a)

print(dp[n])
C11,C12,C13 = map(str, input().split())

C21,C22,C23= map(str, input().split())

hoge = (C13 + C12 + C11)
hoge2 =(C21 + C22 + C23)

if hoge == hpge2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

A = input()
B = input()

REA = (A[0] + A[1] + A[2])
REB = (B[2] + B[1] +B[0])

if REA == REB:
    print("YES")
else:
    print("NO")
S = input()
K = int(input())

l = len(S)

pair = []
current = S[0]
seq = 1
for i in range(1, l):
    if(i == l-1):
        if(S[i]==current):
            seq += 1
        if(seq != 1):
            pair.append(seq)
    elif(S[i] == current):
        seq += 1
    else:
        pair.append(seq)
        seq = 1
        current = S[i]

ans = 0
#print(pair)
if(S[0] != S[l-1]):
    for i in range(len(pair)):
        ans += K * (pair[i]//2)
else:
    if(len(pair) == 1):
        ans += ((pair[0]+1)//2)*(K-1) + (pair[0]//2)
    else:
        for i in range(len(pair)-1):
            ans += K * i
        ans += ((pair[i+1]+1)//2)*(K-1) + (pair[i+1]//2)

print(ans)

### FIXED CODE ###

S = input()
K = int(input())

S += "1"
l = len(S)
pair = []
current = S[0]
seq = 1
for i in range(1, l):
    if(i == l):
        pair.append(seq)
    elif(S[i] == current):
        seq += 1
    else:
        pair.append(seq)
        seq = 1
        current = S[i]

ans = 0
#print(pair)
if(len(pair) == 1):
    ans += (K * pair[0])//2
elif(S[0] != S[l-2]):
    for i in range(len(pair)):
        ans += K * (pair[i]//2)
else:
    for i in range(1, len(pair)-1):
        ans += K * (pair[i]//2)
    ans += (pair[0]//2) + (pair[i+1]//2) + ((pair[0]+pair[i+1])//2)*(K-1)

print(ans)
n = int(input())

for i in range(n ** 0.5 + 1):
    if 2 * n == i ** 2 - i:
        k = i
        break
    elif 2 * n < i ** 2 - i:
        print('No')
        exit()

k = int(k)
print('Yes')
print(k)
num, ans = 1, [[] for _ in range(k)]
for i in range(k):
    for j in range(i + 1, k):
        ans[i].append(num)
        ans[j].append(num)
        num += 1
    print(k - 1, *ans[i])


### FIXED CODE ###

n = int(input())

k = (1 + (1 + 8 * n)** 0.5) * 0.5
if k.is_integer():
    k, num = int(k), 1
    ans = [[] for _ in range(k)]
    print('Yes')
    print(k)
    for i in range(k):
        for j in range(i + 1, k):
            ans[i].append(num)
            ans[j].append(num)
            num += 1
        print(k - 1, *ans[i])
else:
    print('No')
A = input()
B = input()
if len(A) == len(B):
    if A > B:
        print('GREATER')
    else:
        print('LESS')
elif len(A) > len(B):
    print('GREATER')
else:
    print('LESS')


### FIXED CODE ###

# -*- coding: utf-8 -*-

s1, s2, s3 = input().split()
print((''.join([s1[0], s2[0], s3[0]])).upper())
A, B = list(map(int, input().split()))

if A < B:
    print("<")
elif A > B:
    print(">")
else:
    print("=")

### FIXED CODE ###

A, B = input().split()

if A < B:
    print("<")
elif A > B:
    print(">")
else:
    print("=")
import math
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
def ceil(src, range):
  return ((int)(src / range) + 1 ) * range
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
  y.append(ceil(s,10))
t=min(x)
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)

### FIXED CODE ###

import math
a,b,c,d,e=[int(input()) for i in range(5)]
x=[]
y=[]
def ceil(src, range):
  return ((int)(src / range) + 1 ) * range
for s in [a,b,c,d,e]:
  if s%10 != 0:
    x.append(s%10)
    t=min(x)
  if s<10:
    y.append(10)
  elif s%10==0:
    y.append(s)
  else:
    y.append(ceil(s,10))
if a%10==0 and b%10==0 and c%10==0 and d%10==0 and e%10==0:
  print(a+b+c+d+e)
else:
  ans = sum(y)
  ans= ans-10+t
  print(ans)
a,b = map(int,input().split)
if (a*b) % 2:
  print('Odd')
else:
  print('Even')

### FIXED CODE ###

a,b = map(int,input().split())
if (a*b) % 2:
  print('Odd')
else:
  print('Even')
import math
from functools import reduce
from numba import jit

@jit
def gcd(*nums):
  return reduce(math.gcd, nums)


input_num = int(input()) + 1
result = 0
for a in range(1, input_num):
  for b in range(1, input_num):
    for c in range(1, input_num):
        result += gcd(a, b, c)
print(result)


### FIXED CODE ###

import math
from functools import reduce

def gcd(*nums):
  return reduce(math.gcd, nums)


input_num = int(input()) + 1
result = 0
for a in range(1, input_num):
  for b in range(1, input_num):
    for c in range(1, input_num):
        result += gcd(a, b, c)

print(result)
a, b, c = map(input().split(" "))

if a == 5 and b == 7 and c == 5 \
        or a == 5 and b == 5 and c == 7 \
        or a == 7 and b == 5 and c == 5:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

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

if a == 5 and b == 7 and c == 5 \
        or a == 5 and b == 5 and c == 7 \
        or a == 7 and b == 5 and c == 5:
    print("YES")
else:
    print("NO")
a = input()
b = input()

c = float(a) * float(b)

print(c)

ans = int(c//1)

print(ans)

### FIXED CODE ###

a, b = input().split()

c = int(a)
d = int(float(b) * 1000)

e = c * d

ans = e // 1000
print(ans)
import sys
import io
az =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower()
    for i in range(26):
        for j in range(len(x)):
            if x[j] == az[i]:
                sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))
                

### FIXED CODE ###

import sys
az =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower():
    for i in range(26):
        if x == az[i]:
            sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))
a,b=int(input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

### FIXED CODE ###

a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")
import sys

r = input()
print (r * r)

### FIXED CODE ###

import sys

r = input()
print(int(r) * int(r))
H,N=map(int,input().split())
print('NYoe s'[H<=sum(list(map(int,input().split())))::2])

### FIXED CODE ###

H,A = map(int,input().split())
print(1 + H // A) if H % A != 0 else print(H // A)
N = int(input())
a = [int(input()) for i in range(N)]
for i in range(N):
  b = a
  del b[i]
  sorted(b)
  print(b[0])

### FIXED CODE ###

from heapq import *

N=int(input())
A=[int(input()) for i in range(N)]
h=[]
for i in A:
    heappush(h, -i)
maxh = -heappop(h)
secondh = -heappop(h)
for i in A:
    print(maxh if i != maxh else secondh)
n = input()
num = list(map(int, input().split()))
count = 0
while sum(num) % 2 == 0:
    for i in range(n):
        num[i] /= 2
    count += 1
print(count)

### FIXED CODE ###

n = int(input())
num = list(map(int, input().split()))
count = 0
while True:
    exist_odd = "false"
    for i in range(n):
        if num[i] % 2 != 0:
            exist_odd = "True"
    if exist_odd == "True":
        break
    for i in range(n):
        num[i] /= 2
    count += 1
print(count)
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (s, t) = [e for e in lines[0].split(" ")]
    (a, b) = [int(e) for e in lines[1].split(" ")]
    u = lines[2]

    return (s, t, a, b, u)


def solve(s, t, a, b, u):
    
    a2 = a
    b2 = b
    if s == u:
        a2 = a2 - 1
    elif t == u:
        b2 = b2 - 1
    
    result = ' '.join([a2, b2])

    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (s, t) = [e for e in lines[0].split(" ")]
    (a, b) = [int(e) for e in lines[1].split(" ")]
    u = lines[2]

    return (s, t, a, b, u)


def solve(s, t, a, b, u):
    
    a2 = a
    b2 = b
    if s == u:
        a2 = a2 - 1
    elif t == u:
        b2 = b2 - 1
    
    result = ' '.join([str(a2), str(b2)])

    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math

N = int(input())
T = [int(input()) for i in range(N)]


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

ans = 1
for t in T:
    ans = lcm(ans,t)

print(ans)


### FIXED CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions

N = int(input())
T = [int(input()) for i in range(N)]


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

ans = 1
for t in T:
    ans = lcm(ans,t)

print(ans)
dice_num_list = []
equal_index_list = []

N = int(input())

for i in range(1, N + 1):
    d1, d2 = input().split(" ")
    dice_num_list.append([d1, d2])

equal_index_list = [i for i, x in enumerate(dice_num_list) if x[0] == x[1]]

if len(equal_index_list) < 3:
    print('No')
    exit(0)
for index in equal_index_list:
    if equal_index_list[index + 1] == index + 1 and equal_index_list[index + 2] == index + 2:
        print("Yes")
        exit(0)
print("No")

### FIXED CODE ###

dice_num_list = []
equal_index_list = []

N = int(input())

for i in range(1, N + 1):
    d1, d2 = input().split(" ")
    dice_num_list.append([d1, d2])

equal_index_list = [i for i, x in enumerate(dice_num_list) if x[0] == x[1]]

l = len(equal_index_list)
if l < 3:
    print('No')
    exit(0)

for i in range(l - 2):
    if equal_index_list[i] + 1 == equal_index_list[i + 1] and equal_index_list[i] + 2 == equal_index_list[i + 2]:
        print("Yes")
        exit(0)

print("No")
from collections import Counter
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().rstrip()
N = ii()
S = ns()
r = N - 1
l = 0
while S[r] == "#":
    r -= 1
while S[l] == ".":
    l += 1
cnt = Counter(S[l:r+1])
print(min(cnt["."], cnt["#"]))


### FIXED CODE ###

from collections import Counter
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().rstrip()
N = ii()
S = ns()
bs = [0] * (N + 1)
ws = [0] * (N + 1)
total = float("inf")
left_b = 0
right_w = 0
for i, s in enumerate(S):
    if s == "#":
        left_b += 1
    bs[i + 1] = left_b
for i in reversed(range(N)):
    if S[i] == ".":
        right_w += 1
    ws[i] = right_w

for i in range(N):
    total = min(total, ws[i+1] + bs[i])

print(total)
N=int(input())
A=list(map(str,input().split()))
ans=[o for i in range(N)]
for i in range(N):
  ans[i]=A.index("i")
print(*ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
Answer=[0 for i in range(N)]
for t in range(N):
  Answer[A[t]-1]=t+1
print(*Answer)
N, K, Q = map(int, input().split())
A = [0]*N
for i in range(Q):
    t = int(input())
    A[t] += 1

for i in range(Q):
    if Q - A[i] > K:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Wed Sep  9 15:18:03 2020

@author: liang
"""
N, K, Q = map(int, input().split())
A = [0]*N
for i in range(Q):
    t = int(input())
    A[t-1] += 1

#print(A)
for i in range(N):
   # print(Q-A[i])
    if Q - A[i] <  K:
        print("Yes")
    else:
        print("No")
print 2**len(bin(input()))/4-1

### FIXED CODE ###

a=int(input())
k=2
while a>=k:k*=2
print(k-1)
# https://atcoder.jp/contests/dp/tasks/dp_c
N = int(input())
Max_List = [[0] * 3 for i in range(N)]
for i in range(N):
    Current_List = list(map(int,input().split()))  
    if i == 0:
        Max_List[i] = Current_List
    else:
        Search_List = Max_List[i-1]
        for j in range(3):
            Current_Search_List = Search_List[1:3]
            Max_List[i][j] = (max(Current_Search_List) + Current_List[j])
            Search_List.append(Search_List[0])
            del Search_List[0]
        
        Max_List[i] = Current_Max_List

        
print(max(Max_List[-1]))

### FIXED CODE ###

# https://atcoder.jp/contests/dp/tasks/dp_c
import numpy as np
N = int(input())
Max_List=[]
N_List=[i for i in range(3)]
for i in range(N):
    Current_List=list(map(int,input().split())) 
    if i == 0:
        Max_List.append(Current_List)
    else:
        Current_Max_List = []
        for j in range(3):
            Index_List=np.array(Max_List[i-1])
            ind = np.ones(3, dtype=bool)
            ind[j] = False
            Current_Max_List.append(max(Index_List[ind])+Current_List[j])
            
        Max_List.append(Current_Max_List)
        
    
print(max(Max_List[-1]))
while True:
    a, op, b = input().split()  # 3変数ともに文字列として読み込む
    a = int(a)  # a を整数に変換
    b = int(b)  # b を整数に変換
    if op == ?:
        break
    else:
        print(f'a op b')



### FIXED CODE ###

while True:
    a, op, b = input().split()  # 3変数ともに文字列として読み込む
    a = int(a)  # a を整数に変換
    b = int(b)  # b を整数に変換
    if op == '?':
        break
    elif op == '+':
        print("%d"%(a+b))
    elif op == '-':
        print("%d"%(a-b))
    elif op == '/':
        print("%d"%(a/b))
    else:
        print("%d"%(a*b))
n = input()

color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]

def dfsv(u):
  color[u] = 1
  t += 1
  d[u] = t
  for v in range(n):
    if M[u][v] == 1 and color[v] == 0:
      dfsv(v)
  color[u] = 2
  t += 1
  f[u] = t

def dfs():
  t = 0
  for u in range(n):
    if color[u] == 0:
      dfsv(u)
  for u in range(n):
    print (u+1, d[u], f[u])

for i in range(n):
  X = map(int, raw_input().split())
  for j in range(X[1]):
    M[X[0]-1][X[2+j]-1] = 1

dfs()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
ans = [0 for i in range(26)]
while True:
    a = input().upper()
    if a == "":break
    S = list(map(ord,a))
    S = [e for e in S if 64<e<91]
    for i in S:
        ans[i-65]+=1
for i in range(26):
    print("{} : {}".format(chr(97+i),ans[i]))


### FIXED CODE ###

import sys
input_str = sys.stdin.read()
table = [0]*26
letters = "abcdefghijklmnopqrstuvwxyz"
for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1
for i in range(len(letters)):
    print("{} : {}".format(letters[i],table[i]))
S = input()

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print(YES)
else:
  print(NO)
S = input()

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

S = input()

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print('Yes')
else:
  print('No')
import math
def number_calc(A,B,x):
    left = math.ceil(A/x)
    right = math.floor(B/x)
    return (right - left + 1)

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

ans = B-A+1
ans -=number_calc(A,B,C)
ans -=number_calc(A,B,D)
ans +=number_calc(A,B,(C*D)/math.gcd(C,D))

print(ans)



### FIXED CODE ###

import math
from fractions import gcd


A,B,C,D = map(int,input().split())
lcm = C//gcd(C,D)*D
ans = B - B//C - B//D + B//lcm
a = A-1
ans -= a - a//C - a//D + a//lcm 

print(ans)
X,Y = map(int, input().split())
if X < Y:
  print("<")
elif X > Y:
  print(">")
else:
  print("=")

### FIXED CODE ###

X,Y = map(str, input().split())
if X < Y:
  print("<")
elif X > Y:
  print(">")
else:
  print("=")
n, k = map(int, input().split())
l = []
for i in range(n):
    l.append(int(input()))

root = [1]*n

for i in range(n)[-2::-1]:
    num = 0
    for j in l[i + 1: i + 100]:
        if abs(i - j) <= k:
            num = max(num, root[j])
    root[i] += num

print(max(root))

### FIXED CODE ###

n, k = map(int, input().split())
l = []
for i in range(n):
    l.append(int(input()))

root = [1]*n

for i in range(n)[-2::-1]:
    num = 0
    for j in range(i + 1, i + 200):
        if j >= n:
            break
        if abs(l[i] - l[j]) <= k:
            num = max(num, root[j])
    root[i] += num

print(max(root))
import sys
sys.setrecursionlimit(10 ** 6)

n, m = list(map(int, input().split()))
data = [[] for _ in range(n)]
done = [False for _ in range(n)]
for i in range(n):
    a, b = map(int, input().split())
    data[a-1].append(b-1)
    data[b-1].append(a-1)

ans = 0


def dfs(pos, cnt, his):
    global ans
    his[pos] = 1
    if cnt == n:
        if sum(his) == n:
            ans += 1
        return

    for next in data[pos]:
        dfs(next, cnt+1, his[:])


dfs(0, 1, [0]*n)
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

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

ans = 0


def dfs(pos, cnt, his):
    global ans
    his[pos] = 1
    if cnt == n:
        if sum(his) == n:
            ans += 1
        return

    for next in data[pos]:
        dfs(next, cnt+1, his[:])


dfs(0, 1, [0]*n)
print(ans)
N,K = map(int, input().split())
A_list = [int(i) for i in input().split()]


sum_tmp = 0
Answer = 0

if N==1 : Answer = 0

else :
    for i in range(N):
        sum_tmp = A_list[i]
        for j in range(i+1,N):
            sum_tmp += A_list[j]
            #print(sum_tmp)
            if sum_tmp < K:
                continue
            else:
                Answer += N - j
                #print('answer += {0:5d}'.format(N-j))
                break

print(Answer)

### FIXED CODE ###

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

if X < A:
    print("0")
else:
    print("10")