Harryxun/stf_run huggingface dataset:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

multi = {}

start = 1
for k in range(0,K):
    start = start * A[k]

for j in range(K, N+1):
    if j == K:
        multi[j] = start
        continue
    start = start // A[j-K-1] * A[j-1]
    multi[j] = start

    if j-1 in multi:
        if multi[j] > multi[j-1]:
            print("Yes")
        else:
            print("No")

### FIXED CODE ###

from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

for j in range(K, N+1):
    if j == K:
        continue
    if A[j-K-1] < A[j-1]:
        print("Yes")
    else:
        print("No")
n = int(input())
a = [ int(i) for i in input().split(" ")]

INF = 10000000000
dp = [ INF for i in range(len(a))]

def frog(i):
  if dp[i] < INF: return dp[i]
  
  if i == 0: return 0

  res = INF
  res = min(res, frog(i-1) + abs(a[i-1] - a[i]))
  if i > 1: 
    res = min(res, frog(i-2) + abs(a[i-2] - a[i]))

  dp[i] = res
  return res

print(frog(n-1))

### FIXED CODE ###

n = int(input())
a = [ int(i) for i in input().split(" ")]

dp = [ -1 for i in range(len(a))]
dp[0] = 0

for i in range(1, len(a)):
  onestep = dp[i-1] + abs(a[i-1] - a[i])
  if i - 2 < 0:
    twostep = onestep
  else:
    twostep = dp[i-2] + abs(a[i-2] - a[i])
  
  dp[i] = min(onestep, twostep)

print(dp[-1])
n,m=map(int,input().split())
step=list(range(2,n+1))
broken=[]
for i in range(m):
    broken+=[int(input())]
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if not broken[0]==1:
    dp[1]=1
for i in step:
    if not i in broken:
        dp[i]=(dp[i-1]%mod)+(dp[i-2]%mod)
print(dp[n])


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

if m == 0:
    dp = [0 for _ in range(n)] #i + 1段目に登る方法の数
    dp[0] = 1
    if n >= 2:
        dp[1] = 2
    for i in range(2, n):
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
    print(dp[n - 1])
    exit()

tmp = 0
dp = [0 for _ in range(n)]
if 1 == a[tmp]:
    dp[0] = 0
    tmp += 1
else:
    dp[0] = 1
if n >= 2 and tmp < m and 2 == a[tmp]:
    dp[1] = 0
    tmp += 1
elif n >= 2 and (tmp >= m or 2 != a[tmp]):
    dp[1] = dp[0] + 1

for i in range(2, n):
    if tmp < m and i + 1 == a[tmp]:
        dp[i] = 0
        tmp += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))
while True:
    try:
        n = int(input())
    except:
        break
    if n == 0:
        break
    c = 0
    for i in range(2, 1001):
        for a in range(1, 1001):
            if i*a+(0.5*(i-1)*i) == n:
                c += 1
    print(c)



### FIXED CODE ###

while True:
    n = int(input())
    if n == 0:
        break
    c = 0
    for i in range(2, 1001//2):
        for a in range(1, 1001//2):
            if i*a+(0.5*(i-1)*i) == n:
                c += 1
    print(c)
while 1:
    x, y = map(int, raw_input().split())
    if x <= y:
       print "%d %d" % (x,y)
    elif y < x:
       print "%d %d" % (y,x)
    elif x == 0 and y == 0:
       break

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
n = int(input())
a = np.array(list(map(int,input().split())))

count = 0
while 1:
    count+1

print(count)


### FIXED CODE ###

count= -1
flag = 1

num_list = [0]*int(input())
num_list = [int(x) for x in input().split()]

while 1:
    i=0
    for x in num_list:
        if x%2==1:
            flag = 0
            break
        else:
            num_list[i]=num_list[i]/2
        i=i+1
    count = count + 1
    if flag==0:
        break


print(count)
n = int(input())
h = list(map(int, input().split()))
def frog(num):
    if num == 1:
        return 0
    elif num == 2:
        return abs(h[1] - h[0])
    else:
        p1 = frog(num - 1) + abs(h[num - 2] - h[num - 1])
        p2 = frog(num - 2) + abs(h[num - 3] - h[num - 1])
        if p1 >= p2:
            return frog(num - 2) + abs(h[num - 3] - h[num - 1])
        else:
            return frog(num - 1) + abs(h[num - 2] - h[num - 1])
print(frog(n))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
def frog(num):
    if num == 1:
        return 0
    elif num == 2:
        return abs(h[1] - h[0])
    else:
        l1 = [frog(1), frog(2)]
        for i in range(2, num):
            p1 = l1[i - 1] + abs(h[i - 1] - h[i])
            p2 = l1[i - 2] + abs(h[i - 2] - h[i])
            if p1 >= p2:
                l1.append(p2)
            else:
                l1.append(p1)
    return l1[num - 1]
print(frog(n))
n = int(input())
arr = list(map(int, input().split()))
ans = 1
flag = 1
for x in arr:
    ans *= x
    if ans > 1000000000000000000:
        flag = 0
        break
if flag:
    print(ans)
else:
    print -1



### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))

ans = 1

for x in arr:
    if x == 0:
        ans = 0

if ans == 0:
    print(ans)
else:
    for x in arr:
        ans *= x
        if ans > 1000000000000000000:
            break
    if ans > 1000000000000000000:
        print(-1)
    else:
        print(ans)
N = int(input())
 
W = [[list(input())]]
 
def shiritori(N):
  for i in range(N):
    if any(W[i]):
      return "No"
    else:
    	if W[i-1][-1] == W[i][0]:
          return "Yes"
    	else:
          return "No"
    

        
print(shiritori(N))

### FIXED CODE ###

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

if A*B % 2 == 0:
  print("No")
else:
  print("Yes")
h,w = map(int, input().split())

if w == 1 or h == 1:
    print(1)
    exit()
    
if w == 2 and h == 2:
    print(2)
    exit()

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    print(1)
    exit()
else:
    idle = int(w / 2)
    num = idle * 2
    
if h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)
else:
    row = int(h / 2)
    print(num * row)

### FIXED CODE ###

h,w = map(int, input().split())

if w == 1 or h == 1:
    print(1)
    exit()
    
if w == 2 and h == 2:
    print(2)
    exit()

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    print(1)
    exit()
else:
    idle = int(w / 2)
    num = idle * 2

if h % 2 == 1 and w % 2 == 0:
    print(int((w / 2) * h))
    exit()

if h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)
else:
    row = int(h / 2)
    print(num * row)
while True:
    x, y = [int(i) for i in sys.stdin.readline().split(' ')]
    if x == 0 & y == 0:
        break
    elif x <= y:
        print(x, y)
    else:
        print(y, x)


### FIXED CODE ###

import sys


def main():
    while True:
        x, y = [int(i) for i in sys.stdin.readline().split(' ')]
        if x == 0 and y == 0:
            break
        elif x <= y:
            print(x, y)
        else:
            print(y, x)


if __name__ == '__main__':
    main()
a, b, c = map(int, input().split())

print("YES" if b - a = c - b else "NO")

### FIXED CODE ###

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

print("YES" if b - a == c - b else "NO")
A_1 = list(map(int, input().split()))
A_2 = list(map(int, input().split()))
A_3 = list(map(int, input().split()))
N = int(input())
b = [(int(input())) for _ in range(N)]
for i in range(3):
    for j in range(N):
        if A_1[i] == b[j]:
            A_1[i] = 1
        elif A_2[i] == b[j]:
            A_2[i] = 1
        elif A_3[i] == b[j]:
            A_3[i] = 1


if A_1[0] == A_1[1] == A_1[2]:
    print("Yes")
elif A_2[0] == A_2[1] == A_2[2]:
    print("Yes")
elif A_3[0] == A_3[1] == A_3[2]:
    print("Yes")
elif A_1[0] == A_2[0] == A_3[0]:
    print("Yes")
elif A_1[1] == A_2[1] == A_3[1]:
    print("Yes")
elif A_1[2] == A_2[2] == A_3[3]:
    print("Yes")
elif A_1[0] == A_2[1] == A_3[2]:
    print("Yes")
elif A_1[2] == A_2[1] == A_3[0]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A_1 = list(map(int, input().split()))
A_2 = list(map(int, input().split()))
A_3 = list(map(int, input().split()))
N = int(input())
b = [(int(input())) for _ in range(N)]
for i in range(3):
    for j in range(N):
        if A_1[i] == b[j]:
            A_1[i] = 1
        elif A_2[i] == b[j]:
            A_2[i] = 1
        elif A_3[i] == b[j]:
            A_3[i] = 1


if A_1[0] == A_1[1] == A_1[2]:
    print("Yes")
elif A_2[0] == A_2[1] == A_2[2]:
    print("Yes")
elif A_3[0] == A_3[1] == A_3[2]:
    print("Yes")
elif A_1[0] == A_2[0] == A_3[0]:
    print("Yes")
elif A_1[1] == A_2[1] == A_3[1]:
    print("Yes")
elif A_1[2] == A_2[2] == A_3[2]:
    print("Yes")
elif A_1[0] == A_2[1] == A_3[2]:
    print("Yes")
elif A_1[2] == A_2[1] == A_3[0]:
    print("Yes")
else:
    print("No")
N = input()
L = map(int, split(input()))

if N < 3:
    print(0)
    exit()

ans = 0
for i in range(0, N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            arr = [L[i], L[j], L[k]]
            arr.sort()
            if (arr[0] != arr[1] & arr[1] != arr[2]):
                if (arr[2] < arr[0] + arr[1]):
                    ans = ans + 1

print(ans)


### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))

if N < 3:
    print(0)
    exit()

ans = 0
for i in range(0, N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            arr = [L[i], L[j], L[k]]
            arr.sort()
            if (arr[0] != arr[1] & arr[1] != arr[2]):
                if (arr[2] < arr[0] + arr[1]):
                    ans = ans + 1

print(ans)
a,b,c=input().split();print('YNEOS'[a[-1]^c[0]^b[0]^b[-1]::2])

### FIXED CODE ###

a,b,c=map(list,input().split())
print("YNEOS"[a[-1]!=b[0]or b[-1]!=c[0]::2])
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

grid = [[v for v in input()[:-1]] for _ in range(H)]
dist = [[float('inf')]*W for _ in range(H)]

Q = []
cnt = 0
for row in range(H):
    for col in range(W):
        if grid[row][col] == "#":
            dist[row][col] = 0
            Q.append([row, col])
            cnt += 1

dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
current_dist = 0
while cnt < H*W and Q:
    current_dist += 1
    tmp = []
    for sx, sy in Q:
        for x, y in zip(dx, dy):
            new_x = sx+x
            new_y = sy+y
            if 0 <= new_x < H and 0 <= new_y < W:
                if dist[new_x][new_y] == float('inf'):
                    dist[new_x][new_y] = current_dist
                    tmp.append([new_x, new_y])
                    cnt += 1
    Q = tmp
print(d)


### FIXED CODE ###

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H, W = map(int, input().split())
grid = [[v for v in input()[:-1]] for _ in range(H)]

Q = []
cnt = 0
for i in range(H):
    for j in range(W):
        if grid[i][j] == "#":
            Q.append([i, j])
            cnt += 1

DX = [-1, 1, 0, 0]
DY = [0, 0, -1, 1]
d = 0
# for _ in range(5):
while cnt < H*W:
    d += 1
    tmp = []
    #print("d->", d)
    # print(Q)
    # print(dist)
    # print(cnt)
    # print("-------")
    for x, y in Q:
        for dx, dy in zip(DX, DY):
            nx = x+dx
            ny = y+dy
            if 0 <= nx < H and 0 <= ny < W:
                if grid[nx][ny] == ".":
                    grid[nx][ny] = "#"
                    tmp.append([nx, ny])
                    cnt += 1
            else:
                continue
    Q = tmp
# print(dist)
print(d)
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)

### FIXED CODE ###

p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)
n = int(input())
x = list(map(int,input().split()))
x.sort()
cnt = 0
min = 0

for i in range(x[0], x[-1] + 1):
    for j in range(n):
        cnt += (x[j] - i) ** 2

    if i == x[0]:
        minimum = cnt

    minimum = min([minimum, cnt])
    cnt = 0

print(minimum)


### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))

x.sort()
cnt = 0
minimum = 0
for i in range(x[0], x[-1] + 1):
    for j in range(n):
        cnt += (x[j] - i) ** 2

    if i == x[0]:
        minimum = cnt

    minimum = min([minimum, cnt])
    cnt = 0

print(minimum)
n, y = map(int, input().split())

y = y // 1000
print(n, y)


def find_by_for(v, n):
    """
        the tuple by example
        ((0, 0, 0), (10, 5, 1), 100, 10)
    """
    queue = []
    queue.append(((0, 0, 0), (1, 5, 10), v, n))
    while queue:
        xs, fv, v, n = queue.pop()
        if v == 0 and n == 0:
            return "%d %d %d\n"%(xs[2], xs[1], xs[0])
        elif not fv or v <= 0 or n <= 0:
            pass
        else:
            queue.append((xs, fv[:-1], v, n))
            z = list(xs) 
            idx = len(fv) -1
            z[idx] +=1
            queue.append((tuple(z), fv, v - fv[idx], n -1))
    return "-1 -1 -1\n"

print(find_by_for(y, n))
    


### FIXED CODE ###



import re 

print(re.sub("2017/01", "2018/01", input()))
import math

x1,y1,x2,y2=map(int,input().split())
answer=(math.sqrt((x2-x1)**2+(y2-y1)**2))
print("{0:.8f}".format(answer))
print()

### FIXED CODE ###

import math

x1,y1,x2,y2=map(float,input().split())
answer=(math.sqrt((x2-x1)**2+(y2-y1)**2))
print("{0:.8f}".format(answer))
a,b=map(int,input(),split())
print(a+b if b%a==0 else b-a)

### FIXED CODE ###

a,b=map(int,input().split())
print(a+b if b%a==0 else b-a)
L = int(input())
print((L/3)**3)

### FIXED CODE ###

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

print(int(n * (n-1) / 2 + m * (m-1) / 2))
from functools import lru_cache

S = input()

DEVIDER = 10**9 + 7


def add(a, b):
    return (a + b) % DEVIDER

def mul(a, b):
    return (a % DEVIDER) * (b % DEVIDER) % DEVIDER

cache_size = len(S) * 4

@lru_cache(maxsize=32)
def check(s, j):
    if j == 0 and s == 'A':
        return True
    if j == 1 and s == 'B':
        return True
    if j == 2 and s == 'C':
        return True
    return False

@lru_cache(maxsize=cache_size)
def dp(i, j):
    if i == len(S) and j == 3:
        # end of task
        return 1
    elif i == len(S) and j < 3 :
        # fail
        return 0
    elif i < len(S) and j == 3:
        # next
        if S[i] == "?":
            return mul(3,  dp(i + 1, 3))
        else:
            return dp(i + 1, 3)
    else:
        # i < len(S) and j < 3
        if S[i] == "?":
            return add(mul(3, dp(i + 1, j)),  dp(i + 1, j + 1))
        if check(S[i], j):
            return add(dp(i + 1, j), dp( i + 1, j + 1))
        return dp(i + 1, j)


ret = dp(0, 0)
print(ret)





### FIXED CODE ###

import sys

S = input()

DEVIDER = 10**9 + 7


def add(a, b):
    return (a + b) % DEVIDER

def mul(a, b):
    return (a % DEVIDER) * (b % DEVIDER) % DEVIDER

cache = [[0 for _ in range(4)] for _ in range(len(S) + 1)]
cache[0][0] = 1


def check(s, j):
    if j == 0 and s == 'A':
        return True
    if j == 1 and s == 'B':
        return True
    if j == 2 and s == 'C':
        return True
    return False


for i in range(len(S)):
    for j in range(4):
        if S[i] == '?':
            cache[i + 1][j] += 3 * cache[i][j]
        else:
            cache[i + 1][j] += cache[i][j]
        if j > 0:
            if check(S[i], j-1) or S[i] == '?':
                cache[i+1][j] += cache[i][j - 1]
        cache[i+1][j] %= DEVIDER

print(cache[len(S)][3])
S = input()
T = input()

for i in S:
  if S[i] != T[i]:
  	i+=1
print(i)


### FIXED CODE ###

S = input()
T = input()
ans = 0
for i in range(len(S)):
  if S[i] != T[i]:
    ans += 1
print(ans)
H,N=map(int,input().split())
A=[]
B=[]
for _ in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)


inf=float('inf')
component=[0]
for i in range(H):
    component.append(inf)
DP=[]
for j in range(N+1):
    DP.append(copy.copy(component))#DPは(N+1)×(H+1)


for k in range(1,N+1):#k番目の魔法
    for l in range(1,H+1):#体力H
        DP[k][l]=min(DP[k-1][l],DP[k][max(0,l-A[k-1])]+B[k-1])

print(DP[N][H])










### FIXED CODE ###

H,N=map(int,input().split())
A=[]
B=[]
for _ in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)


inf=float('inf')
component=[0]
for i in range(H):
    component.append(inf)
DP=[]
for j in range(N+1):
    DP.append(component)#DPは(N+1)×(H+1)


for k in range(1,N+1):#k番目の魔法
    for l in range(1,H+1):#体力H
        DP[k][l]=min(DP[k-1][l],DP[k][max(0,l-A[k-1])]+B[k-1])

print(DP[N][H])
import string

N = int(input())
S = input()

letters = string.ascii_uppercase + string.ascii_uppercase
letters = letters[N:N+26]
mapping = {s: letters[idx] for idx, s in enumerate(S)}

ans = "".join(map(lambda s: mapping[s], S))
print(ans, flush=True)

### FIXED CODE ###

import string

N = int(input())
S = input()

letters = string.ascii_uppercase + string.ascii_uppercase
letters = letters[N:N+26]
mapping = {s: letters[idx] for idx, s in enumerate(string.ascii_uppercase)}

ans = "".join(map(lambda s: mapping[s], S))
print(ans, flush=True)
import itertools

import numpy as np

H, W, M = map(int, input().split())
HW = [list(map(int, input().split())) for _ in range(M)]
F = np.zeros([H, W], dtype=np.int64)

for h, w in HW:
    F[h - 1, w - 1] = 1

# 各方向の和を計算
A = np.sum(F, axis=0)
B = np.sum(F, axis=1)

maxA = np.max(A)
maxB = np.max(B)

# 最大値を取るindex
ind_A = np.arange(W)[A == maxA]
ind_B = np.arange(H)[B == maxB]

cnt = 0
ans = maxA + maxB
for h, w in itertools.product(ind_B, ind_A):
    if F[h, w] == 0:
        break

    cnt += 1
    if cnt == M:
        ans = maxA + maxB - 1
        break
else:
    ans = maxA + maxB - 1

print(ans)


### FIXED CODE ###

import itertools

import numpy as np


def main():
    H, W, M = map(int, input().split())
    HW = [list(map(int, input().split())) for _ in range(M)]

    A = np.zeros(H, dtype=np.int64)
    B = np.zeros(W, dtype=np.int64)

    for h, w in HW:
        A[h - 1] += 1
        B[w - 1] += 1

    maxA = np.max(A)
    maxB = np.max(B)

    # 最大値を取るindex
    ind_A = np.arange(H)[A == maxA]
    ind_B = np.arange(W)[B == maxB]

    # 解の候補の数
    nn = len(ind_A) * len(ind_B)

    # Mより候補の数のほうが多いとok
    # 少ないときはM以下なので可算
    ans = maxA + maxB

    if nn <= M:
        for h, w in HW:
            if A[h - 1] == maxA and B[w - 1] == maxB:
                nn -= 1

    print(ans if nn else ans - 1)


main()
s = input()

if len(set(s)) == 2 and s.count(s[0)) == 2:
    print('Yes')
else:
    print('No')    

### FIXED CODE ###

s = input()

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('Yes')
else:
    print('No')
a,b = map(int,input().split())

x = int(str(a)+str(b))

for i in x:
    if i**2 == x:
        print("Yes")
        break
    elif i**2<x:
        continue
    else:
        print("No")
        break

### FIXED CODE ###

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

x = int(str(a)+str(b))

for i in range(x):
    if i**2 == x:
        print("Yes")
        break
    elif i**2<x:
        continue
    else:
        print("No")
        break
s = list(input())
t = list(input())
N = len(s)
M = len(t)
s.sort()
t.reverse()
if N < M and s == t[:N]:
    print("Yes")
else:
    for i in range(N):
        if s[i] < t[i]:
            print("Yes")
            break
    else:
        print("No")

### FIXED CODE ###

s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
if s < t:
    print("Yes")
else:
    print("No")
n=int(input())
v = list(map(int,input().split()))

dic0 = [0 for i in range(10**5+1)]
dic1 = [0 for i in range(10**5+1)]
for i in range(n):
    if i%2==0:    
        dic0[v[i]] += 1
    if i%2==1:
        dic1[v[i]] += 1

MX0_1 = max(dic0)
MX1_1 = max(dic1)

li0 = []
li1 = []


for i in range(10**5+1):
    # if dic0[i]>10:
    #     print(i,dic0[i])
    # if dic1[i]>10:
    #     print(i,dic1[i],"\n")
    
    if dic0[i] == MX0_1:
        li0.append(i)
        dic0[i] = 0
    if dic1[i] == MX1_1:
        li1.append(i)
        dic1[i] = 0

# print(li0,li1)
# print(MX0_1,MX0_1)

if len(li0)>=2 or len(li1)>=2:
    print(n-MX0_1-MX1_1)
elif li0[0] == li1[0]:
    if MX0_1+max(dic1) >= MX1_1+max(dic0):
        print(n-MX0_1-max(dic1))
    else:
        print(n-MX1_1-max(dic0))
        print(1/0)

elif li0[0] != li1[0]:
    print(n-MX0_1-MX1_1)

### FIXED CODE ###

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

dic0 = [0 for i in range(10**5+1)]
dic1 = [0 for i in range(10**5+1)]
for i in range(n):
    if i%2==0:    
        dic0[v[i]] += 1
    if i%2==1:
        dic1[v[i]] += 1

MX0_1 = max(dic0)
MX1_1 = max(dic1)

li0 = []
li1 = []


for i in range(10**5+1):
    # if dic0[i]>10:
    #     print(i,dic0[i])
    # if dic1[i]>10:
    #     print(i,dic1[i],"\n")
    
    if dic0[i] == MX0_1:
        li0.append(i)
        dic0[i] = 0
    if dic1[i] == MX1_1:
        li1.append(i)
        dic1[i] = 0

# print(li0,li1)
# print(MX0_1,MX0_1)

if len(li0)>=2 or len(li1)>=2:
    print(n-MX0_1-MX1_1)
elif li0[0] == li1[0]:
    print(min(n-MX0_1-max(dic1), n-MX1_1-max(dic0)))
elif li0[0] != li1[0]:
    print(n-MX0_1-MX1_1)
N=int(input())
vs=list(map(int, input().split()))
cs=list(map(int, input().split()))
s=[v-c for v,c in zip(vs,cs) if v-c>0]
print(sum(s))

### FIXED CODE ###

A,B,T=map(int, input().split())
print((T//A)*B)
while True:
    a,op,b = map(str,input().split())
    a = int(a)
    b = int(b)
    
    if a == 0 and b == 0 and op == '?':
        break
    
    if op == '+':
        print('{}'.format(a+b))
    elif op == '-':
        print('{}'.format(a-b))
    elif op == '*':
        print('{}'.format(a*b))
    else :print('{}'.format(int(a/b))) 

### FIXED CODE ###

while True:
    a,op,b = map(str,input().split())
    a = int(a)
    b = int(b)
    
    if op == '?':
        break
    
    if op == '+':
        print('{}'.format(a+b))
    elif op == '-':
        print('{}'.format(a-b))
    elif op == '*':
        print('{}'.format(a*b))
    else :print('{}'.format(int(a/b)))
n, m = map(int, input().split())
py = [[i] + list(map(int, input().split())) for i in range(m)]
py.sort(key=lambda x:(x[1], x[2]))

city = py[1][2]
num = 0

for i in py:
    if i[1] == city:
        num += 1
    else:
        num = 1
        city = i[1]
    i.append(num)

py.sort()

for i in py:
    print('{:06}{:06}'.format(i[1], i[3]))

### FIXED CODE ###

n, m = map(int, input().split())
py = [[i] + list(map(int, input().split())) for i in range(m)]
py.sort(key=lambda x:(x[1],x[2]))

city = py[0][1]
num = 0

for i in py:
    if i[1] == city:
        num += 1
    else:
        city = i[1]
        num = 1
    i.append(num)

py.sort()

for i in py:
    print('{:06}{:06}'.format(i[1], i[3]))