Harryxun/stf_run huggingface dataset:
# @author 

import sys

class EVirusTree2:

    def solve(self):
        from collections import defaultdict
        import sys
        sys.setrecursionlimit(10 ** 5 + 5)

        MOD = 10 ** 9 + 7
        n, k  = [int(_) for _ in input().split()]
        adj = {}
        for i in range(n - 1):
            a, b = [int(_) for _ in input().split()]
            a -= 1
            b -= 1
            if a in adj: adj[a].append(b)
            else: adj[a] = [b]
            if b in adj: adj[b].append(a)
            else: adj[b] = [a]
        done = [0] * n
        def dfs(s, rem):
            done[s] = 1
            if rem < 0:
                return 0
            res = 1
            for x in adj[s]:
                if done[x]:
                    continue
                if rem <= 0:
                    return 0
                res = (res * rem) % MOD
                res = (res * dfs(x, k - 2)) % MOD
                rem -= 1
                if res == 0:
                    return 0
            return res

        print((dfs(0, k - 1) * k) % MOD)




solver = EVirusTree2()
input = sys.stdin.readline

solver.solve()


### FIXED CODE ###

# @author 

import sys

class EVirusTree2:

    def solve(self):
        from collections import defaultdict
        import sys
        sys.setrecursionlimit(10 ** 5 + 5)

        MOD = 10 ** 9 + 7
        n, k  = [int(_) for _ in input().split()]
        adj = defaultdict(list)
        for i in range(n - 1):
            a, b = [int(_) for _ in input().split()]
            a -= 1
            b -= 1
            adj[a].append(b)
            adj[b].append(a)
        done = [0] * n
        def dfs(s, rem):
            done[s] = 1
            if rem < 0:
                return 0
            res = 1
            for x in adj[s]:
                if done[x]:
                    continue
                if rem <= 0:
                    return 0
                res = (res * rem) % MOD
                res = (res * dfs(x, k - 2)) % MOD
                rem -= 1
                if res == 0:
                    return 0
            return res

        print((dfs(0, k - 1) * k) % MOD)




solver = EVirusTree2()
input = sys.stdin.readline

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

from collections import Counter

c = Counter(L)
d = {}
sum = 0

for i in c:
    k = c[i]
    sum += k * (k-1) //2
for i in range(N):
    print(int(sum - c[L[i]] + 1))

### FIXED CODE ###

N,M = map(int, input().split())
print(int(N*(N-1)/2)+int(M*(M-1)/2))
N, K = map(int, input().split())
R = N - K
mod = 10**9 + 7

for k in range(1, K+1):
    ans = len(list(combinations(range(R+1), k))) * len(list(combinations(range(K-1), k-1)))
    # ans = Klist[R] / Klist[k-1] / Klist[R-k] * Klist[K-2] / Klist[k-2] / Klist[K-k-2]
    ans %= mod
    print(int(ans))
    

### FIXED CODE ###

N, K = map(int, input().split())
R = N - K
mod = pow(10, 9) + 7

fact = [0] * 2001
inv = [0] * 2001
inv_cal = [0] * 2001

fact[:2] = [1, 1]
inv[1] = 1
inv_cal[:2] = [1, 1]

for i in range(2, 2001):
    fact[i] = fact[i-1] * i % mod
    inv[i] = mod - (mod // i) * inv[mod % i] % mod
    inv_cal[i] = inv_cal[i-1] * inv[i] % mod

def comb(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fact[n] * (inv_cal[k] * inv_cal[n-k] % mod) % mod

for k in range(1, K+1):
    if R+1 >= k:
        print(comb(R+1, k) * comb(K-1, k-1) % mod)
    else:
        print(0)
a=int(input())
b=int(input())
if a>b:
	print("GREATER")
else if a==b:
	print("LESS")
else:
	print("EQUAL")

### FIXED CODE ###

a=int(input())
b=int(input())
if a>b:
	print("GREATER")
elif a<b:
	print("LESS")
else:
	print("EQUAL")
# coding: utf-8

def triangles(L, s, c, n):
    if c == len(L):
        return(n)
    if L[c] < s:
        n += 1
        return(triangles(L, s, c + 1, n))
    else:
        return(n)

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += triangles(L, L[i] + L[j], j + 1, 0)
print(ans)

### FIXED CODE ###

# coding: utf-8
import bisect

N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    for j in range(i + 1, N - 1):
        ans += max(bisect.bisect_right(L, L[i] + L[j] - 1) - j - 1, 0)
print(ans)
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=0
high=0
for i in range(n+1):
  if high>x:
    break
  else:
    count+=1
    high+=L[i]
print(count)
    

### FIXED CODE ###

n,x=map(int,input().split())
L=list(map(int,input().split()))
count=1
high=0
for i in range(n):
    high+=L[i]
    if high<=x:
        count+=1


print(count)
n,m=map(int,input().split())
a=[0]*n
b=[0]*n
for i in range(m):
  a[i],b[i]=map(int,input().split())
for j in range(n):
  print(a.count(j+1)+b.count(j+1))

### FIXED CODE ###

n,m=map(int,input().split())
a=[0]*m
b=[0]*m
for i in range(m):
  a[i],b[i]=map(int,input().split())
for j in range(n):
  print(a.count(j+1)+b.count(j+1))
x,y=map(int,input().split()
print(int(X+y/2))

### FIXED CODE ###

x,y=map(int,input().split())
print(int(x+y/2))
a, b, c = [int(i) for i input().split()]

total = 0
for d in range(a, b+1)
      if c % d == 0:
         total += 1
      
print(total)

### FIXED CODE ###

a, b, c = [int(i) for i in input().split()]

total = 0
for d in range(a, b+1):
      if c % d == 0:
         total += 1
      
print(total)
input_line = input()
inputs = input_line.split(' ')
inputs = [int(input) for input in inputs]

A = inputs[0]
B = inputs[1]

dual_B = 2 * B

res = 0
if A > dual_b:
    res = A - dual_B
else: 
    res = 0

print(0)

### FIXED CODE ###

input_line = input()
inputs = input_line.split(' ')
inputs = [int(input) for input in inputs]

A = inputs[0]
B = inputs[1]

dual_B = 2 * B

res = 0
if A > dual_B:
    res = A - dual_B
else:
    res = 0

print(res)
x = input(())

print(x**3)


### FIXED CODE ###


x = int(input())

print(x**3)
A, B, M = input().split()
A=int(A)
B=int(B)
M=int(M)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(M)]

dis = []
for i in range(M):
    m = x[i][0]
    n = x[i][0]
    dis.append(a[m] + b[n] - x[i][2])
    
a.sort()
b.sort()

dis.append(a[0]+b[0])

print(min(dis))

### FIXED CODE ###

A, B, M = input().split()
A=int(A)
B=int(B)
M=int(M)
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(M)]
 
dis = []
for i in range(M):
    m = x[i][0]-1
    n = x[i][1]-1
    dis.append(a[m] + b[n] - x[i][2])
    
a.sort()
b.sort()
 
dis.append(a[0]+b[0])
 
print(min(dis))
A, B, C, D = map(int, input())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')

### FIXED CODE ###

A, B, C, D = map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')
n,k = map(int,input().split())

x = list(map(int,input().split()))
#x = [ abs(int(i))  for i in input().split()]
x.append(0)
x.sort()

min = 10**8

zeroIdx = x.index(0)

# plus
if zeroIdx + k < len(x) :
    min = x[zeroIdx + k] 

# minus 
if zeroIdx - k >= 0 :
    tmp = abs(x[zeroIdx - k])
    if tmp < min :
        min = tmp

# plus/minus
plsIdx = k+1
misIdx = k-1
while True:
    p = 0
    m = 0
    if plsIdx + 1 <  len(x):
        p = abs(x[plsIdx])

    if misIdx - 1 >= 0:
        m = abs(x[misIdx])
    
    if p == 0 :
        misIdx -= 1
    elif m == 0 :
        plsIdx += 1
    elif p < m :
        plsIdx += 1
    else: 
        misIdx -= 1

    if plsIdx - misIdx >= k :
        if abs(x[plsIdx]) > abs(x[misIdx]) :
            tmp = abs(x[plsIdx]) + (abs(x[misIdx])<<1)
        else:
            tmp = (abs(x[plsIdx])<<1) + abs(x[misIdx])
        break

if tmp < min :
    min = tmp
print(min)

### FIXED CODE ###

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

x.append(0)
x.sort()

#print(x)

min = 10**10

zeroIdx = x.index(0)

for i in range(zeroIdx-k,zeroIdx+1):
    if i < 0 : 
        continue
    elif len(x) <= i + k :
        break

    plsIdx = i + k 
    misIdx = i

    #print(misIdx,plsIdx,x[misIdx],x[plsIdx])

    if abs(x[plsIdx]) > abs(x[misIdx]) :
        tmp = abs(x[plsIdx]) + (abs(x[misIdx])<<1)
    else:
        tmp = (abs(x[plsIdx])<<1) + abs(x[misIdx])

    if tmp < min :
        min = tmp

print(min)
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

def main():
    N = II()
    edges = defaultdict(list)
    for _ in range(N):
        x, y = LI()
        edges[x].append(-y)
        edges[-y].append(x)
    visited = [0] * (N * 2 + 10)
    def solve(v):
        visited[v] = 1
        ret = [v]
        for u in edges[v]:
            if not visited[u]:
                ret += solve(u)
        return ret
    ans = -N
    for node in edges:
        if not visited[node]:
            li = solve(node)
            m, p = 0, 0
            for z in li:
                if z < 0:
                    m += 1
                else:
                    p += 1
            ans += m * p
    return ans

print(main())

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

def main():
    N = II()
    xy = []
    for _ in range(N):
        xy.append(LI())
    xy2g = defaultdict(int)
    g2xy = defaultdict(set)
    for x, y in xy:
        y = -y
        gx = xy2g[x]
        gy = xy2g[y]
        if gx != 0 and gy != 0:  # merge
            if gx == gy:
                continue
            if len(g2xy[gx]) < len(g2xy[gy]):
                gx, gy = gy, gx
            for xy in g2xy[gy]:
                xy2g[xy] = gx
            g2xy[gx] |= g2xy[gy]
            g2xy[gy].clear()
        else:
            g = gx or gy or x
            xy2g[x] = xy2g[y] = g
            g2xy[g] |= {x, y}
    ans = -N
    for xys in g2xy.values():
        m, p = 0, 0
        for xy in xys:
            if xy < 0:
                m += 1
            else:
                p += 1
        ans += m * p
    return ans

print(main())
a = list(map(int, input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print(Possible)
else:
  print(Impossible)


### FIXED CODE ###

a = list(map(int, input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print('Possible')
else:
  print('Impossible')
s = str(input())

flag = True

res = -1

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1,i+3)
        flag = False
        break
    elif s[i] == s[i+2]:
        print(i+1,i+3)
        flag = False
        break

if flag:
    if s[-2] == s[-1]:
        print(len(s)-2,len(s))
    elif s[-3] == s[-1]:
        print(len(s)-2,len(s))
    else:
        print(res,res)


### FIXED CODE ###

s = str(input())

flag = True

res = -1

import sys

if len(s) == 2:
    if s[0] == s[1]:
        print(1,2)
    else:
        print(-1,-1)
    sys.exit()

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1,i+3)
        flag = False
        break
    elif s[i] == s[i+2]:
        print(i+1,i+3)
        flag = False
        break

if flag:
    if s[-2] == s[-1]:
        print(len(s)-2,len(s))
    elif s[-3] == s[-1]:
        print(len(s)-2,len(s))
    else:
        print(res,res)
# -*- coding: utf-8 -*-
def main():
    # input = "5 7 7"
    input = list(map(int, input().split()))
    print(input)

    counter5 = 0
    counter7 = 0

    for num in input:
        if num == 5:
            counter5+=1
        
        if num == 7:
            counter7+=1

    if counter5 == 2 and counter7 == 1:
        print("Yes")
    
    else:
        print("No")



if __name__ == "__main__":
    main()

### FIXED CODE ###

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

counter5 = 0
counter7 = 0

for num in l:
    if num == 5:
        counter5+=1
    
    if num == 7:
        counter7+=1

if counter5 == 2 and counter7 == 1:
    print("YES")

else:
    print("NO")
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*(int(wei/2)+1)+int(wei/2+1)-1))
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)


### FIXED CODE ###

line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])

if height !=1 and wei !=1: 
  if height %2 ==0:
    if wei %2 ==0:
      print(int(wei/2)*height)
    else:
      print(int(wei/2)*height+int(height/2))
  else:
    if wei %2 ==0:
      print(int(height/2)* wei + int(wei/2))
    else:
      print(wei* int(height/2) + int(wei/2)+1)
else:
  print(1)
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,l = inpl()
a = inpl()
aa = []
for i in range(1,n):
    aa.append([i,a[i-1] + a[i]])
# print(aa)
if n == 2: 
    if a[0] + a[1] < l:
        print('Impossible')
    else:
        print('Possible')
        print(1)
elif n == 3:
    if aa[0][1] < l and aa[1][1] < l:
            print('Impossible')
    else:
        aa.sort(key=lambda x:x[1])
        print('Possible')
        for i in range(n-1):
            print(aa[i][0])
else:
    for i in range(1,n-1):
        if aa[i-1][1] < l and aa[i][1] < l and aa[i+1][1] < l:
            print('Impossible')
            break
    else:
        aa.sort(key=lambda x:x[1])
        print('Possible')
        for i in range(n-1):
            print(aa[i][0])


### FIXED CODE ###

from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,l = inpl()
a = inpl()
for i in range(1,n):
    if a[i] + a[i-1] >= l:
        print('Possible')
        for j in range(1,i):
            print(j)
        for k in range(i+1,n)[::-1]:
            print(k)
        print(i)
        break
else:
    print('Impossible')
# 各頂点ごとに所属する木の大きさを計算する
N,Q = map(int,input().split())

E = [[] for _ in range(N+1)]
visited = [False for _ in range(N+1)]
Node_len = [1 for _ in range(N+1)]

for i in range(N-1):
    a,b = map(int,input().split())
    E[a].append(b)
    E[b].append(a)

AS = [0 for i in range(N+1)]
def dfs(node,parent=-1):
    for child in E[node]:
        if child == parent:
            continue
        AS[child] += AS[node]
        dfs(child,node)

for q in range(Q):
    p,x = map(int,input().split())
    AS[p] += x

dfs(1)
print(*AS[1:])




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
# 解法 累積和とdfsを使うと探索が減ってなんかうまくいく．
N,Q = map(int,input().split())
E=[[] for _ in range(N)]
for _ in range(N-1):
    a,b = map(int,input().split())
    E[a-1].append(b)
    E[b-1].append(a)
dic = {}
for _ in range(Q):
    p,x = map(int,input().split())
    if not p-1 in dic:
        dic[p-1] = x
        continue
    dic[p-1] += x

res = [0 for _ in range(N)]
def dfs(p,s,ans):
    global res
    # 終わり条件　最後まで行ったら，つまりE[k] = []になったら.
    # 再帰 累積和を計算して，自分がつながっているノードに接続している
    if s-1 in dic:
        ans += dic[s-1]

    res[s-1] = str(ans)
    if E[s-1] == [p]:
        return
    for e in E[s-1]:
        if e == p:
            continue
        dfs(s,e,ans)
dfs(1,1,0)
print(' '.join(res))
import math


def gcd(a, b, c):
  d = math.gcd(a, b)
  return math.gcd(c, d)

K = int(input())
sum = 0

for i in range(1, a+1):
  for j in range(1, b+1):
    for k in range(1, c+1):
      sum += gcd(i, j, k)
      
print(sum)

### FIXED CODE ###

import math
 
 
def gcd(a, b, c):
  d = math.gcd(a, b)
  return math.gcd(c, d)
 
K = int(input())
sum = 0
for i in range(1, K+1):
  sum += gcd(i, i, i)
  
for i in range(1, K+1):
  for j in range(i, K+1):
    for k in range(j, K+1):
      if i == j and j == k:
        sum += 0
      elif i == j or j == k or i == k:
        sum += gcd(i , j , k )*3
      elif i != j and j != k :
        sum += gcd(i, j, k)*6

print(sum)
import math


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


mi_stamina = math.inf
for i in range(-1000, 1000):
    def _distance(x):
        return (x-i)**2
    double_list = list(map(_distance, x_list))
    stamina = sum(double_list)
    if mi_stamina > stamina:
        mi_stamina = stamina

print(mi_stamina)

### FIXED CODE ###

import math


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


mi_stamina = 1000000000
for i in range(-1000, 1000):
    def _distance(x):
        return (x-i)**2
    double_list = list(map(_distance, x_list))
    stamina = sum(double_list)
    if mi_stamina > stamina:
        mi_stamina = stamina

print(mi_stamina)
def main():
    N = int(input())
    S = input()

    rcs = [0] * N
    gcs = [0] * N
    bcs = [0] * N

    for i in range(N):
        if S[i] == 'R':
            rcs[i] = 1
        elif S[i] == 'G':
            gcs[i] = 1
        elif S[i] == 'B':
            bcs[i] = 1

    for i in range(1, N):
        rcs[i] += rcs[i - 1]
        gcs[i] += gcs[i - 1]
        bcs[i] += bcs[i - 1]

    result = 0
    for i in range(N):
        if S[i] == 'R':
            for j in range(i + 1, N):
                if S[j] == 'R':
                    continue
                elif S[j] == 'G':
                    result += bcs[N - 1] - bcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'B':
                        result -= 1
                elif S[j] == 'B':
                    result += gcs[N - 1] - gcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'G':
                        result -= 1
        elif S[i] == 'G':
            for j in range(i + 1, N):
                if S[j] == 'G':
                    continue
                elif S[j] == 'R':
                    result += bcs[N - 1] - bcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'B':
                        result -= 1
                elif S[j] == 'B':
                    result += rcs[N - 1] - rcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'R':
                        result -= 1
        elif S[i] == 'B':
            for j in range(i + 1, N):
                if S[j] == 'B':
                    continue
                elif S[j] == 'R':
                    result += gcs[N - 1] - gcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'G':
                        result -= 1
                elif S[j] == 'G':
                    result += rcs[N - 1] - rcs[j]
                    t = 2 * j - i
                    if t < N and S[t] == 'R':
                        result -= 1
    print(result)


main()

### FIXED CODE ###

n = input()
print("Yes" if "7" in n else "No")
AL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

A = ''

for i in range(len(S)):
  B = AL.index(S[i]) + N
  A += AL[B]

print(A)

### FIXED CODE ###

AL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
N = int(input())
 
S = input()
A = []
 
for i in range(len(S)):
  B = AL.index(S[i])+N
  if B >= 26:
    B = B -26
  A.append(AL[B])
  
for j in range(len(S)):
  print(A[j], end='')
a = ['2','3','4','5','6','7','8','9','10','11','12','13']
al,bo = map(str,raw_input().split())
if a.index(al) > a.index(bo):
    print 'Alice'
elif a.index(al) < a.index(bo):
    print 'Bob'
else:
    print 'Draw'


### FIXED CODE ###

a = ['2','3','4','5','6','7','8','9','10','11','12','13','1']
al,bo = map(str,raw_input().split())
if a.index(al) > a.index(bo):
    print 'Alice'
elif a.index(al) < a.index(bo):
    print 'Bob'
else:
    print 'Draw'
s = input()
t = input()

s_len = len(s)
t_len = len(t)

result = ''
for i in range(s_len - t_len, -1, -1):
    match = False
    s_part = s[i:i + t_len]
    for j in range(t_len + 1):
        if j == t_len:
            result = (s[0:i] + t + s[i + 5:]).replace('?', 'a')
            match = True
            break
        if s_part[j] == '?':
            continue
        if s_part[j] != t[j]:
            match = False
            break
    if match:
        break

print(result if match else 'UNRESTORABLE')

### FIXED CODE ###

s = input()
t = input()

s_len = len(s)
t_len = len(t)

result = ''
match = False
for i in range(s_len - t_len, -1, -1):
    match = False
    s_part = s[i:i + t_len]
    for j in range(t_len + 1):
        if j == t_len:
            result = (s[0:i] + t + s[i + t_len:]).replace('?', 'a')
            match = True
            break
        if s_part[j] == '?':
            continue
        if s_part[j] != t[j]:
            match = False
            break
    if match:
        break

print(result if match else 'UNRESTORABLE')
N, Y = int(input().split())
if 10000*a + 5000*b +1000*c == Y for a in range(N + 1) for b in range(N + 1) for c in range(N + 1):
  print('{}{}{}', a,b,c)
else:
  print('{}{}{}',-1,-1,-1)

### FIXED CODE ###

N, Y = map(int, input().split())
 
ans = [-1,-1,-1]
for x in range(0,N+1):
    for y in range(0,N-x+1):
        z = N - x - y
        if x*10000 + y*5000 + z*1000 == Y:
            ans[0] = x
            ans[1] = y
            ans[2] = z
print(ans[0],ans[1],ans[2])
a,b,c = map(int, raw_input().split())

aa = [,,,]
aa[0] = a
aa[1] = b
aa[2] = c

sorted(aa)

print aa[0],aa[1],aa[2]

### FIXED CODE ###

a,b,c = sorted(map(int, raw_input().split()))
print a,b,c
k=int(input())
a,b=map(int,input().split())
 
for i in 1000:
 if a<=k*i<=b:
  print("OK")
 else:
  pass
print("NG")

### FIXED CODE ###

k=int(input())
a,b=map(int,input().split())
 
for i in range(10000):
 if a<=k*i<=b:
  print("OK")
  exit()
 else:
  pass
print("NG")
al = [chr(ord('a') + i) for i in range(26)]
n = int(input())
s = ""
while n:
    s += al[a % 26 - 1]
    n = (n - 1) // 26
print(s[::-1])

### FIXED CODE ###

al = ["Q"] + [chr(ord('a') + i) for i in range(26)]
n = int(input())
s = ""
while n:
    if n % 26:
        a = n % 26
        n //= 26
    else:
        a = 26
        n //= 26
        n -= 1
    s += al[a]
print(s[::-1])
a,b = map(int, input().split())
s = input()

try:
    if '-' not in s: raise 
    sa, sb = map(int, s.split('-'))
#     print(sa, sb)
    if len(sa)==a and len(sb)==b:
        print('Yes')
except ValueError:
    print('No')

### FIXED CODE ###

import re

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

regex = '[0-9]{%d}-[0-9]{%d}' %(a,b)
print('Yes' if re.match(regex, s) else 'No')
L, R, d = map(int, input().split())
count = 0

for i in range(L,R):
　if i%d == 0:
     count++

print(count)

### FIXED CODE ###

L, R, d = map(int, input().split())
count = 0

for i in range(L,R+1):
    if i%d == 0:
        count+=1

print(count)