Harryxun/stf_run huggingface dataset:
def main():

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

	d = a // b
	r = a % b
	f = a / b


	if d == 1:
		print(d)
	else:	
		print('{0} {1} {2}'.format(d, r, f))
	


if __name__=="__main__":
	main()

### FIXED CODE ###

def main():

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

	a_to_b = list(range(a, b + 1))    #a to b
	result = [x for x in a_to_b if c % x == 0]
	#約数検索
	count = int(len(result))
	print(count)
	


if __name__=="__main__":
	main()
x = int(input())
'''
if x == 1:
    ans = 1
elif x == 2:
    ans = 2
elif x == 3:
    ans = 2
elif x == 4:
    ans = 3
elif x == 5:
    ans = 3
elif x == 6:
    ans = 3
elif x == 7:
    ans = 4
elif x == 8:
    ans = 4
elif x == 9:
    ans = 4
elif x == 10:
    ans = 4
11から15までは5
122333444455555...の群数列
'''
for i in range(1,x):
    if i*(i-1)/2 < x <= i*(i+1)/2:
        ans = i
        break
print(ans)

### FIXED CODE ###

x = int(input())
'''
if x == 1:
    ans = 1
elif x == 2:
    ans = 2
elif x == 3:
    ans = 2
elif x == 4:
    ans = 3
elif x == 5:
    ans = 3
elif x == 6:
    ans = 3
elif x == 7:
    ans = 4
elif x == 8:
    ans = 4
elif x == 9:
    ans = 4
elif x == 10:
    ans = 4
11から15までは5
122333444455555...の群数列
'''
for i in range(1,x+1):
    if i*(i-1)/2 < x <= i*(i+1)/2:
        ans = i
        break
print(ans)
s = list(int(input()))
for i in range(1000001):
    if s[i] % 2 == 0:
        s.append(s[i]/2)
    else:
        s.append(3 * s[i] + 1)
    if s[i] in s[:i]:
        print(i+1)
        break

### FIXED CODE ###

s = [int(input())]
for i in range(1000001):
    if s[i] % 2 == 0:
        s.append(s[i]/2)
    else:
        s.append(3 * s[i] + 1)
    if s[i] in s[:i]:
        print(i+1)
        break
import math

a, b, c, d = map(int, input().split())
cd = (c * d) // math.gcd(c, d)
a = a - 1
ac = a // c
ad = a // d
acd = a // cd
bc = b // c
bd = b // d
bcd = b // cd

ans = (b - a) - (bc + bd - bcd - (ac + ad - acd))
print(ans)

### FIXED CODE ###

import fractions

a, b, c, d = map(int, input().split())
cd = (c * d) // fractions.gcd(c, d)
a = a - 1
ac = a // c
ad = a // d
acd = a // cd
bc = b // c
bd = b // d
bcd = b // cd

ans = (b - a) - (bc + bd - bcd - (ac + ad - acd))
print(ans)
a,b=map(int,input().split())
print(a*a-b)

### FIXED CODE ###

a=int(input())
b=int(input())
print(a*a-b)
a, b, c = map(int, input().strip())
answer = 0

for i in range(a,b+1):
    if c % i ==0:
        answer += 1

print(answer)

### FIXED CODE ###

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

for i in range(a,b+1):
    if c % i ==0:
        answer += 1

print(answer)
N, M = map(int, input().split())

a = [int(input()) for i in range(M)]


for i in range(M - 1):
    if a[i] + 1 == a[i+1]:
        print(0)
        exit()

dp = [0] * (N + 1)
if 1 in a and 2 in a:
    print(0)
    exit()

if 1 in a:
    dp[1] = 0
    dp[2] = 1
elif 2 in a:
    dp[1] = 1
    dp[2] = 0
else:
    dp[1] = 1
    dp[2] = 2

for i in range(3,N+1):
    if i in a:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007

print(dp[N])

### FIXED CODE ###

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

a = [int(input()) for i in range(M)]


for i in range(M - 1):
    if a[i] + 1 == a[i+1]:
        print(0)
        exit()

dp = [0] * (N + 1)
flag_a = [0] * (N + 1)

for i in range(M):
    flag_a[a[i]] = -1


if N == 1 and M != 1:
    print(1)
    exit()
elif N == 1 and M == 1:
    print(0)
    exit()

if 1 in a and 2 in a:
    print(0)
    exit()

if 1 in a:
    dp[1] = 0
    dp[2] = 1
elif 2 in a:
    dp[1] = 1
    dp[2] = 0
else:
    dp[1] = 1
    dp[2] = 2

for i in range(3,N+1):
    if flag_a[i] == -1:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007

print(dp[N])
N, K = map(int, input().split())
h_list = list(map(int, input().split()))

dp_list = [0]
for n in range(1, N):
  tmp_h = h_list[n]
  if n < K:
    lst = [abs(tmp_h - h_list[i]) + dp_list[i] for i in range(n)]
    else:
      lst = [abs(tmp_h - h_list[n-k]) + dp_list[n-k] for k in range(1, K + 1)]
      dp_list.append(min(lst))
      print(dp_list[-1])

### FIXED CODE ###

N, K = map(int, input().split())
h_list = list(map(int, input().split()))
def chmin(a, b):
    if a > b:
        return b
    else:
        return a
dp_list = [1000000000] * N
dp_list[0] = 0
dp_list[1] = abs(h_list[1] - h_list[0])
for n in range(1, N):
    for k in range(1, K+1):
        dp_list[n] = chmin(dp_list[n], dp_list[n-k] + abs(h_list[n-k] - h_list[n]))
        if n-k == 0:
            break
print(dp_list[-1])
a = input()
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)



### FIXED CODE ###

a = int(input())
j = 0
for i in range(a + 1):
    if i%3!=0 and i%5!=0:
        j+=i
print(j)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return list(reversed(divisors))

s = int(input())
ll = make_divisors(s)
if s%2 == 0:
    print("0 0 0",ll[0],ll[1], "0")
else:
    print("0 1 1 0",ll[0],ll[1])

### FIXED CODE ###

import math
s = int(input())
a = math.ceil(math.sqrt(s))
b = a**2-s
print(0,0,a,1,b,a)
def s(n,p):
  while n>0:yield n%p;n//=p
c=lambda*a:sum(s(*a))
print(min(c(i,6)+c(n-i,9)for i in range(int(input())+1)))

### FIXED CODE ###

def s(n,c):
  if n<6:return c+n
  a=b=1
  while a*6<=n:a*=6
  while b*9<=n:b*=9
  return min(s(n-a,c+1),s(n-b,c+1))
print(s(int(input()),0))
while True:
    try:
        s=input().split(" ")
        num=int(s[0])+int(s[1])
        print(len(str(num)))
    escept:
        break
   

### FIXED CODE ###

while True:
    try:
        s=input().split(" ")
        num=int(s[0])+int(s[1])
        print(len(str(num)))
    except:
        break
S = input()

S_list = list(S)

answer = []
for S_num in range(S_list):
    if S_num == '0':
        answer.append('0')
    elif S_num == '1':
        answer.append('1')
    elif not answer:
        continue
    else:
        del answer[-1]

print(answer)

### FIXED CODE ###

S = input()

S_list = list(S)

answer = []
for S_num in S_list:
    if S_num == '0':
        answer.append('0')
    elif S_num == '1':
        answer.append('1')
    elif not answer:
        continue
    else:
        del answer[-1]

answer_honmono = ''
answer_honmono = ''.join(answer)
print(answer_honmono)
from functools import reduce
from itertools import combinations
from fractions import gcd

def get_gcd(number_list):
    return reduce(gcd, number_list)

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

skipped = list(map(combinations(Numbers, N - 1)))

gcd_list = [get_gcd(item) for item in skipped]
    
print(int(max(gcd_list)))

### FIXED CODE ###

from functools import reduce
from itertools import combinations
from fractions import gcd

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


Left = [0] * (N + 1)
Right = [0] * (N + 1)

for i in range(N):
    Left[i + 1] = gcd(Left[i], A[i])
    Right[N - i - 1] = gcd(Right[N - i], A[N - i - 1])
ans = 0
for i in range(N):
    ans = max(ans, gcd(Left[i], Right[i + 1]))
    
print(ans)
forecast = input()
real = input()

a = 0

for i in range(0,2)
  if forecast[i] == real[i]:
    a += 1
    
print(a)

### FIXED CODE ###

forecast = input()
real = input()

a = 0

for i in range(0,3):
  if forecast[i] == real[i]:
    a += 1
    
print(a)
import sys
input = sys.stdin.buffer.readline

N, D, A = map(int, input().split())
XH = [list(map(int, input().split()))for _ in range(N)]

XH.sort()
print(XH)


for i in range(N):
    bit_add_sec(bit1, bit2, i, i, XH[i][1])


bit1 = [0] * (N + 1)
bit2 = [0] * (N + 1)

def bit_add(b, i, v):
    while i <= N:
        b[i] += v
        i += i & - i
        
def bit_sum(b, i):
    s = 0
    while i:
        s += b[i]
        i -= i & -i
    return s

def bit_add_sec(b1, b2, l, r, x):
    bit_add(b1, l, -x * (l - 1))
    bit_add(b2, l, x)
    bit_add(b1, r + 1, x * r)
    bit_add(b2, r + 1, -x)

def bit_sum_sec(b1, b2, l, r, x):
    res = 0
    res += bit_sum(b1, r) + bit_sum(b2, r) * r
    res -= bit_sum(b1, l - 1) + bit_sum(b2, l - 1) * (l - 1)
    return res


### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

from bisect import bisect_right

N, D, A = map(int, input().split())
XH = [list(map(int, input().split())) for _ in range(N)]

XH.sort()
X = [x for x, h in XH]

check = [0] * (N + 1)


index = 0
pt = XH[index][0] + 2 * D
ht = (-(-XH[index][1] // A)) * A
minus = ht
answer = -(-XH[index][1] // A)
bi = bisect_right(X, pt)
check[bi] += ht

while 1:
  flag = 1
  for i in range(index, N):
    minus -= check[i]
    XH[i][1] -= minus
    check[i] = 0
    if XH[i][1] > 0:
      index = i
      flag = 0
      break
  if flag:
    break
  pt = XH[index][0] + 2 * D
  ht = (-(-XH[index][1] // A)) * A
  minus += ht
  answer += -(-XH[index][1] // A)
  bi = bisect_right(X, pt)
  check[bi] += ht
                 
print(answer)
# -*- coding: utf-8 -*-
import numpy as np

def solve(S):
    A = []
    for i in range(len(S)):
        if(S[i]=="0" or S[i]=="1"):
            A.append(S[i])
        else:
            A.pop()
    print("".join(A))
    
if __name__ == '__main__':
    S = input()
    
    solve(S)

### FIXED CODE ###

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

def solve(S):
    A = []
    for i in range(len(S)):
        if(S[i]=="0" or S[i]=="1"):
            A.append(S[i])
        elif(len(A)>0 and S[i]=="B"):
            A.pop()
    print("".join(A))
    
if __name__ == '__main__':
    S = input()
    
    solve(S)
n = int(input())
a = sorted(list(map(int, input().split())))

lst = [0] * max(a)

l1 = 0
l2 = 0

for i in range(n):
    lst[a[i] - 1] += 1
    temp = lst[a[i] - 1]
    if temp >= 4:
        l1 = a[i]
        l2 = a[i]
    elif l1 != a[i] and temp >= 2:
        l1, l2 = a[i], l1
print(l1 * l2)


### FIXED CODE ###

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

cnt = collections.Counter(a)
l1 = 0
l2 = 0

for i in cnt.keys():
    if cnt[i] >= 4:
        l1 = i
        l2 = i
    elif cnt[i] >= 2:
        l1, l2 = i, l1
print(l1 * l2)
import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))
sys.setrecursionlimit(410000)

x = inpl()
n = x[0]
k = x[1]
m = [0 for i in range(0, 300000)]
dic = [0 for i in range(0, 300000)]

A = inpl()

t = 0
i = 0
roop = 0
while True:
    if i == k:
        print(t + 1)
        break
    if m[t] == 0:
        m[t] = 1
        dic[t] = i
        t = A[t] -1
    else:
        roop = i - dic[t]
        break
    i += 1

for i in range(0, (k - i) % roop):
    t = A[t] - 1

print(t + 1)

### FIXED CODE ###

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
i = 0
visit = []
visit_set = set()
while i not in visit_set:
    visit.append(i)
    visit_set.add(i)
    i = A[i] - 1
find = visit.index(i)
if K < find:
    print(visit[K] + 1)
else:
    root = visit[find:]
    K = (K-find) % len(root)
    print(root[K] + 1)
N=int(input())
p=list(map(int,input().split()))

M=0
for i in range(N):
    if p[i]==i+1:
        p[i],p[i+1]=p[i+1],p[i]
        M+=1
    
print(M)        

### FIXED CODE ###

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

M=0
for i in range(N-1):
    if p[i]==i+1:
        p[i],p[i+1]=p[i+1],p[i]
        M+=1
if p[N-1]==N:
    M+=1
print(M)
from scipy.special import comb


N = int(input())
A = list(map(int, input().split()))
sorted_A = sorted(A)
countNums = [0]*(N+1)

target = sorted_A[0]
for i in range(N):
    if target==sorted_A[i]:
        countNums[target] += 1
    else:
        target = sorted_A[i]
        countNums[target] += 1;


for i in range(N):
    a = A[i]
    countNums[a] -= 1
    ans = 0
    for c in countNums:
        ans += int(comb(c, 2))
    print(ans)
    countNums[a] += 1





### FIXED CODE ###

from copy import deepcopy

def count(A):
    cnt = 0
    for a in A:
        cnt += (a*(a-1))//2
    return cnt


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    max_A = max(A)

    count_A = [0]*(max_A+1)

    for a in A:
        count_A[a]+= 1

    combi_A = 0

    for c in count_A:
        combi_A += (c*(c-1))//2
    for a in A:
        print(combi_A-(count_A[a]*(count_A[a]-1)-(count_A[a]-1)*(count_A[a]-2))//2)
d,t.s = map(int,input().split())
a = d/s
if t>=a:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

d,t,s = map(int,input().split())
a = d/s
if t>=a:
    print("Yes")
else:
    print("No")
#M num of prefecture
#N num of city
N, M = map(int,input().split())
#P pref
#Y year
P=[]
Y=[]
cities=[]
for i in range(M):
    try:
        s = input()
        p,y = s.split()
        city=(p,y)
        cities.append(city) 
        P.append(p)
        Y.append(y)
    except:
        break

sort_city=sorted(cities,key=lambda x:(x[0],x[1]))
prefs = sorted(set(P))

address=[]
res=[]
for i in range(len(sort_city)): 
    address=str(sort_city[i][0]).rjust(6,'0')+str(i+1).rjust(6,'0')
    res.append((sort_city[i],address))

print(res[1][0])
for i in range(len(cities)):
    for j in range(len(res)):
        if cities[i] == res[j][0]:
            print(res[j][1])



### FIXED CODE ###

x,y = list(map(int,input().split()))
print(int(x+y/2))
A, B = map(int, input().split())
from fraction import gcd
 
print(A * B // gcd(A, B))

### FIXED CODE ###

A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))
# -*- coding: utf-8 -*-

import sys
from math import *

lineNumber = 0
coord = [0, 0]
theta = 0.5 * pi
#for line in [ "2", "1000", "800", "9999999999", "1" ]:
for line in sys.stdin.readlines():
    lineNumber += 1

    # line exception
    if lineNumber == 1:
        continue
    
    # get data
    List = map(float, line.strip().split())

    # set data
    forward = List[0]
    d_theta = List[1] / 180.0 * pi

    # solve
    coord[0] += forward * cos(theta)
    coord[1] += forward * sin(theta)
    theta += d_theta

print int(ceil(coord[0]))
print int(ceil(coord[1]))

### FIXED CODE ###

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

import sys
from math import *

lineNumber = 0
coord = [0, 0]
theta = 0.5 * pi
#for line in [ "56,65", "97,54", "64,-4", "55,76", "42,-27", "43,80", "87,-86", "55,-6", "89,34", "95,5", "0,0"]:
for line in sys.stdin.readlines():
    lineNumber += 1

    # get data
    List = map(float, line.strip().split(","))

    # set data
    forward = List[0]
    d_theta = - List[1] / 180.0 * pi

    # solve
    coord[0] += forward * cos(theta)
    coord[1] += forward * sin(theta)
    theta += d_theta

print int(coord[0])
print int(coord[1])
hoge = input().split()
 
aaa = 0  
if hoge[0] == hoge[1]:
  aaa += 1
if hoge[0] == hoge[2]:
  aaa += 1
if hoge[1] == hoge[2]:
  aaa += 1    

if aaa = 1:
  print("Yes")
else:
  print("No")
	

### FIXED CODE ###

hoge = input().split()
 
aaa = 0  
if hoge[0] == hoge[1]:
  aaa += 1
if hoge[0] == hoge[2]:
  aaa += 1
if hoge[1] == hoge[2]:
  aaa += 1    
 
if (aaa == 1) or (aaa == 2):
  print("Yes")
else:
  print("No")
A, B, T = input().split()
print((T/A)*B)

### FIXED CODE ###

A, B, T = map(int, input().split())
print(int(T/A)*B)
s=input()
ss=len(s[1:len(s)-1])
sss=str(ss)
 print(s[0]+sss+s[-1])

### FIXED CODE ###

s=input()
ss=len(s[1:len(s)-1])
sss=str(ss)
print(s[0]+sss+s[-1])
s=input()
K=int(input())
s=list(s)
#a-z 97-122
for i, s_ in enumerate(s):
    if s_!='a':
        if ord(s_)+K >= 123:
            s[i]='a'
            K -= (123-ord(s_))
if K>0:
    asc=ord(s[-1])+K%26
    s[-1]=chr(asc)
print("".join(s))

### FIXED CODE ###

# -*- coding: utf-8 -*-
raw = raw_input()

ans =  raw[:4]+' '+raw[4:]

print ans
# C When I hit my pocket
k,a,b = map(int,input().split())

bis = 1

if k <= 1 or b <= a + 2 or k - (a + 1) < 0:
    print(1 + k)
    exit()
else:
    bis = b
    k = k - ( a + 1)
    if not k == 0:
        bis += int(k / 2) * (b - a) + k % 2

print(bis)

### FIXED CODE ###

# A Anti-Adjacency
n,k = map(int,input().split())
if int((n +1) / 2) >= k:
    print('YES')
else:
    print('NO')
a = [int(input()) for _ in range(6)]
for i in range(4):
    for j in range(i+1, 5):
        if abs(i-j) > k:
            print(":(")
            exit()
print("Yay!")

### FIXED CODE ###

a = [int(input()) for _ in range(6)]
for i in range(4):
    for j in range(i+1, 5):
        if abs(a[i]-a[j]) > a[5]:
            print(":(")
            exit()
print("Yay!")
import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations([q for q in range(1,(M+1))], N)
# print(L)
# print(A)
count=[]
for a in A:
    tmp=[]
    for l in L:
        try:
            if a[l[1]-1] - a[l[0]-1] == l[2]:
                tmp.append(l[3])
            else:
                pass
        except:
            pass
    # print(tmp)
    count.append(sum(tmp))

# print(count)

print(max(count))


### FIXED CODE ###

import itertools
N,M,Q=map(int,input().split())
L=[]
for q in range(Q):
    L.append(list(map(int,input().split())))

A = itertools.combinations_with_replacement([q for q in range(1,(M+1))], N)
count=[]
for a in A:
    tmp=0
    for l in L:
        
        if a[l[1]-1] - a[l[0]-1] == l[2]:
            tmp+=l[3]
    count.append(tmp)

print(max(count))
n = int(input())
s = input()
print(s.count('ABC')

### FIXED CODE ###

n = int(input())
s = input()
print(s.count('ABC'))
cnt = 0
for r in range(N//R+1):
    for g in range(N//G+1):
        if  (N - r*R - g*G) < 0:
            break
        if  (N - r*R - g*G)%B == 0 :
            cnt +=1
            #print(r,g,(N - r*R - g*G)//B)
print(cnt)

### FIXED CODE ###

R,G,B,N = map(int,input().split())
cnt = 0
for r in range(N+1):
    for g in range(N+1):
        if  (N - r*R - g*G) >= 0 and  (N - r*R - g*G)%B == 0 :
            cnt +=1
            #print(r,g,(N - r*R - g*G)//B)
print(cnt)
def main():
  N = int(input())
  A = [int(x) for x in input().split()]
  
  B = [0] * N
  for i in range(N):
    e = A[N-i-1]
    B[e] += 1
  
  for i in range(N):
    print(B[i])
    
if __name__ == '__main__':
  main()

### FIXED CODE ###

def main():
  N = int(input())
  A = [int(x) for x in input().split()]
  
  B = [0] * N    
  for i in range(N-1):
      B[A[N-i-2]-1] += 1
  
  for i in range(N):
    print(B[i])
    
if __name__ == '__main__':
  main()
import sys
sys.setrecursionlimit(1000000)

N,K = map(int, input().split())
MOD = 10**9+7
A = N - K + 1

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

print(N-K+1)
for i in range(1,K):
    print(cmb(K-1, i) * cmb(A, i+1) % MOD)


### FIXED CODE ###

#import sys
#sys.setrecursionlimit(100000)

N,K = map(int, input().split())
MOD = 10**9+7
A = N - K + 1

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for i in range(K):
    if N - K - i >= 0:
        print(cmb(K-1, i) * cmb(A, i+1) % MOD)
    else:
        print(0)
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

n,x = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
y = [ x[i]-x[i-1] for i in range(1,n)]
d = gcd(y[1], y[0])
for i in range(2,n-1):
    d = gcd(d, y[i])
print(d)

### FIXED CODE ###

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

n,X = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
if n==1:
    print(abs(x[0]-X))
    exit()
y = [ x[i]-x[i-1] for i in range(1,n)]
d = abs(X-x[0])
for i in range(n-1):
    d = gcd(d, y[i])
print(d)
N = int(input())
T = int(input())
A = int(input())
H = list(map(int, input().split()))

ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.apped(ans)

ans_min = min(ans_l)

print(ans_l.count(ans_min))

### FIXED CODE ###

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


ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)


ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
 
def main():
    N, L, T = map(int, readline().split())
    position = []
    
    cnt = 0
    for i in range(N):
      x, w = map(int, input().split())
      if w == 1:
        cnt += (x - T)//L
        position.append((x-T)%L)
      else:
        if x-T < 0:
          cnt += (x - T)//L
        position.append((x - T)%L)
	position.sort()
    cnt %= N
    
    ans = position[cnt:] + position[:cnt]
    for i in range(N):
      print(ans[i])
        
        

### FIXED CODE ###

def main():
    N, L, T = map(int, input().split())
    collision = 0
    ants = []
    for i in range(N):
        x, w = map(int, input().split())
        if w == 1:
            collision += (x + T) // L
            a = (x + T) % L
        else:
            collision += (x - T) // L
            a = (x - T) % L
        ants.append(a)
 
    collision %= N
    ants.sort()
    ants = ants[collision:] + ants[:collision]
    for ant in ants:
        print(ant)
 
 
if __name__ == '__main__':
    main()
import heapq
n,m=map(int,input().split())
edge = [[] for i in range(n*3)]
#edge[i] : iから出る道の[行先]の配列
for i in range(m):
    x,y = map(int,input().split())
    x-=1;y-=1
    x*=3;y*=3
    edge[x  ].append(y+1)
    edge[x+1].append(y+2)
    edge[x+2].append(y  )
    
def dfs(s,g,res,visited):
  if s==g or s==g+1 or s==g+2:
    if res%3==0:
      return res//3
  
  if len(visited)>3*n:
    return float("inf")
  
  if edge[s]==[]:
    return float("inf")
  
  l=float("inf")
  for i in edge[s]:
    if i not in visited:
      l=min(l,dfs(i,g,res+1,visited+[i]))
  return l

s,t=map(int,input().split())
s-=1;t-=1
ans=dfs(s*3,t*3,0,[])
if ans==float("inf"):
  print(-1)
else:
  print(ans)


### FIXED CODE ###

from collections import deque
n,m=map(int,input().split())
edge = [[] for i in range(n+1)]
#edge[i] : iから出る道の[行先]の配列
for _ in range(m):
    u, v = map(int, input().split())
    edge[u].append(v)
s,t = map(int, input().split())
queue = deque()
queue.append((s, 0))
visited = [[False] * 3 for _ in range(n+1)]
while queue:
    u, d = queue.popleft()
    if visited[u][d % 3]:
        continue
    visited[u][d % 3] = True
    if d % 3 == 0 and u == t:
        print(d // 3);exit()
    for v in edge[u]:
        queue.append((v, d+1))
print(-1)
import numpy as np
from scipy.sparse.csgraph import shortest_path
n = int(input())
Sides = [[0 for i in range(n)] for j in range(n)]
for i in range(n-1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    Sides[u][v] = w
    Sides[v][u] = w

Path_from_0 = shortest_path(np.array(Sides), indices=0)
for i in range(n):
    print(int(Path_from_0[i]) % 2)


### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import shortest_path
import heapq
n = int(input())
edge = [[] for i in range(n)]
for i in range(n-1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    edge[u].append([w, v])
    edge[v].append([w, u])

def dijkstra_heap(s):
    #始点sから各頂点への最短距離
    d = [float("inf")] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d

Path_from_0 = dijkstra_heap(0)
for i in range(n):
    print(Path_from_0[i] % 2)