Harryxun/stf_run huggingface dataset:
import sys

sys.setrecursionlimit(100000000)
k = int(input())


def islunlun(l):
    for x in range(1,len(l)):
        if abs(ord(l[x])-ord(l[x-1])) > 1:
            return False
    return True

s = set()
mx = 3234566667
def generate(l):
    val = None
    if l == []:
        val = 0
    else:
        val = int("".join(list(map(str,l))))
    #print(l, val)
    if mx < val:
        return
    else:
        if l != []:
            s.add(val)
    if len(l) == 0:
        for x in range(1,10):
            l.append(x)
            generate(l.copy())
            l.pop(len(l)-1)
    else:
        #print(max(0, l[len(l) - 1] - 1), min(9,l[len(l)-1]+1)+1)
        for x in range(max(0,l[len(l)-1]-1), min(9,l[len(l)-1]+1)+1):
            l.append(x)
            generate(l)
            l.pop(len(l)-1)

"""def bt(l):
    for x in range(10):
        l.append()"""

generate([])
l = []
for x in s:
    l.append(x)
l.sort()
print(l[k-1])

### FIXED CODE ###

import sys

sys.setrecursionlimit(100010)
k = int(input())


def islunlun(l):
    for x in range(1,len(l)):
        if abs(ord(l[x])-ord(l[x-1])) > 1:
            return False
    return True

s = set()
mx = 3234566667
def generate(l):
    val = None
    if l == []:
        val = 0
    else:
        val = int("".join(list(map(str,l))))
    #print(l, val)
    if mx < val:
        return
    else:
        if l != []:
            s.add(val)
    if len(l) == 0:
        for x in range(1,10):
            l.append(x)
            generate(l.copy())
            l.pop(len(l)-1)
    else:
        #print(max(0, l[len(l) - 1] - 1), min(9,l[len(l)-1]+1)+1)
        for x in range(max(0,l[len(l)-1]-1), min(9,l[len(l)-1]+1)+1):
            l.append(x)
            generate(l)
            l.pop(len(l)-1)

"""def bt(l):
    for x in range(10):
        l.append()"""

generate([])
l = []
for x in s:
    l.append(x)
l.sort()
print(l[k-1])
n=str(input())
a=0
for i in range(len(a)):
	if int(n[i])==7:
		a=1
        break
if a==1:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=str(input())
a=0
for i in range(len(n)):
    if int(n[i])==7:
        a=1
        break
if a==1:
  print('Yes')
else:
  print('No')
day = input()
number=int(input())
number = number + 0

alphabet=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")

myIter =iter(day)
out=list()
for x in myIter:
  
  pos = alphabet.index(x)
  out.append(alphabet[pos + number])

print(''.join(out))

### FIXED CODE ###

number=int(input())
day = input()

if number ==0:
  print(day)
else:
  alphabet=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
  myIter =iter(day)
  out=list()
  for x in myIter:
    pos = alphabet.index(x)
    out.append(alphabet[pos + number])
    
  print(''.join(out))
import math


nums = list(map(int, [input() for _ in range(5)]))
s = sum(math.ceil(num / 10) * 10 for num in nums)
m = min(int(str(num)[-1]) for num in nums if num % 10 != 0)
if m != 0:
  s -= (10-m)
print(s)

### FIXED CODE ###

import math


nums = list(map(int, [input() for _ in range(5)]))
s = sum(math.ceil(num / 10) * 10 for num in nums)
m = min([int(str(num)[-1]) for num in nums if num % 10 != 0], default=0)
if m != 0:
  s -= (10-m)
print(s)
K, N = map(int, input().split())
A = sorted(map(int, input().split()))

length = K//2
for i in range(N-1):
    length = max(A[i+1] - A[i] , length)
    if lenghth == A[i+1] - A[i]:
        ans = A[i] + K - A[i+1]
      
if length == K//2:
    ans = A[-1] - A[0]
print(ans)

### FIXED CODE ###

K, N = map(int, input().split())
A = sorted(map(int, input().split()))

length = A[0] + K - A[-1]
for i in range(N-1):
    length = max(A[i+1] - A[i] , length)
    if length == A[i+1] - A[i]:
        ans = A[i] + K - A[i+1]
      
if length == A[0] + K - A[-1]:
    ans = A[-1] - A[0]
print(ans)
# -*- coding: utf-8 -*-

N = int(input())

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

if 0 in A:
    print(0)
    exit(-1)

mul = A[0]
for i in A[1:]:
    mul *= i
    
    if mul > 1000000000000000000:
        print(-1)
        exit(-1)

print(mul)

### FIXED CODE ###

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

import numpy as np

N = int(input())

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

if 0 in A:
    print(0)
    exit(0)

mul = A[0]

if np.sum(A < 0) % 2 == 1:
    for i in A[1:]:
        mul *= i
else:
    for i in A[1:]:
        if 1000000000000000000 / i < mul:
            print(-1)
            exit(0)
        mul *= i

if mul > 1000000000000000000:
    print(-1)
    exit(0)

print(mul)
import math

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

ans = -1

d_count = [0] * (max(d)+1)
for i in range(n):
  d_count[d[i]] += 1

if d[0] != 0 or d_count[0] != 1:
  print(0)
  exit()

ans = 1
for i in range(1,len(d_count)-1):
  ans = ans *  math.pow(d_count[i], d_count[i+1])
  ans = ans % 998244353

ans = ans % 998244353

print(int(ans))

### FIXED CODE ###

n = int(input())

ans = (n-1)//2

print(ans)
n,k = map(int,input().split())
s = list(map(int,input().split()))
# print(s)
now_city = 1
s_l_city = 1
t = [1] #何回そこを通ったか
f = [0] #何回目にそこを通ったか
a=0
f_l=0
for i in range(n-1):
    t.append(0)
    f.append(-1)
# print(s)
sycle = 0
for i in range(1,k+1):
    now_city = s[now_city-1]
    t[now_city-1]+=1
    # f[now_city-1]=i
    for j in range(n):
        if t[j]==2:
        #  print(i,f[j])
         sycle=i-f[j]
         f_l=f[j]
         a = 1
         s_l_city=j+1
         break
    if a==1:
        break
    f[now_city-1]=i
# print(t)
# print(f_l,sycle,s_l_city)
now_city=s_l_city
for j in range((k-f_l)%sycle):
    now_city = s[now_city-1]
print(now_city)

### FIXED CODE ###

N, K = map(int, input().split())
A = input().split()
A = [int(a) for a in A]
S = [1]
a = 1
number = 0
numbers=[-1 for _ in range(N)]
for _ in range(N + 1):
    b = A[a - 1]
    if numbers[b-1] != -1:
      c=numbers[b-1]          #1回目にループが現れた回数-1
    #   print("ループの最初の数字",b,"最初は"+str(c+1)+"回目","周期は",number-c)
      break
    numbers[b-1]=number
    number += 1
    S.append(b)
    a = b
T = S[c+1:number+1]
if K <= number:
  print(S[K ])
else:
  z = K - c-1
  y = z % (number - c)
#   print(y)
  print(T[y])
A=int(raw_input())
B=int(raw_input())
if (A>B):
 print('GREATER')
elif(A==B):
 print('EQUAL')
else:
 print('LESS')

### FIXED CODE ###

s1, s2, s3  =raw_input().split()
print((s1[0]+s2[0]+s3[0]).upper())
def counter():#島の数をカウントする
    count=0
    #12*12個の値をひとつずつ調べる
    for x in range(12):
        for y in range(12):
            if is_data[x][y] == 1:#島が発見されたら
                dfs(x,y)
                count+=1
    return count
def dfs(x,y):
    if x<0 or x == len(is_data[x]) or y<0 or y == len(is_data):
        return
    if is_data[x][y] == 1:
        is_data[x][y] = 0
        dfs(x+1,y)
        dfs(x,y+1)
        dfs(x-1,y)
        dfs(x,y-1)
while True:
    try:
        is_data=[]
        while True:
            s = list(input())#入力
            if not s :#空入力のときループぬける
                break
            is_data.append(s)
    except EOFError:
        print(counter())


### FIXED CODE ###

def counter():#島の数をカウントする
    count=0
    #12*12個の値をひとつずつ調べる
    for x in range(len(is_data)):
        for y in range(len(is_data)):
            if is_data[x][y] == '1':#島が発見されたら
                dfs(x,y)
                count+=1
    return count
def dfs(x,y):
    if x<0 or x == len(is_data) or y<0 or y == len(is_data):
        return
    if is_data[x][y] == '1':
        is_data[x][y] = '0'
        dfs(x+1,y)
        dfs(x,y+1)
        dfs(x-1,y)
        dfs(x,y-1)

is_data=[]
while True:
    try:
        s = list(input())#入力
        if not s:#空入力のとき
            print(counter())
            is_data=[]
            s = []
        else:
            is_data.append(s)
    except EOFError:
        print(counter())
        break
N = int(input())
nood = [[]for i in range(0,N+1,1)]
h_color = [1]*(N+1)
for i in range(1,N,1):
    a,b=map(int,input().split())
    nood[a].append([b,i])
    nood[b].append([a,i])

max_color_count = -1
def bfs(nowNood,preNood,preColor):
    global max_color_count
    colorCount=1
    for i in range(0,len(nood[nowNood]),1):
        if nood[nowNood][i][0]!=preNood:
            if colorCount == preColor:
                colorCount+=1
            h_color[nood[nowNood][i][1]]=colorCount
            bfs(nood[nowNood][i][0],nowNood,colorCount)
        max_color_count = max(max_color_count,colorCount)
        colorCount+=1

bfs(1,-1,-1)
print(max_color_count)
for i in range(1,N,1):
    print(h_color[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
N = int(input())
nood = [[]for i in range(0,N+1,1)]
h_color = [1]*(N+1)
for i in range(1,N,1):
    a,b=map(int,input().split())
    nood[a].append([b,i])
    nood[b].append([a,i])

max_color_count = -1

def bfs(nowNood,preNood,preColor):
    global max_color_count
    colorCount=1
    for i in range(0,len(nood[nowNood]),1):
        if nood[nowNood][i][0]!=preNood:
            if colorCount == preColor:
                colorCount+=1
            h_color[nood[nowNood][i][1]]=colorCount
            bfs(nood[nowNood][i][0],nowNood,colorCount)
            max_color_count = max(max_color_count,colorCount)
            colorCount+=1

bfs(1,-1,-1)
print(max_color_count)
for i in range(1,N,1):
    print(h_color[i])
a1=int(input())
a2=int(input())
a3=int(input())
if a1+a2+a3 >=22:
	print('bust')
else:
	print('win')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c >=22:
	print('bust')
else:
	print('win')
def solve(N, As):
    colors = set()
    allcount = 0
    for a in As:
        if a // 400 < 8:
            colors.add(n)
        else:
            allcount += 1
    return max(len(colors), 1), len(colors) + allcount


if __name__ == "__main__":
    N = int(input())
    As = map(int, input().split(" "))
    m1, m2 = solve(N, As)
    print(m1, m2)


### FIXED CODE ###

def solve(N, As):
    colors = set()
    allcount = 0
    for a in As:
        a -= a % 400
        n = a // 400
        if n < 8:
            colors.add(n)
        else:
            allcount += 1
    return max(len(colors), 1), len(colors) + allcount


if __name__ == "__main__":
    N = int(input())
    As = map(int, input().split(" "))
    m1, m2 = solve(N, As)
    print(m1, m2)
def c_atcodeer_and_election_report(N, R):
    t, a = 1, 1  # 高橋, 青木の票数
    for x, y in R:
        # t<=nx ∧ a<=ny を満たす最小のnを求める
        n = max(t // x, a // y)
        if t > n * x or a > n * y:
            n += 1
        t = n * x
        a = n * y
    return t + a

N = int(input())
R = [[int(i) for i in input().split()] for j in range(N)]
print(c_AtCoDeer_and_ElectionReport(N, R))

### FIXED CODE ###

def c_AtCoDeer_and_ElectionReport(N, R):
    from math import ceil
    from decimal import Decimal
    t = 1  # 高橋の票数
    a = 1  # 青木の票数
    for x, y in R:
        n = Decimal(max(ceil(t / x), ceil(a / y)))
        t = n * x
        a = n * y
    return t + a

N = int(input())
R = [[int(i) for i in input().split()] for j in range(N)]
print(c_AtCoDeer_and_ElectionReport(N, R))
n = int(input())
p = map(int, input().split())

count = 0

for i in range(1, n-1):
    if sorted(p[i-1:i+1]).index(p[i]) == 1:
        count += 1

print(count)

### FIXED CODE ###

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

count = 0

for i in range(1, n-1):
    if sorted(p[i-1:i+2]).index(p[i]) == 1:
        count += 1

print(count)
x =int(input())
for i in range(10000):
 if x == 0:
  break 
  
 print(case i : x)

### FIXED CODE ###

i = 1

while True:

 x=int(input())
 if x==0:
  break
 print("Case {0}: {1}".format(i,x))
 i+=1
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
 
H,W=map(int, input().split())
S = []

S.append(['.']*(W+2))
for _ in range(H):
    S.append(['.']+list(input())+['.'])
S.append(['.']*(W+2))

for i in range(1,W+1):
    for j in range(1,H+1):
        if S[i][j] == "#" and S[i-1][j] == "." and S[i+1][j] == "." and  S[i][j-1] == "." and  S[i][j+1]== ".":
            print("No")
            sys.exit()

print("Yes")

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
 
H,W=map(int, input().split())
S = []

S.append(['.']*(W+2))
for _ in range(H):
    S.append(['.']+list(input())+['.'])
S.append(['.']*(W+2))

for i in range(1,H-1):
    for j in range(1,W-1):
        if S[i][j] == "#" and S[i-1][j] == "." and S[i+1][j] == "." and  S[i][j-1] == "." and  S[i][j+1]== ".":
            print("No")
            sys.exit()

print("Yes")
timeofholiday=int(input())
sum=0
homework_num=int(input())
for i in range(homework_num):
  a=int(input())
  sum+=a
  
if sum > timeofholiday:
  print("-1")
else:
  print(timeofholiday-sum)

### FIXED CODE ###

input_= list(map(int, input().split()))
timeofholiday=input_[0]
sum=0
homework_num=input_[1]
que=list(map(int, input().split()))
for i in que:
  sum+=i
  
if sum > timeofholiday:
  print("-1")
else:
  print(timeofholiday-sum)
r = int(str.input())
return r * r




### FIXED CODE ###

r=int(input())
print(r*r)
# C

import itertools
import bisect

n, m, k = map(int, input().split())
a_l = [int(x) for x in input().split()]
b_l = [int(x) for x in input().split()]

cumsuma_l = list(itertools.accumulate(a_l)) 
cumsumb_l = list(itertools.accumulate(b_l))

_idx = bisect.bisect_left(cumsumb_l, k)
if _idx == m or cumsumb_l[_idx] != _tmp:
    _idx -= 1
ans = _idx + 1
    
for i in range(n):
    _a = cumsuma_l[i]
    if _a > k:
        break
    _tmp = k - _a
    _idx = bisect.bisect_left(cumsumb_l, _tmp)
    if _idx == m or cumsumb_l[_idx] != _tmp:
        _idx -= 1
    ans = max(ans, i + _idx + 2)
        
print(ans)

### FIXED CODE ###

# C

import itertools
import bisect

n, m, k = map(int, input().split())
a_l = [int(x) for x in input().split()]
b_l = [int(x) for x in input().split()]

cumsuma_l = list(itertools.accumulate(a_l)) 
cumsumb_l = list(itertools.accumulate(b_l))

_idx = bisect.bisect_left(cumsumb_l, k)
if _idx == m or cumsumb_l[_idx] != k:
    _idx -= 1
ans = _idx + 1
    
for i in range(n):
    _a = cumsuma_l[i]
    if _a > k:
        break
    _tmp = k - _a
    _idx = bisect.bisect_left(cumsumb_l, _tmp)
    if _idx == m or cumsumb_l[_idx] != _tmp:
        _idx -= 1
    ans = max(ans, i + _idx + 2)
        
print(ans)
N, M, C = map(int,input().split())

B = list(map(int,input().split()))
A = []

for i in range(N):
    A.append(list(map(int,input().split())))

count = 0
for i in range(N):
    x = 0
    for j in range(M):
        x += A[i][j] * B[j]
    if (x+C) > 0:
        count += 1

print(count)

### FIXED CODE ###

H,W = map(int,input().split())
h,w = map(int,input().split())
ans = (H-h)*(W-w)
print(ans)
bmn,km;lghjklm

### FIXED CODE ###

N,K=map(int,input().split())
P=[int(a)-1 for a in input().split()]
C=[int(a) for a in input().split()]
ans=-float("inf")
for si in range(N):
  x=si
  S=[]
  tot=0
  while True:
    x=P[x]
    S.append(C[x])
    tot+=C[x]
    if x==si:
      break
  L=len(S)
  t=0
  for i in range(L):
    t+=S[i]
    if i+1>K:
      break
    now=t
    if tot>0:
      e=(K-i-1)//L
      now+=tot*e
    ans=max(ans,now)
    
print(ans)
N, K = map(int, input().split())

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

ord = [-1 for _ in range(N+1)]
v = 1
root = []

while ord[v] == -1:
    #ordに何回目のワープかが記録される
    ord[v] = len(root)
    #ワープの軌跡を記録
    root.append(v)
    #次の地点にワープ
    v = A[v-1]

# print("len(root)", len(root))
# print("ord[v]", ord[v])
# print("ord", ord)
# print("root", root)

#ord[v]:最終地点（ループ起点 or ループ前の道のり）
l = ord[v]
#ループ距離
c = len(root) - l

if K < l:
    #ループ前にワープが終了した場合、最終地点を出力
    ans = root[K]
else:
    #ループする回数を計算
    K -= l
    K %= c
    res = root[l+K]
print(res)



### FIXED CODE ###

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

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

ord = [-1 for _ in range(N)]
ord[0] = 0
v = A[0]-1
root = [0]

while ord[v] == -1:
    #ordに何回目のワープかが記録される
    ord[v] = len(root)
        #ワープの軌跡を記録
    root.append(v)

    #次の地点にワープ5
    v = A[v]-1

# print(ord)
# print(root)

#ord[v]:最終地点（ループ起点 or ループ前の道のり）
# ループ起点までの余分な手
l = ord[v]
#ループ距離
c = len(root) - l

if K < l:
    #ループ前にワープが終了した場合、最終地点を出力
    ans = root[K]
else:
    #ループする回数を計算
    # はじめにループ起点までの余分手をKから引く
    K -= l
    # ループのmodを計算
    K %= c
    # 余分手＋ループのmodの位置の国に止まる
    ans = root[l+K]
print(ans+1)
x = int(input())
ans = (x//11) * 2
if x%11 <= 6:
    ans += 1
elif x% == 0:
    ans = ans
else:
    ans += 2

print (ans)


### FIXED CODE ###

x = int(input())
ans = (x//11) * 2
if x%11 == 0:
    ans = ans
elif x%11 <= 6:
    ans += 1
else:
    ans += 2

print (ans)
# import sys
# readline = sys.stdin.buffer.readline

# from collections import deque
# from copy import copy,deepcopy
# from itertools import permutations,combinations
# from pprint import pprint

# def myinput():
#     return map(int,input().split())

# def mycol(data,col):
#     return [ row[col] for row in data ]

# def mysort(data,col):
#     data.sort(key=lambda x:x[col],reverse=False)
#     return data

s = input()
t = input()

for i in reversed(range(len(s)-len(t)+1)):
    flag = False
    for j in range(len(t)):
        if j==(len(t)-1):
            if s[i+j]=="?":
                flag = True
            elif s[i+j]==t[j]:
                flag = True
            else:
                flag = False
        elif s[i+j]=="?":
            pass
        elif s[i+j]==t[j]:
            pass
        else:
            flag = False
            break
    if flag:
        break
    else:
        continue

if flag:
    pass
else:
    print("UNRESTORABLE")
    exit()

ans = list(s)

for l in range(len(t)):
    ans[i+l] = t[l]

ans2 = "".join(ans)

# if "?" in ans2:
ans3 = ans2.replace("?","a")
print(ans3)

### FIXED CODE ###

# import sys
# readline = sys.stdin.buffer.readline

# from collections import deque
# from copy import copy,deepcopy
# from itertools import permutations,combinations
# from pprint import pprint

# def myinput():
#     return map(int,input().split())

# def mycol(data,col):
#     return [ row[col] for row in data ]

# def mysort(data,col):
#     data.sort(key=lambda x:x[col],reverse=False)
#     return data

s = input()
t = input()
if len(s)<len(t):
    print("UNRESTORABLE")
    exit()

for i in reversed(range(len(s)-len(t)+1)):
    flag = False
    for j in range(len(t)):
        if j==(len(t)-1):
            if s[i+j]=="?":
                flag = True
            elif s[i+j]==t[j]:
                flag = True
            else:
                flag = False
        elif s[i+j]=="?":
            pass
        elif s[i+j]==t[j]:
            pass
        else:
            flag = False
            break
    if flag:
        break
    else:
        continue

if flag:
    pass
else:
    print("UNRESTORABLE")
    exit()

ans = list(s)

for l in range(len(t)):
    ans[i+l] = t[l]

ans2 = "".join(ans)

# if "?" in ans2:
ans3 = ans2.replace("?","a")
print(ans3)
S=input()
T=input()
print(T+S)

### FIXED CODE ###

S,T=map(str,input().split())
print(T+S)
red = []
blue = []
ans = 0
n = int(input())
for _ in range(n):
    red.append(input())
m = int(input())
for _ in range(n):
    blue.append(input())
for word in set(red):
    if word in blue:
        tmp = red.count(word) - blue.count(word)
    else:
        tmp = red.count(word)
    if tmp > ans:
        ans = tmp
print(ans)

### FIXED CODE ###

red = []
blue = []
ans = 0
n = int(input())
for _ in range(n):
    red.append(input())
m = int(input())
for _ in range(m):
    blue.append(input())
for word in set(red):
    if word in blue:
        tmp = red.count(word) - blue.count(word)
    else:
        tmp = red.count(word)
    if tmp > ans:
        ans = tmp
print(ans)
# -*- coding:utf8 -*-

s = input()
ans = 'Good'
for i in (len(s) - 1):
        if s[i] != s[i+1]:
                ans = 'Bad'
print(ans)

### FIXED CODE ###

# -*- coding:utf8 -*-

s = input()
ans = 'Good'
for i, n in enumerate(s[:3]):
    if s[i + 1] == n:
        ans = 'Bad'
print(ans)
#include<stdio.h>

int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    if (a<b)
    {
        printf("a < b");
    }
    else if (a > b){
        printf("a > b");
    }
    else if (a == b)
    {
        printf("a == b");
    }
    printf("\n");
    return 0;
}


### FIXED CODE ###

a,b = map(int, input().split())
if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
n,m = map(int, input().split())
g = [[] for _ in range(n)]

for i in range(m):
  a,b = map(int, input().split())
  g[a-1] = b-1
  g[b-1] = a-1
  
for nd in g:
  print(len(nd))

### FIXED CODE ###

n,m = map(int, input().split())
g = [[] for _ in range(n)]

for i in range(m):
    a,b = map(int, input().split())
    g[a-1].append( b-1)
    g[b-1].append( a-1)
            
for nd in g:
    print(len(nd))
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
A[A >= A.sum()/(4*M)].count() >= M

### FIXED CODE ###

import numpy as np
N, M = map(int,input().split())
A = np.array(list(map(int,input().split())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')
def findB(tmp):
    count = 0
    for i in tmp:
        if i == "b":
            count += 1
    return count


n, a, b = list(map(int, input().split()))
if a != 0:
    tmp = "b" * a + "r" * b
    all_str = tmp
    while True:
        if len(all_str) >= n:
            break
        all_str = all_str + tmp
    print(findB(all_str[:n]))
else:
    print("0")

### FIXED CODE ###

n, a, b = list(map(int, input().split()))
if a != 0:
    c1 = n // (a + b)
    c2 = n - ((a + b) * c1)
    print(a * c1 + (c2 if c2 < a else a))
else:
    print("0")
S = input().split("/")

if S[5] < 5 :
	print('Heisei')
else :
	print('TBD')

### FIXED CODE ###

s = input()

if s <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")
x = raw_input().split()
m = map(int,x)

sorted(m)
a = m[0]
b = m[1]
c = m[2]

print a,b,c

### FIXED CODE ###

a = list(map(int,input().split()))
for i in range(len(a)):
    for j in range(i,len(a)):
        if a[i] > a[j]:
            ret = a[i]
            a[i] = a[j]
            a[j] = ret
print(" ".join(list(map(str,a))))
n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
ss = ''

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)


### FIXED CODE ###

s = str(input())
  
if s == 'SAT':
  print('1')
  
elif s == 'FRI':
  print('2')
  
elif s == 'THU':
  print('3')
  
elif s == 'WED':
  print('4')

elif s == 'TUE':
  print('5')
  
elif s == 'MON':
  print('6')

else:
  print('7')
S = input()

list = ["eraser","erase","dreamer","dream"]
for x in range(list):
    S = S.replace(x,"")

if len(S) == 0:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

S = input()
S = S.replace('eraser', '')
S = S.replace('erase', '')
S = S.replace('dreamer', '')
S = S.replace('dream', '')
if len(S) == 0:
    print('YES')
else:
    print('NO')