Harryxun/stf_run huggingface dataset:
#!/usr/bin/python

import re
import sys

TOKENS = ["dream", "dreamer", "erase", "eraser"]

def check(s):
    if s in TOKENS:
        return "YES"
    else:
        if len(s) > 5 and s[-5:] in [TOKENS[0], TOKENS[2]]:
            return check(s[0:-5])
        elif len(s) > 6 and s[-6:] == TOKENS[3]:
            return check(s[0:-6])
        elif len(s) > 7 and s[-7:] == TOKENS[1]:
            return check(s[0:-7])
    return "NO"

def main(argv):
    for line in sys.stdin:
        print check(line.rstrip("\n"))

if __name__ == "__main__":
    main(sys.argv)

### FIXED CODE ###

#!/usr/bin/python

import re
import sys

PATTERN = re.compile("(dream|dreamer|erase|eraser)+$")

def main(argv):
    for line in sys.stdin:
        s = line.rstrip("\n")
        if PATTERN.match(s):
            print "YES"
        else:
            print "NO"

if __name__ == "__main__":
    main(sys.argv)
a = [int(input()) for i in range(5)]
A = []
for i in range(5):
    if a[i]%10!=0:
        A.append(10-a[i]%10)
        a[i] += 10-a[i]%10

A.sort()
print(sum(a)-A[-1])
    

### FIXED CODE ###

a = [int(input()) for i in range(5)]
A = []
for i in range(5):
    if a[i]%10!=0:
        A.append(10-a[i]%10)
        a[i] += 10-a[i]%10
 
A.sort()
print(sum(a)-A[-1] if len(A) != 0 else sum(a))
n = int(input())
a = list(range(1, n+1))
p = list(range(2, n+1)) + [1]
m = 0
for i in range(n):
  m += a[i] % p[i]
print(m)

### FIXED CODE ###

n = int(input())
print(n * (n-1) // 2)
a,b = int(input().split())
#lis = list(map(int,input().split()))
if a<b:
    print(0)
else:
    print(10)

### FIXED CODE ###

a,b = map(int,input().split())
#lis = list(map(int,input().split()))
if a<b:
    print("0")
else:
    print("10")
N, X = map(int,input().split())
powder_list = [int(input()) for i in range(n)]
min_powder = min(powder_list)
ans = N
X -= sum(powder_list)
print(ans + X//d)

### FIXED CODE ###

N, X = map(int, input().split())
m = [int(input()) for i in range(N)]
 
print(N + (X-sum(m))//min(m))
def exp(x, n):
	if n == 0:
		return 1
	else:
		return x * exp(x, n-1)

def main():
	inpt = raw_input().split()
	n = int(inpt[0])
	k = int(inpt[1])
	print k * exp(k-1, n-1)
	
main()


### FIXED CODE ###

def main():
	inpt = raw_input().split()
	n = int(inpt[0])
	k = int(inpt[1])
	ans = k
	for i in range(1, n):
		ans *= k - 1
	print ans
	
main()
def main():
    N=int(input())
    a=list(map(int,input().split()))
    cal=1

    if a.index(0)==1:
        print(0)
        return

    for i in range(N):
        cal*=a[i]
        if cal>=10**18:
            print("-1")
            return

    print(cal)
    return


main()


### FIXED CODE ###

def main():
    N=int(input())
    a=list(map(int,input().split()))
    cal=1

    if a.count(0)>=1:
        print(0)
        return

    for i in range(N):
        cal*=a[i]
        if cal>10**18:
            print("-1")
            return

    print(cal)
    return


main()
print((1+N)*(N/2))


### FIXED CODE ###

N = int(input())

ans = ((N-1)*N//2)

print(ans)
h, w = map(int, input().split())
masu = ['.'*(w+2)]
masu += ['.' + input() + '.' for _ in range(w)]
masu.append('.'*(w+2))
ans = 'Yes'
for i in range(1,h-1):
    for j in range(1,w-1):
        if masu[i][j] == '#':
            if masu[i+1][j] == '#' or masu[i-1][j] == '#' or masu[i][j+1] == '#' or masu[i][j-1] == '#':
                continue
            else:
                ans = 'No'
                break
print(ans)

### FIXED CODE ###

h, w = map(int, input().split())
masu = ['.'*(w+2)]
masu += ['.' + input() + '.' for _ in range(h)]
masu.append('.'*(w+2))
ans = 'Yes'
for i in range(1,h+1):
    for j in range(1,w+1):
        if masu[i][j] == '#':
            if masu[i+1][j] == '#' or masu[i-1][j] == '#' or masu[i][j+1] == '#' or masu[i][j-1] == '#':
                continue
            else:
                ans = 'No'
                break
print(ans)
lst = []
for A in A_list:
    next = -1
    for l in lst:
        if (l < A):
            next += 1
    if (next == -1):
        tmp = lst
        lst = [A]
        lst.extend(tmp)
    elif (next == len(lst)):
        lst.append(A)
    else:
        lst[next] = A
print(len(lst))


### FIXED CODE ###

from collections import deque
from bisect import bisect_left
N = int(input())
A = [int(input()) for _ in range(N)]
queue = deque()
for a in A:
    pos = bisect_left(queue, a)
    if (pos == 0):
        queue.appendleft(a)
    else:
        queue[pos-1] = a
print(len(queue))
class G:
    def __init__(self, i):
        self.graph = [i]
        self.id = i
        self.gid = -1


def concat(u, v):
    g1 = data[u].graph
    g2 = data[v].graph
    g = g1 + g2
    all_g.append(g)
    id = min(data[u].id, data[v].id)
    
    for elm in g:
        data[elm].graph = g
        data[elm].id = id

def make_revid(id):
    revid = id + 1 if id %2 == 0 else id - 1
    return revid


def sep_g(u, v):
    global gid_
    global all_gid

    gid0 = data[u].gid
    gid1 = data[v].gid
    cond1 = data[u].gid >= 0
    cond2 = data[v].gid >= 0

    if cond1 or cond2:
        if cond1 and cond2:
            if gid0 <= gid1:
                old_gid = data[v].gid
                new_gid = make_revid(gid0)
                data[v].gid = new_gid
            else:
                old_gid = data[u].gid
                new_gid = make_revid(gid1)
                data[u].gid = new_gid

        elif cond1 and not cond2:
            old_gid = data[v].gid
            new_gid = make_revid(gid0)
            data[v].gid = new_gid
        elif not cond1 and not cond2:
            old_gid = data[u].gid
            new_gid =  make_revid(gid1)
            data[u].gid = new_gid

        all_gid.remove(old_gid)
        all_gid.append(new_gid)

    else:
        data[u].gid = gid_
        data[v].gid = gid_ + 1
        all_gid += [gid_, gid_+1]
        gid_ += 2


gid_ = 0
N = int(input())

odd_pairs = []
all_g = []
all_gid = []

data = {}

for i in range(N):
    g = G(i)
    data[i] = g
    all_g.append(g)

for i in range(N-1):
    u, v, w = [int(elm) for elm in input().split(" ")]
    u -= 1
    v -= 1

    if w %2 == 1:
        odd_pairs.append([u, v, w])
        continue
    
    if v not in data[u].graph:
        concat(u, v)

for u, v, w in odd_pairs:
    sep_g(u, v)


for i in range(N):
    gid = data[i].gid
    if gid < 0:
        out = 0
    else:
        out = gid % 2
    print(out)

### FIXED CODE ###

import sys
if sys.version_info[0] == 2:
    input = raw_input
sys.setrecursionlimit(2 ** 31 -1)

res = None
G = None

def dfs(jibun_v, p, jibun_c):
    global res
    global G

    res[jibun_v] = jibun_c
    #print(jibun_v, p, jibun_c)

    tonari_nodes = G[jibun_v]
    for tonari_v, w in tonari_nodes:
        #if tonari_v == p: # only no loop
        #if tonari_v == p or res[tonari_v] != -1:
        if res[tonari_v] != -1:
            continue

        else:
            if w % 2 == 0:
                tonari_c = jibun_c
            else:
                tonari_c = 1 - jibun_c

            dfs(tonari_v, jibun_v, tonari_c)
    

def main():
    N= int(input())

    global G
    G = [[] for _ in range(N)]

    for i in range(N-1):
        u, v, w = map(int, input().split(" "))
        u -= 1
        v -= 1
        w = w % 2
        G[u].append([v, w])
        G[v].append([u, w])

    global res
    res = [-1 for _ in range(N)]
    
    jibun_v = 0
    p = -1
    jibun_c = 0
    dfs(jibun_v, p, jibun_c)

    for i in range(N):
        print(res[i])

main()
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

M = mod = 10**9 +7
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]
def li4():return [float(i) for i in input().rstrip('\n').split(' ')]


def dfs(root):
    global ans,g
    if ans[root]:return 

    temp = 0
    for j in g[root]:dfs(j)
    if len(g[root]):temp = max(ans[j] for j in g[root])
    ans[root] = 1 + temp

n,m = li()
g = defaultdict(set)
for i in range(m):
    a,b = li()
    g[a].add(b)

ans = [0]*(n + 1)

for j in range(1,n + 1):
    if not ans[j]:dfs(j)

print(max(ans) - 1)

### FIXED CODE ###

from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
M = mod = 10**9 +7
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]
def li4():return [float(i) for i in input().rstrip('\n').split(' ')]


def dfs(root):
    global ans,g
    if ans[root]:return 

    temp = 0
    for j in g[root]:dfs(j)
    if len(g[root]):temp = max(ans[j] for j in g[root])
    ans[root] = 1 + temp

n,m = li()
g = defaultdict(set)
for i in range(m):
    a,b = li()
    g[a].add(b)

ans = [0]*(n + 1)

for j in range(1,n + 1):
    if not ans[j]:dfs(j)

print(max(ans) - 1)
n=input()
n.split(" ")
if int(n[0])*int(n[1]) < int(n[2]):
  print(int(n[0])*int(n[1]))
else:
  print(int(n[2]))
  

### FIXED CODE ###

i=input()
ii = i.split()
if int(ii[0]) * int(ii[1]) < int(ii[2]):
  print(int(ii[0]) * int(ii[1]))
else:
  print(int(ii[2]))
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

import sys
sys.setrecursionlimit(100000)

# N <= 2*10^5
# Q <= 2*10^5
N, Q = [int(x) for x in stdin.readline().rstrip().split()]
#ab = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N-1)]
#px = [list(map(int, stdin.readline().rstrip().split())) for _ in range(Q)]

ans = [0] * (N+1)
child = []
for _ in range(N+1):
    child.append([])

def add(node, num):
    for x in child[node]:
        add(x, num)

    ans[node] += num

for a, b in [list(map(int, stdin.readline().rstrip().split())) for _ in range(N-1)]:
    child[a].append(b)

#print(child)

for p, x in [list(map(int, stdin.readline().rstrip().split())) for _ in range(Q)]:
    add(p, x)

print(*ans[1:], sep=" ")

### FIXED CODE ###

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

# N <= 2*10^5
# Q <= 2*10^5
N, Q = [int(x) for x in stdin.readline().rstrip().split()]
ab = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N-1)]
px = [list(map(int, stdin.readline().rstrip().split())) for _ in range(Q)]

node_value = [0] * (N+1)
parent = [-1] * (N+1)

for a, b in ab:
    parent[b] = a

for p, x in px:
    node_value[p] += x

#print(parent)

ans = [0] * (N+1)

for i in range(1, N+1):
    ans[i] = node_value[i]
    if parent[i] != -1:
        ans[i] += ans[parent[i]]

print(*ans[1:], sep=" ")
from collections import Counter

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

q1=[]
q2=[]

for i in range(n):
  q1.append(i+a[i])
  q2.append(i-a[i])

c2=Counter(q2)

ans=0
for i in c1.keys():
  ans+=c2[i]

print(ans)

### FIXED CODE ###

from collections import Counter

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

q1=[]
q2=[]

for i in range(n):
  q1.append(i+a[i])
  q2.append(i-a[i])

c1=Counter(q1)
c2=Counter(q2)

ans=0
for i in c1.keys():
  num1=c1[i]
  num2=c2[i]
  ans+=num1*num2

print(ans)
s = str(input())

T = ["dream", "dreamer", "erase", "eraser"]

new_s =reversed(s)
new_t = []
for item in T:
  new_t.append(reversed(item))

ans_t =''
  
for c in new_s:
  collector += c
  if collector in new_t:
    ans_t += collector
    collector = ''
    
if new_s == ans_t:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

s = str(input())

T = ["dream", "dreamer", "erase", "eraser"]

new_s =s[::-1]
new_t = []
for item in T:
  new_t.append(item[::-1])

ans_t =''
collector = ''

for c in new_s:
  collector += c
  if collector in new_t:
    ans_t += collector
    collector = ''
    
if new_s == ans_t:
  print('YES')
else:
  print('NO')
a, b = exec(input().replace(' ', ','))
print("{} {}".format(a*b, 2(a+b)))

### FIXED CODE ###

a, b = eval(input().replace(' ', ','))
print("{} {}".format(a*b, 2*(a+b)))
n=int(input())
l=[int(i) for i in input().split()]
from collections import Counter 
c=Counter(l)
arr=[i for i in c if c[i]>=2]
arr.sort(reverse=1)
if len(arr)==1:
    print(0)
else:
    print(arr[0]*arr[1])

### FIXED CODE ###

n=int(raw_input())
l=[int(i) for i in raw_input().split()]
from collections import Counter 
c=Counter(l) 
ans=[]
for i in c: 
    if c[i]>=2:
        ans=ans+[i]*(c[i]//2)
ans.sort(reverse=1)
if len(ans)<=1:
    print(0)
else: 
    print(ans[0]*ans[1])
# -*- coding: utf-8 -*-
N = int(input())
array = [map(int,input().split())]
n = 0
for i in range(N+1):
  if array[i] % 2 == 0:
    continue    
  else:
    break
n = n+1
continue
print(n)

### FIXED CODE ###

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

P = []

for i in A:
    ans = 0
    while int(i) == i:
        i = i/2
        ans += 1
    P.append(ans)

print(min(P)-1)
import math
a,b,c=map(float,raw_input().split())
c = c / 180 * math.pi

print "%.10f" % float(a*b*math.sin(c)/2)
x = math.sqrt(a**2 + b**2)*cos(c)
print "%.10f" % float(a + b + x)
print "%.10f" % float(b*math.sin(c))

### FIXED CODE ###

import math
a, b, c = map(float, raw_input().split())
c = c/180*math.pi
 
print a*b*math.sin(c)/2
print a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c))
print b*math.sin(c)
n = input()
print(n*n*n)

### FIXED CODE ###

n = int(input())
print(n*n*n)
import sys
import numpy as np
 
n = int(input())
lst = [int(i) for i in sys.stdin.readline().split()]
arr = np.array(lst, np.int64)

mod = 10 ** 9 + 7
x_sum = 0

for i in range(60):
    c1 = sum(lst & 1)
    x_sum += (c1 * (n - c1) * 2 ** i)
    x_sum %= mod
    lst >>= 1
print(x_sum)

### FIXED CODE ###

import sys
import numpy as np
 
n = int(input())
lst = [int(i) for i in sys.stdin.readline().split()]
arr = np.array(lst, np.int64)

mod = 10 ** 9 + 7
x_sum = 0

for i in range(60):
    c1 = np.count_nonzero(arr & 1)
    x_sum += (c1 * (n - c1) * 2 ** i)
    x_sum %= mod
    arr >>= 1
print(x_sum)
n = input()
X = map(int, raw_input().split())

if n > 10:
    exit(1)

cur = 1
for i in xrange(n):
    if cur <= X[i]:
        X[i] = cur
        cur += 2
    else:
        cur = X[i]+2

ALL = 2**n-1
memo = {}
def dfs(state):
    if state in memo:
        return memo[state]
    if state == ALL:
        return 1
    Y = X[:]
    cur = 1
    for i in xrange(n):
        if (state >> i) & 1:
            continue
        if cur <= Y[i]:
            Y[i] = cur
            cur += 2
        else:
            cur = Y[i]+2
    res = 0
    prev = -100
    for i in xrange(n):
        if (state >> i) & 1:
            continue
        res = (res + dfs(state | (1 << i))) % (10**9 + 7)
        if prev+1 == Y[i]:
            break
        prev = Y[i]
    memo[state] = res
    return res
print dfs(0)


### FIXED CODE ###

n = input()
X = map(int, raw_input().split())

MOD = 10**9+7

ans = 1
res = 0
for i in xrange(n):
    while 2*res+1 > X[i]:
        ans = (ans * (res+1)) % MOD
        res -= 1
    res += 1
while res:
    ans = (ans * res) % MOD
    res -= 1
print ans
A, B, C, K = list(map(int,input().split()))
count = 0
s = 0
if A > K:
	print(K)
elif A+B > K:
	print(A)
else:
	print(2*A + B - K)


### FIXED CODE ###

S = input()
T = input()
N = len(T)
T2 = T[0:N-1]
if S == T2:
	print('Yes')
else:
	print('No')
N = int(input())
if N % 2 ==0:
  print(1/2)
elif N == 1:
  print(1)
else:
  print((N-N//2)/N)N = int(input())
if N % 2 ==0:
  print(1/2)
elif N == 1:
  print(1)
else:
  print((N-N//2)/N)

### FIXED CODE ###

N = int(input())
if N % 2 ==0:
  print(1/2)
elif N == 1:
  print(1)
else:
  print((N//2+1)/N)
# -*- coding: utf-8 -*-
from scipy.misc import comb

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

mod = int(10 ** 9 + 7)

for i in range(1, k + 1):
    if i > n - k + 1:
        print(0)
    else:
        print(comb(k - 1, i - 1) * comb(n - k + 1, i) % mod)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, k = map(int, input().split())

mod = int(10 ** 9 + 7)


def comb(n, k):
    res = 1
    for i in range(k):
        res *= n - i
    for i in range(k):
        res //= k - i
    return res

for i in range(1, k + 1):
    if i > n - k + 1:
        print(0)
    else:
        print(comb(k - 1, i - 1) * comb(n - k + 1, i) % mod)
N,C = list(map(int,input().split()))
D = [ list(map(int,input().split()))  for i in range(C)]
c = [ list(map(int,input().split()))  for i in range(N)]

sep = {0:[0 for i in range(C)],1:[0 for i in range(C)],2:[0 for i in range(C)]}
for i,cx in enumerate(c):
    for j,cy in enumerate(cx):
        if len(c) == 2 and (i + j) % 3 == 2:
            sep[(i + j) % 3 - 1][cy -1] += 1
        else:
            sep[(i + j) % 3][cy - 1] += 1
minimums = [[],[],[]]
for key,values in sep.items():
    for i in range(C):
        m0 = 0
        am0 = 0
        m1 = 0
        am1 = 1
        deposit = 0
        for j,value in enumerate(values):
            deposit += D[j][i] * valuea
        sep[key].append(deposit)
min0 = min(sep[0])
min1 = min(sep[1])
min2 = min(sep[2])

print(min1 + min2 + min0)


### FIXED CODE ###

N = int(input())            
if N > 999:                 
    print("ABD")            
else:                       
    print("ABC")
loop, magic_cost = map(int, input().split(" "))
cost = [n for n in map(int, input().split(" "))]
answer = float("inf")
min_costs = [float(inf) for n in range(loop)]
for i in range(loop):
    for j in range(loop):
        min_costs[j] = min(min_costs[j], cost[(i - j) % loop])
    answer = min(answer, sum(min_costs) + (magic_cost * (i) ) )
print(answer)

### FIXED CODE ###

loop, magic_cost = map(int, input().split(" "))
cost = [n for n in map(int, input().split(" "))]
answer = float("inf")
min_costs = [float("inf") for n in range(loop)]
for i in range(loop):
    for j in range(loop):
        min_costs[j] = min(min_costs[j], cost[(i - j) % loop])
    answer = min(answer, sum(min_costs) + (magic_cost * (i) ) )
print(answer)
def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + n % b

n = int(input())
s = int(input())

for i in range(2, int(n**0.5) + 3):
    if f(i, n) == s:
        print(i)
        exit()

ans = 10**12
for k in range(1, int(n**0.5) + 3):
    if (n-s) % k != 0 or n-s < 0:
        continue
    b = (n-s)//k + 1
    if f(b, n) == s:
        ans = min(b, ans)

if ans != 10**12:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + n % b

n = int(input())
s = int(input())
if n == s:
    print(n + 1)
    exit()
    
for i in range(2, int(n**0.5) + 3):
    if f(i, n) == s:
        print(i)
        exit()

ans = 10**13
for k in range(1, int(n**0.5) + 3):
    if (n-s) % k != 0 or n-s < 0:
        continue
    b = (n-s)//k + 1
    if b == 1:
        continue
    if f(b, n) == s:
        ans = min(b, ans)

if ans != 10**13:
    print(ans)
else:
    print(-1)
s,t=map(int,input().split())
print("Yes" if t>=s else "No")

### FIXED CODE ###

s=input()
t=input()
if s==t[:-1]:
	print("Yes")
else:
  	print("No")
n = int(input())
monster = sorted(list(map(int,input().split())))
min_HP = min(monster)
cnt=0
while True:
  tmp = int(monster[-1]/monster[-2])
  monster[-1]-=monster[-2]*tmp
  if monster[-1]<=0:
    monster.pop(-1)
  monster = sorted(monster)
  if min_HP==monster[0]:
    cnt+=1
    if cnt>=2:
      print(min_HP)
      exit()
  else:
    min_HP = monster[0]
    cnt=0
  print(monster)

### FIXED CODE ###

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

n = int(input())
monster = sorted(list(map(int,input().split())))
ans = []
for i in range(n-1):
  g = gcd(monster[i], monster[i+1])
  ans.append(g)
print(min(ans))
while True:
    i = input()
    if i == "0 0":
        break
    else:
        i.sort()
        print(i)

### FIXED CODE ###

while True:
    i = input()
    if i == "0 0":
        break
    else:
        i_list = i.split()
        int_list = []
        int_list.append(int(i_list[0]))
        int_list.append(int(i_list[1]))
        int_list.sort()
        print(int_list[0],int_list[1])
N, M = map(int, input().split())
timeline = []
for i in range(M):
    P, Y = map(int, input().split())
    timeline.append((Y, P, i))
timeline.sort()
count = [0] * (N + 1)
number = [(0, 0)] * M
for y, p, i in timeline:
    count[p] += 1
    number[i] = (p, count[p])
for i in range(M):
    print(f'{number[i][0]:06}{number[i][1]:06}')


### FIXED CODE ###

N, M = map(int, input().split())
timeline = []
for i in range(M):
    P, Y = map(int, input().split())
    timeline.append((Y, P, i))
timeline.sort()
count = [0] * (N + 1)
number = [(0, 0)] * M
for y, p, i in timeline:
    count[p] += 1
    number[i] = (p, count[p])
for i in range(M):
    print('{:06}{:06}'.format(number[i][0], number[i][1]))
from collections import Counter
from math import factorial
N,A,B = map(int,input().split())
V=list(map(int,input().split()))

V_C=Counter(V)

max_val=max(V)
CC=V_C[max_val]
if A<=CC<=B:
    ans=0
    for v in range(A,min(B+1,CC+1)):
        ans+=factorial(CC)//factorial(v)//factorial(CC-v)
    print(max_val)
    print(ans)
    exit()


tmp_sum=0
tmp_num=0

for key in sorted(V_C.keys(),reverse=True):
    val = V_C[key]
    if tmp_num+val<=B:
        tmp_num+=val
        tmp_sum+=key*val
        if tmp_num>=A:
            break
    else:
        break

if A<=tmp_num<=B:
    print(tmp_sum/tmp_num)
    print(1)
else:
    assert 1==2
    rest=A-tmp_num
    tmp_num+=rest
    tmp_sum+=key*rest
    print(tmp_sum/tmp_num)
    print(factorial(val)//factorial(rest)//factorial(val-rest))





### FIXED CODE ###

from collections import Counter
from collections import Counter
N, A, B = (list)(map(int, input().split()))
v = (list)(map(int, input().split()))

v = sorted(v, reverse=True)

sel_list = v[:A]
max_ave = sum(sel_list)/A
print(max_ave)

c = Counter(v)


def comb(n, r):
    r = min(r, n-r)
    ret = 1
    for i in range(r):
        ret *= (n-i)/(i+1)
    return ret


def ave_n(n):
    sel_list = v[:n]
    ave = sum(sel_list)/i
    if ave != max_ave:
        return 0
    last = sel_list[-1]
    use_last = sel_list.count(last)
    return comb(c[last], use_last)


ans = 0
for i in range(A, B+1):
    ret = ave_n(i)
    if ret == 0:
        break
    else:
        ans += ret
print((int)(ans))
a = list(int.input().split())
if a[0]=a[-1]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a=input()
if a[0]==a[2]:
  print("Yes")
else:
  print("No")