Harryxun/stf_run huggingface dataset:
import sys
X, Y, A, B, C = sys.stdin.readline()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = map(int, sys.stdin.readline().split())
scoreB = map(int, sys.stdin.readline().split())
scoreC = map(int, sys.stdin.readline().split())
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X-1]
scoreB = scoreB[:Y-1]
scoreAll = scoreA + scoreB + scoreC
total = sum(scoreAll)


### FIXED CODE ###

import sys
X, Y, A, B, C = sys.stdin.readline().split()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = list(map(int, sys.stdin.readline().split()))
scoreB = list(map(int, sys.stdin.readline().split()))
scoreC = list(map(int, sys.stdin.readline().split()))
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X]
scoreB = scoreB[:Y]
scoreAll = scoreA + scoreB + scoreC
scoreAll.sort(reverse=True)
print(sum(scoreAll[:X+Y]))
H, A = map(int,input().split())

if(h % A != 0):
    print(H // A + 1)
else:
    print(H // A)


### FIXED CODE ###

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

if(H % A != 0):
    print(H // A + 1)
else:
    print(H // A)
n, k = [int(e) for e in input().strip().split(' ')]
s = input().strip()

cnts = []
# denote whether the first block is 0 or 1
tmp, cnt = s[0], 0
flag = int(s[0])

for i in range(n):
  if s[i] == tmp:
    cnt += 1
    else: # here tmp should be cleared
      cnts.append(cnt)
      cnt = 1
      tmp = s[i]
      cnts.append(cnt)
      print(cnts)

      n_zero = (len(cnts) + 1) // 2 if flag == 0 else len(cnts) // 2
      # print("# of zeros block: ", n_zero)
      if n_zero <= k:
        ans = sum(cnts)
        else:
          ans = 0
          for inx in range(flag, len(cnts), 2):
            start = max(0, inx - 1)
            end = min(inx + 2 * k, len(cnts))
            tmp = sum(cnts[start: end])
            ans = max(tmp, ans)

            print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
s = [int(x) for x in list(input())]

state = 1
cnt = 0
l = []
for e in s:
    if e != state:
        l.append(cnt)
        cnt = 1
        state = e
    else:
        cnt += 1

if cnt != 0:
    l.append(cnt)


if len(l) % 2 == 1:
    l.append(0)

Add = 2 * k + 1
ruiseki = [0]

for i, e in enumerate(l):
    ruiseki.append(ruiseki[i] + l[i])

answer = 0
for i in range(0, len(l), 2):
    left = i
    right = min(i + Add, len(l))
    tmp = ruiseki[right] - ruiseki[left]
    answer = max(tmp, answer)

print(answer)
n = int(input())
P = [int(x) for x in input().split()]
cnt = 0
for i in range(1, n - 1):
  if p[i - 1] < p[i] and p[i + 1] < p[i]:
    continue
  if p[i] < p[i - 1] and p[i] < p[i + 1]:
    continue
  cnt += 1
print(cnt)

### FIXED CODE ###

n = int(input())
P = [int(x) for x in input().split()]
cnt = 0
for i in range(1, n - 1):
  if P[i - 1] < P[i] and P[i + 1] < P[i]:
    continue
  if P[i] < P[i - 1] and P[i] < P[i + 1]:
    continue
  cnt += 1
print(cnt)
#a,b=map(int,input().split())
n=int(input())
#s=input()
ans=0
for i in range(n):
  ans*=(n%mod)
  ans%=mod
print(ans)

### FIXED CODE ###

#a,b=map(int,input().split())
n=int(input())
mod=10**9+7
#s=input()
ans=1
for i in range(1,n+1):
  ans*=(i%mod)
  ans%=mod
print(ans%mod)
num_str=input().split()
num=list(map(int, num_str))
n=num[0]
x=num[1]
num2_str=input().split()
distance=list(map(int, num2_str))

first_distance=list(map(lambda y:abs(y-x),distance))
min_distance=min(first_distance)

gcd=gcd(first_distance[0],first_distance[1])
for i in range(2,n):
    gcd=gcd(gcd,first_distance[i])
print(gcd)

### FIXED CODE ###

num_str=input().split()
num=list(map(int, num_str))
n=num[0]
x=num[1]
num2_str=input().split()
distance=list(map(int, num2_str))

first_distance=list(map(lambda y:abs(y-x),distance))
min_distance=min(first_distance)

def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)


if n==1:
    print(first_distance[0])
else:
    element = gcd(first_distance[0], first_distance[1])
    if n==2:print(element)
    else:
        for i in range(2,n):
            element=gcd(element,first_distance[i])
        print(element)
n,a,b=int(input().split())
if (b-a+1)%2==0:
    print("Borys")
else:
    print("Alice")

### FIXED CODE ###

n,a,b=map(int,input().split())
if (b-a+1)%2==0:
    print("Borys")
else:
    print("Alice")
x,n = map(int, input().split())
i = list(map(int, input().split()))

if n ==0:
  print(x)
  
if x not in i:
  print(x)
  
  else:
    p = 1
    while True:
      z = x - p
      if z not in i:
        print(z)
        break
        
      z = x + p
      if z not in i:
        print(z)
        break
        
      p = p +1
        
      
        
      
      
      
    
  
  



### FIXED CODE ###

x,n = map(int, input().split())
if n ==0:
  print(x)
if n != 0:
  i = list(map(int, input().split()))


  
  if x not in i:
    print(x)
  
  else:
    p = 1
    while True:
      z = x - p
      if z not in i:
        print(z)
        break
        
      z = x + p
      if z not in i:
        print(z)
        break
        
      p = p +1
x = A+B
Y = A-B
Z = A*B

print(max(X,Y,Z))

### FIXED CODE ###

A, B = map(int, input().split())
x = A+B
y = A-B
z = A*B

print(max(x,y,z))
from collections import deque
import bisect
import sys


N = int(input())
a = list(map(int, input().split()))
uvs = [list(map(int, input().split())) for _ in range(N-1)]

routes = [[] for _ in range(N)]

for uv in uvs:
    routes[uv[0]-1].append(uv[1]-1)
    routes[uv[1]-1].append(uv[0]-1)

lis = [10e+100 for _ in range(N)]
shortest = [10e+100 for _ in range(N)]
shortest[0] = 0
minimum = [10e+100 for _ in range(N)]
seen = [False for _ in range(N)]
seen[0] = True

def function(checking):
    insert_posi = bisect.bisect_left(lis, a[checking])
    preserved = lis[insert_posi]
    lis[insert_posi] = a[checking]
    minimum[checking] = bisect.bisect_left(lis, 10e+50)
    print(minimum[checking])
    for route in routes[checking]:
        if seen[route] == False:
            shortest[route] = shortest[checking]+1
            seen[route] = True
            function(route) 
    lis[insert_posi] = preserved# callback
    return
        
function(0)

### FIXED CODE ###

from collections import deque
import bisect
import sys

sys.setrecursionlimit(200000)

N = int(input())
a = list(map(int, input().split()))
uvs = [list(map(int, input().split())) for _ in range(N-1)]
shortest = [10e+10 for _ in range(N)]
shortest[0] = 0

routes = [[] for _ in range(N)]

for uv in uvs:
    routes[uv[0]-1].append(uv[1]-1)
    routes[uv[1]-1].append(uv[0]-1)

lis = [10e+100 for _ in range(N)]
minimum = [10e+100 for _ in range(N)]
seen = [False for _ in range(N)]
seen[0] = True

def function(checking):
    insert_posi = bisect.bisect_left(lis, a[checking])
    preserved = lis[insert_posi]
    lis[insert_posi] = a[checking]
    minimum[checking] = bisect.bisect_left(lis, 10e+50)
    for route in routes[checking]:
        if seen[route] == False:
            seen[route] = True
            shortest[route] = shortest[checking]+1
            function(route)
    lis[insert_posi] = preserved
    return
        
function(0)

[print(x) for x in minimum]
s=list(map(int,list(input())))
n=len(s)
m=[[0]*(n+1) for _ in range(n+1)]
ans=0
for i in range(1,n+1):
    for j in range(i,n+1):
        m[i][j]=(m[i][j-1]*10+s[j-1])%2019
        if m[i][j]==0:
            ans+=1
print(ans)

### FIXED CODE ###

s,w=map(int,input().split())
if w>=s:
    print('unsafe')
else:
    print('safe')
, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
# X1, X2, Y1, Y2 = 0, W, 0, H
X1 = 0
X2 = W
Y1 = 0
Y2 = H

for x, y, a in P:
    if a == 1:
        X1 = max(X1, x)
    elif a == 2:
        X2 = min(X2, x)
    elif a == 3:
        Y1 = max(Y1, y)
    elif a == 4:
        Y2 = min(Y2, y)
else:
    if X2 <= X1 or Y2 <= Y1:
        print(0)
    else:
        print((X2 - X1) * (Y2 - Y1))

### FIXED CODE ###

[a,b,c]=list(map(int,input().split()))
if a+b==c or a+c==b or b+c==a :
    print("Yes")
else:
    print("No")
n  = int(input())
red = []
red_x = []
blue = []
blue_y = []
for i in range(n):
    a, b = map(int,input().split())
    red.append([a,b])
    red_x.append(a)
    
for i in range(n):
    c, d = map(int,input().split())
    blue.append([c,d])
    blue_y.append(d)

count = 0    
for i in range(n):
    p = max(red_x)
    s = min(blue_y)
    q = 0
    r = 0
    jjj = 0
    kkk = 0
    for j in range(n):
        if red[j][0] == p:
            q = red[j][1]
            jjj = j
    for k in range(n):
        if blue[k][1] == s:
            r = blue[k][0]
            kkk = k
            
    if p < r and q < s:
        count = count + 1 
        red_x.remove(p)
        blue_y.remove(s)
        red.remove(red[jjj])
        blue.remove(ble[kkk])


    else:
        None
        
print(count)

### FIXED CODE ###

n = int(input())
red = []
blue = []

for i in range(n):
    a, b = map(int,input().split())
    red.append([a,b])
    

for i in range(n):
    c, d = map(int,input().split())
    blue.append([c,d])
    
red_sort = list(reversed(sorted(red, key=lambda y: y[1])))
blue_sort = sorted(blue, key=lambda x: x[0])

# print(red_sort)
# [[1, 3], [2, 0], [3, 1]]
# print(blue_sort)
# [[4, 2], [0, 4], [5, 5]]

pair = []
for blue_point in blue_sort:
    x_blue = blue_point[0]
    y_blue = blue_point[1]
    
    for red_point in red_sort:
        x_red = red_point[0]
        y_red = red_point[1]
        
        if x_red<x_blue and y_red<y_blue:
            if not (red_point in pair) and not (blue_point in pair):
                pair.append(red_point)
                pair.append(blue_point)
    
print(len(pair) // 2)
def main():
	N, K = map(int, input().split())
	h = list(map(int, input().split()))
	INF = 10**9
	dp = [INF] * N
	dp[0] = 0
	for i in range(N):
    	for k in range(1, K+1):
        	if i + k < N:
            	dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
        	else:
            	break
	print(dp[N-1])

if __name__ == '__main__':
  main()


### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
INF = 10**9
dp = [INF] * N
dp[0] = 0
for i in range(N):
    for k in range(1, K+1):
        if i + k < N:
            dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
print(dp[N-1])
n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0
for b in B:
    ans += bisect.bisect_left(A, b) * (n - bisect.bisect_right(C, b))
    
print(ans)

### FIXED CODE ###

import bisect

n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0
for b in B:
    ans += bisect.bisect_left(A, b) * (n - bisect.bisect_right(C, b))
    
print(ans)
def main(n,a,b,c):
  import bisect
  ans=0
  todo=[[ai] for ai in a]
  while len(todo)>0:
    d=todo.pop()
    if len(d)==1:
      l=bisect.bisect_right(b,d[-1])
      for li in b[l:]:
        e=d.copy()
        e.append(li)
        todo.append(e)
    if len(d)==2:
      l=bisect.bisect_right(c,d[-1])
      for li in c[l:]:
        e=d.copy()
        e.append(li)
        todo.append(e)
    if len(d)==3:
      ans+=1
  print(ans)
if __name__=='__main__':
  n=int(input())
  a=sorted(list(map(int,input().split())))
  b=sorted(list(map(int,input().split())))
  c=sorted(list(map(int,input().split())))
  main(n,a,b,c)


### FIXED CODE ###

def main(n,a,b,c):
  import bisect
  ans=0
  for i in range(n):
    na=bisect.bisect_left(a,b[i])
    nc=n-bisect.bisect_right(c,b[i])
    ans+=na*nc
  print(ans)
if __name__=='__main__':
  n=int(input())
  a=sorted(list(map(int,input().split())))
  b=sorted(list(map(int,input().split())))
  c=sorted(list(map(int,input().split())))
  main(n,a,b,c)
S = int(input())
h = int(S / 3600)
m = int(S / 60)
m = m % 60
s = m % 60
print({0}:{1}:{2}.format(h,m,s))

### FIXED CODE ###

S = int(input())
h = int(S / 3600)
m = int(S / 60)
m = m % 60
s = S % 60
print("{0}:{1}:{2}".format(h,m,s))
import fractions
from functools import reduce
n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
    a[i] = a[i]//2
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(a)#aの要素をすべて2で割った数列の最小公倍数
#にぶんたんさく(lcmをｘ倍してｍを超えないようなギリギリのｘ)
bottom = 0#
top = m+1#m//2くらいで十分だけど大きめにとる
while top - bottom > 1:
    middle = (top+bottom )//2
    if lcm * middle <= m:
        bottom = middle
    else:
        top = middle

ok = True
for i in range(1, N):
    c = 0
    while a[i] % 2 == 0:
        a[i] //= 2
        c+= 1
    if cnt != c :ok = False
if not ok:
    print(0)
    exit(0)

print(( bottom+1)//2)


### FIXED CODE ###

import fractions
from functools import reduce
n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
    a[i] = a[i]//2
wa=[]
for i in range(n):
    p=a[i]
    f=0
    while p%2==0:
        p=p//2
        f+=1
    wa.append(f)
if max(wa)!=min(wa):
    print(0)
    exit()
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(a)#aの要素をすべて2で割った数列の最小公倍数
#にぶんたんさく(lcmをｘ倍してｍを超えないようなギリギリのｘ)
bottom = 0
top = m+1#m//2くらいで十分だけど大きめにとる
while top - bottom > 1:
    middle = (top+bottom )//2
    if lcm * middle <= m:
        bottom = middle
    else:
        top = middle



print(( bottom+1)//2)
A, B = [int(i) for i in input().split()]
if B >= A and 4*(B-A) == A and 5*(B-A) == B:
  print(50(B-A))
else:
  print(-1)
  

### FIXED CODE ###

import math
import sys
A, B = [int(i) for i in input().split()]
for i in range(math.ceil(12.5 * A), math.ceil(12.5 * (A + 1))):
    if math.floor(i//10) == B:
        print(i)
        sys.exit()
print(-1)
A,B,N = list(map(int,input().split()))
if N <= 10000:
    C = [A*i//B-(A*(i//B)) for i in range(1,N+1)]
    print(max(C))
    exit()
C = [A*i//B-(A*(i//B)) for i in range(100)]
D = [A*i//B-(A*(i//B)) for i in range(N,-1,N-100)]
E = max(max(C),max(D))

### FIXED CODE ###

import math
A,B,N = list(map(int,input().split()))
if B > N:
    print(math.floor(A*N/B)-A*math.floor(N/B))
else:
    print(math.floor(A*(B-1)/B)-A*math.floor((B-1)/B))
a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif a < b:
    print('LESS')
else:
    a == b:
    print('EQUAL')

### FIXED CODE ###

a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif a < b:
    print('LESS')
else:
    print('EQUAL')
s=input()
if s='SUN':
    print(7)
elif s='MON':
    print(6)
elif s='TUE':
    print(5)
elif s='WED':
    print(4)
elif s='THU':
    print(3)
elif s='FRI':
    print(2)
elif s='SAT':
    print(1)

### FIXED CODE ###

s=input()
if s=='SUN':
    print(7)
elif s=='MON':
    print(6)
elif s=='TUE':
    print(5)
elif s=='WED':
    print(4)
elif s=='THU':
    print(3)
elif s=='FRI':
    print(2)
elif s=='SAT':
    print(1)
from sys import exit
r, s = map(int, input().split())
a = [input() for i in range(r)]

def check(x):
    cnt = [0 for i in range(300)]
    for i in x:
        cnt[ord(i)] += 1
    odd = sum(i % 2 for i in cnt)
    if odd != len(x) % 2:
        print('NO')
        exit(0)

midr, mids = None, None

dr = dict()
for i in range(r):
    b = tuple(sorted(a[i]))
    if b not in dr:
        dr[b] = 1
    else:
        dr[b] += 1
odd = 0
for k in dr:
    if dr[k] % 2 == 1:
        odd += 1
        midr = k
if odd != r % 2:
    print('NO')
    exit(0)
if odd == 1:
    check(midr)

ds = dict()
for j in range(s):
    b = tuple(sorted([a[i][j] for i in range(r)]))
    if b not in ds:
        ds[b] = 1
    else:
        ds[b] += 1
odd = 0
for k in ds:
    if ds[k] % 2 == 1:
        odd += 1
        mids = k
if odd != s % 2:
    print('NO')
    exit(0)
if odd == 1:
    check(mids)

if mids:
    for k in dr:
        indeksi = [i for i in range(r) if tuple(sorted(a[i])) == k]
        check([mids[i] for i in indeksi])
if midr:
    for k in ds:
        indeksi = [j for j in range(s) if tuple(
            sorted([a[i][j] for i in range(r)])) == k]
        check([midr[j] for j in indeksi])

print('YES')


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
i, j = b[n // 2 - 1], b[n // 2]
for x in a:
    if x <= i:
        print(j)
    else:
        print(i)
N,M=map(int,input().split())
G=[]
a=[]
S=[]
for i in range(M):
    l,r=map(int,input().split())
    a=[x for x in range(l,r+1)]
    G.append(a)
for i in range(M-1):
    G_diff=set(G[i]).intersection(set(G[i+1]))
print(len(G_diff))

### FIXED CODE ###

N,M=map(int,input().split())
L=[]
R=[]
for i in range(M):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r)
max_l=max(L)
min_r=min(R)
if min_r-max_l>=0:
    print(min_r-max_l+1)
else:
    print(0)
H=2
W=3
K=2

masme = [
[".",".","#"],
["#","#","#"]
]

H, W, K =  [int(i) for i in input().split()]

masme = []
for i in range(H):
    masme.append(list(input()))

#print(masme)

h_p = []
for h in range(pow(2,H)):
    h_p.append(str(bin(h))[2:].zfill(H))

#print(h_p)

w_p = []
for w in range(pow(2,W)):
    w_p.append(str(bin(w))[2:].zfill(W))

#print(w_p)

def count(mas):
    ans = 0
    for i in mas:
        for j in i:
            if( j == "#"):
                ans += 1
    return ans

def delete_row(mas, i):
    ilist = list(i)
    #print(ilist)
    ans = []
    for n in range(len(ilist)):
        #print(ilist[n])
        if ilist[n] == "0":
            ans.append(mas[n])
            #print(ans)
    return ans

def delete_column(mas, i):
    ilist = list(i)
    ans = []
    for row in mas:
        #print(row)
        tmp_row=[]
        for n in range(len(ilist)):
            if(ilist[n] == "0"):
                tmp_row.append(row[n])
        #print(tmp_row)
        ans.append(tmp_row)
    return ans

newmas = delete_column(masme, "010")

#print(newmas)

ans_cnt = 0
for h in h_p:
    for w in w_p:
        tmp = delete_row(masme, h)
        tmp2= delete_column(tmp, w)
        cnt = count(tmp2)
        if(cnt == K):
            ans_cnt += 1

print(ans_cnt)

### FIXED CODE ###

H, W, K =  [int(i) for i in input().split()]

masme = []
for i in range(H):
    masme.append(list(input()))

#print(masme)

h_p = []
for h in range(pow(2,H)):
    h_p.append(str(bin(h))[2:].zfill(H))

#print(h_p)

w_p = []
for w in range(pow(2,W)):
    w_p.append(str(bin(w))[2:].zfill(W))

#print(w_p)

def count(mas):
    ans = 0
    for i in mas:
        for j in i:
            if( j == "#"):
                ans += 1
    return ans

def delete_row(mas, i):
    ilist = list(i)
    #print(ilist)
    ans = []
    for n in range(H):
        #print(ilist[n])
        if ilist[n] == "0":
            ans.append(mas[n])
            #print(ans)
    return ans

def delete_column(mas, i):
    ilist = list(i)
    ans = []
    for row in mas:
        #print(row)
        tmp_row=[]
        for n in range(W):
            if(ilist[n] == "0"):
                tmp_row.append(row[n])
        #print(tmp_row)
        ans.append(tmp_row)
    return ans


ans_cnt = 0
for h in h_p:
    for w in w_p:
        tmp = delete_row(masme, h)
        tmp2= delete_column(tmp, w)
        cnt = count(tmp2)
        if(cnt == K):
            ans_cnt += 1

print(ans_cnt)
a = int(intpu())
b= int(intpu())
c = int(intpu())
d = int(intpu())
e = int(intpu())
k = int(intpu())

if e - a > k:
    print(':(')
else:
    print('Yay!')


### FIXED CODE ###

a = int(input())
b= int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a > k:
    print(':(')
else:
    print('Yay!')
from sys import stdin
input=stdin.readline
input()
a=input().strip()
b=int(input())
for i in range(b):
  n,m=map(int,input().split())
  a.replace(str(n),str(m))
  print(sum(a))

### FIXED CODE ###

from sys import stdin
input=stdin.readline
input()
a=list(map(int,input().split()))
ans=sum(a)
b=[0]*(10**5+1)
for i in a:
  b[i]+=1
c=int(input())
for i in range(c):
  n,m=map(int,input().split())
  if b[n]>0:
    x=b[n]
    if x>0:
      b[m]+=x
      b[n]=0
      ans+=(m-n)*x
  print(ans)
S = str(input())
K = int(input())
s = [ ]
for i in range(K):
    s.append(S[i])
s.append(S[0])
t = 0
for i in range(K):
    if s[i] == s[i+1]:
        s[i+1] = s_i
        t = t + 1
if s[K] == s[0]:
    T = (t*K) - 1
else:
    T = t*K
print(T)

### FIXED CODE ###

A = input()
n = len(A)
S = []
R = [A[n-1]]
for i in range(n):
    S.append(A[i])
    R.append(A[i])
K = int(input())
s = 0
p = S[0]
q = S[n-1]
for i in range(n-1):
    x = S[i]
    y = S[i+1]
    if x == y:
        S[i+1] = 1
        s += 1
t = 0
for j in range(n):
    x = R[j]
    y = R[j+1]
    if x == y:
        R[j+1] = 1
        t += 1
if p != q:
    ans = s*K
else:
    if S[n-1] == 1:
        ans = s*K
    else:
        if R[n] == 1:
            k = K//2
            ans = (K-k)*s + k*t
        else:
            ans = s + (K-1)*t
print(ans)
N, M = map(int, input().split())
*A, = map(int, input().split())
C = {0: 1}
ans = 0
s = 0
for a in A:
    s = (s + a) % M
    ans += C.get(s, 0)
    C[s] = C.get(s, 0) + 1
    print("C is {}, ans is {}".format(C,ans))
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
*A, = map(int, input().split())
C = {0: 1}
ans = 0
s = 0
for a in A:
    s = (s + a) % M
    ans += C.get(s, 0)
    C[s] = C.get(s, 0) + 1
print(ans)
import sys
#input = sys.stdin.readline
from sys import setrecursionlimit
setrecursionlimit(10**9)

def inpl(): return list(map(int, input().split()))
N = int(input())
GA = inpl()
GB = inpl()

typ = [GA[i] <= GB[i] for i in range(3)]

if sum(typ) == 3:
    ans = 0
    for g in range(N//GA[0] + 1):
        D = N - GA[0]*g
        for s in range(D//GA[1] + 1):
            b, D2 = divmod(D - GA[1]*s, GA[2])
            ans = max(ans, D2 + g*GB[0] + s*GB[1] + b*GB[2])

elif sum(typ) == 2:
    ans = 0
    x, y = [i for i in range(3) if typ[i]]
    z = [i for i in range(3) if not typ[i]][0]
    for a in range(N//GA[x] + 1):
        b, D = divmod(N - GA[x]*a, GA[y])
        c, D2 = divmod(D + GB[x]*a + GB[y]*b, GB[z])
        ans = max(ans, D2 + c*GA[z])
        raise

elif sum(typ) == 1:
    ans = 0
    x, y = [i for i in range(3) if not typ[i]]
    z = [i for i in range(3) if typ[i]][0]
    c, D = divmod(N, GA[z])
    D += GB[z]*c

    for a in range(D//GB[x] + 1):
        b, D2 = divmod(D-GB[x]*a, GB[y])
        ans = max(ans, D2 + GA[x]*a + GB[y]*b)

else:
    ans = 0
    for g in range(N//GB[0] + 1):
        D = N - GB[0]*g
        for s in range(D//GB[1] + 1):
            b, D2 = divmod(D - GB[1]*s, GB[2])
            ans = max(ans, D2 + g*GA[0] + s*GA[1] + b*GA[2])

print(ans)

### FIXED CODE ###

import sys
#input = sys.stdin.readline
from sys import setrecursionlimit
setrecursionlimit(10**9)

def inpl(): return list(map(int, input().split()))
N = int(input())
GA = inpl()
GB = inpl()

typ = [GA[i] <= GB[i] for i in range(3)]

if sum(typ) == 3:
    ans = 0
    for g in range(N//GA[0] + 1):
        D = N - GA[0]*g
        for s in range(D//GA[1] + 1):
            b, D2 = divmod(D - GA[1]*s, GA[2])
            ans = max(ans, D2 + g*GB[0] + s*GB[1] + b*GB[2])

elif sum(typ) == 2:
    ans = 0
    x, y = [i for i in range(3) if typ[i]]
    z = [i for i in range(3) if not typ[i]][0]
    for a in range(N//GA[x] + 1):
        b, D = divmod(N - GA[x]*a, GA[y])
        c, D2 = divmod(D + GB[x]*a + GB[y]*b, GB[z])
        ans = max(ans, D2 + c*GA[z])

elif sum(typ) == 1:
    ans = 0
    x, y = [i for i in range(3) if not typ[i]]
    z = [i for i in range(3) if typ[i]][0]
    c, D = divmod(N, GA[z])
    D += GB[z]*c

    for a in range(D//GB[x] + 1):
        b, D2 = divmod(D-GB[x]*a, GB[y])
        ans = max(ans, D2 + GA[x]*a + GA[y]*b)

    for b in range(D//GB[y] + 1):
        a, D2 = divmod(D-GB[y]*b, GB[x])
        ans = max(ans, D2 + GA[x]*a + GA[y]*b)

else:
    ans = 0
    for g in range(N//GB[0] + 1):
        D = N - GB[0]*g
        for s in range(D//GB[1] + 1):
            b, D2 = divmod(D - GB[1]*s, GB[2])
            ans = max(ans, D2 + g*GA[0] + s*GA[1] + b*GA[2])

print(ans)
N,M = int(input())
S = [list(map(int, input().split())) for i in range(M)]
for i in range(1,M+1):
  print(S.count(i))


### FIXED CODE ###

N,M = map(int, input().split())
x = [0]*N
for i in range(M):
  a,b = map(int, input().split())
  x[a-1] += 1
  x[b-1] += 1
for i in range(N):
  print(x[i])