Harryxun/stf_run huggingface dataset:
n,k,rest= map(int, input().split())
s=input()
s+="x"*rest
l=[]
i=-1
ban=0
suc=0
new=[]
if rest==0:
    if s.count("o")==k:
        for i in range(len(s)):
            if s[i]=="o":
                print(i+1)
else:
    while i<len(s)+rest-1:
        i+=1
        ban-=1
        c=s[i]
        if c=="o":
            suc=0
            if ban>=0:
                continue
            new.append(i+1)
            ban=rest
        else:
            suc+=1
            if suc>=rest:
                if ban==0:
                    l+=new
                new=[]

    if len(l)>k:
        print()
    else:
        for i in l:
            print(i)

### FIXED CODE ###

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

last=-3000000
l1=[]
l2=set()
for i,c in enumerate(s):
    if last+rest<i and c=="o":
        last=i
        l1.append(i)
last=6000000
for i,c in enumerate(reversed(s)):
    if n-1-i<last-rest and c=="o":
        last=n-1-i
        l2.add(n-1-i)

if len(l1)!=k:
    print()
else:
    for i in l1:
        if i in l2:
            print(i+1)
def resolve():
    N = int(input())

    alp = [0] * 6
    for i in range(6):
        x = 26 ** (5-i)
        alp[i] = N // x
        N = N % x
    ans = ''
    for a in alp:
        if a > 0:
            ans += chr(64+a)
    print(ans.lower())

if __name__ == "__main__":
    resolve()

### FIXED CODE ###

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

    ans = ''
    while N > 0:
        N -= 1
        ans += chr(ord("a") + N % 26)
        N = N // 26
    print(ans[::-1])

if __name__ == "__main__":
    resolve()
x,n = map(int,input().split())
if n ==0:
    print(x)
else:
    p = list(map(int,input().split()))
    l = {}
    for i in range(1,max(p)+1):
        if i not in p:
            l[i] = abs(x-i)

    min_value = min(l.values())
    val_list = list(l.values())
    key_list = list(l.keys())
    print(key_list[val_list.index(min_value)])


### FIXED CODE ###

x,n = map(int,input().split())
if n==0:
    print(x)
else:
    p = list(map(int,input().split()))
    for i in range(100):
        if x-i not in p:
            print(x-i)
            break
        elif x+i not in p:
            print(x+i)
            break
from collections import deque
import copy
f = open("C:/Users/naoki/Desktop/Atcoder/input.txt") 

n = int(f.readline())
p = list(map(int, f.readline().split()))
for i in range(len(p)):
    p[i] -= 1

to_outsides = [[0 for _ in range(n)] for _ in range(n)]
not_exist = [["■" for _ in range(n)] for _ in range(n)]


for i in range(n):
    for j in range(n):
        to_outside = [i,n-1-i,j,n-1-j]
        to_outsides[i][j] = min(to_outside)

directions = [[-1,0],[1,0],[0,-1],[0,1]]

all_loss = 0
answer = 0
for i, person in enumerate(p):
    exited = [person//n, person%n]
    answer += to_outsides[exited[0]][exited[1]]
    not_exist[exited[0]][exited[1]] = "□"
    seen = []
    seen.append([exited[0],exited[1]])
    todo = deque([exited])
    renews = []
    while len(todo)>0:
        now = todo.pop()
        renews.append(now)
        for direction in directions:
            try:
                checking = [now[0]+direction[0],now[1]+direction[1]]
                to_outsides[checking[0]][checking[1]]
            except:
                continue
            if [checking[0],checking[1]] not in seen:
                if ((not_exist[checking[0]][checking[1]] == "□" and  to_outsides[checking[0]][checking[1]]==to_outsides[now[0]][now[1]])or\
                 to_outsides[checking[0]][checking[1]]>to_outsides[now[0]][now[1]]):
                    todo.append([checking[0],checking[1]])
                    seen.append([checking[0],checking[1]])
                else:
                    seen.append([checking[0],checking[1]])
                    
    for renew in renews:
        if to_outsides[renew[0]][renew[1]] != 0:
            to_outsides[renew[0]][renew[1]]-=1
print(answer)

### FIXED CODE ###

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

dp = [[min(i, N - i - 1, j, N - j - 1) for j in range(N)] for i in range(N)]

presence = [[1 for j in range(N)] for i in range(N)]

ans = 0
for i in range(len(P)):
    P[i] -= 1
    x, y = divmod(P[i], N)
    ans += dp[x][y]
    presence[x][y] = 0

    Q = [(x, y)]
    #%%
    while Q:
        x, y = Q.pop()
        new_value = dp[x][y] + presence[x][y]
        if 1 <= x and dp[x - 1][y] > new_value:
            dp[x - 1][y] = new_value
            Q.append((x - 1, y))
        if x < N - 1 and dp[x + 1][y] > new_value:
            dp[x + 1][y] = new_value
            Q.append((x + 1, y))
        if 1 <= y and dp[x][y - 1] > new_value:
            dp[x][y - 1] = new_value
            Q.append((x, y - 1))
        if y < N - 1 and dp[x][y + 1] > new_value:
            dp[x][y + 1] = new_value
            Q.append((x, y + 1))

print(ans)
import itertools
 
N = int(input().split())
K = int(input().split())
p = list(map(int, input().strip().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)
 
print(min(lists))


### FIXED CODE ###

S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = []
for l in range(K):
  lists.append(min(p))
  p.remove(min(p))
  
print(sum(lists))
N = int(input())
A = list(map(int, input().split()))

nums = A[:]
import math

gcd_queue = [
    (nums[0], True),
    (nums[1], True),
    (math.gcd(nums[0], nums[1]), False),
]
for n in nums[2:]:
    tmp_queue = []
    for q in gcd_queue:
        if q[1] == True:
            tmp_queue.append((math.gcd(q[0], n), True))
        else:
            tmp_queue.append((math.gcd(q[0], n), False))
            tmp_queue.append((q[0], True))
    gcd_queue = tmp_queue[:]
#print(gcd_queue)

ans = 0
for q in gcd_queue:
    ans = max(ans, q[0])
print(ans)

### FIXED CODE ###

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

nums = A[:]
import fractions

gcd_queue = [
    (nums[0], True),
    (nums[1], True),
    (fractions.gcd(nums[0], nums[1]), False),
]
for n in nums[2:]:
    tmp_queue = []
    for q in gcd_queue:
        if q[1] == True:
            tmp_queue.append((fractions.gcd(q[0], n), True))
        else:
            tmp_queue.append((fractions.gcd(q[0], n), False))
            tmp_queue.append((q[0], True))
    gcd_queue = set(tmp_queue[:])

ans = 0
for q in gcd_queue:
    ans = max(ans, q[0])
print(ans)
N = int(input())
s =input().split()

cnt = 0
flag = -1
a = 0
for i in range(0,len(s)):

    if i+1 == int(s[i]):
        break
    else:
       s.pop(i)
       cnt = cnt + 1
       flag = 1
       a = a + 1

if flag == 1:
    print(cnt)
else:
    print(flag)



### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
k = 0
for a in A:
    if k+1==a:
        k+=1
print(-1 if k==0 else N-k)
from heapq import *
H, W = map(int, input().split())

strings = [0] * 26
for i in range(H):
    s = list(map(int, input().split()))
    for j in range(W):
        strings[ord(s[j])-97] -= 1

one = 0
two = 0
four = 0
s = H * W
if H % 2 == 1 and W % 2 == 1:
    one = 1
    two = H // 2 + W // 2
    four = (s-1-2*two)//4
elif H % 2 == 1:
    two = W // 2
    four = (s - two*2)//4
elif W % 2 == 1:
    two = H // 2
    four = (s - two*2)//4
else:
    four = s // 4

flag = 1
while True:
    if four > 0:
        a = heappop(strings)
        if a <= -4:
            a += 4
            heappush(strings, a)
        else:
            flag = 0
            break

    elif two > 0:
        a = heappop(strings)
        if a <= -2:
            a += 2
            heappush(strings, a)
        else:
            flag = 0
            break
    elif one > 0:
        a = heappop(strings)
        if a <= -1:
            a += 1
            heappush(strings, a)
        else:
            flag = 0
            break
    else:
        break

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


### FIXED CODE ###

from heapq import *
h, w = map(int, input().split())

char = [0]*26
for i in range(h):
    a = input()
    for j in range(w):
        char[ord(a[j])-97] -= 1

heapify(char)

q = []
if h % 2 == 1 and w % 2 == 1:
    for i in range((h//2)*(w//2)):
        q.append(4)
    for i in range((h+w-2)//2):
        q.append(2)
    q.append(1)

elif h % 2 == 1:
    for i in range((h//2)*(w//2)):
        q.append(4)
    for i in range(w//2):
        q.append(2)

elif w % 2 == 1:
    for i in range((h//2)*(w//2)):
        q.append(4)
    for i in range(h//2):
        q.append(2)

else:
    for i in range((h//2)*(w//2)):
        q.append(4)

flag = 1
for i in q:
    a = heappop(char)
    if -a >= i:
        a += i
        heappush(char, a)
    else:
        flag = 0
        break

if flag == 1:
    print("Yes")
else:
    print("No")
import collections
n = int(input())
s = list(input())
a = collections.Counter(s)
a = list(a.items())
ans = 0
# ar = []
# for i in range(1,2000):
#     c_ar = []
#     for j in range(1,n+1,i):
#         c_ar.append(j)
#     if len(c_ar) >= 3:
#         ar.append(c_ar)
# print(ar)
# print(len(ar))
# for i in range(len(ar)):
#     print(ar[i])
#     print(len(ar[i]))
#     for j in range(len(ar[i])-2):
#         print(s[ar[i][j]-1],s[ar[i][j+1]-1],s[ar[i][j+2]-1])
#         print(ar[i][j]-1, ar[i][j+1]-1, ar[i][j+2]-1)
#         if s[ar[i][j]-1] != s[ar[i][j+1]-1] and s[ar[i][j+1]-1] != s[ar[i][j+2]-1] and s[ar[i][j+2]-1] != s[ar[i][j]-1]:
#             cnt += 1
#             print("Y")
#     print(cnt)
# print(a[0][1],a[1][1],a[2][1])
# print(a[0][1]*a[1][1]*a[2][1]-cnt)

for i in range(1,n//2+3):
    cnt = 0
    #print(i)
    for j in range(n):
        if cnt + 2*i > n-1:
            break
        x,y,z = s[cnt], s[cnt+i], s[cnt+2*i]
        #print(cnt, cnt+i, cnt+i+i)
        if x != y and y != z and z != x:
            ans += 1
        cnt += 1
print(a[0][1]*a[1][1]*a[2][1]-ans)



### FIXED CODE ###

import collections
n = int(input())
s = list(input())
a = collections.Counter(s)
a = list(a.items())
ans = 0
# ar = []
# for i in range(1,2000):
#     c_ar = []
#     for j in range(1,n+1,i):
#         c_ar.append(j)
#     if len(c_ar) >= 3:
#         ar.append(c_ar)
# print(ar)
# print(len(ar))
# for i in range(len(ar)):
#     print(ar[i])
#     print(len(ar[i]))
#     for j in range(len(ar[i])-2):
#         print(s[ar[i][j]-1],s[ar[i][j+1]-1],s[ar[i][j+2]-1])
#         print(ar[i][j]-1, ar[i][j+1]-1, ar[i][j+2]-1)
#         if s[ar[i][j]-1] != s[ar[i][j+1]-1] and s[ar[i][j+1]-1] != s[ar[i][j+2]-1] and s[ar[i][j+2]-1] != s[ar[i][j]-1]:
#             cnt += 1
#             print("Y")
#     print(cnt)
# print(a[0][1],a[1][1],a[2][1])
# print(a[0][1]*a[1][1]*a[2][1]-cnt)
if n == 1 or n == 2 or n == 3:
    print(0)
    exit()
if len(a) != 3:
    print(0)
    exit()
for i in range(1,n//2+3):
    cnt = 0
    #print(i)
    for j in range(n):
        if cnt + 2*i > n-1:
            break
        x,y,z = s[cnt], s[cnt+i], s[cnt+2*i]
        #print(cnt, cnt+i, cnt+i+i)
        if x != y and y != z and z != x:
            ans += 1
        cnt += 1
print(a[0][1]*a[1][1]*a[2][1]-ans)
# coding=utf-8

sentence = input()
sentence.__reversed__()
print(sentence)

### FIXED CODE ###

# coding=utf-8

sentence = input()
sentence = sentence[::-1]
print(sentence)
def findSUM(n):
  sum = 0
  while( n > 0 ):
    sum += n % 10
    n //= 10
  return sum

N = int(input().split())

f = findSUM(N)
if (N % f == 0):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

def findSUM(n):
  sum = 0
  while( n > 0 ):
    sum += n % 10
    n //= 10
  return sum

N = int(input())

f = findSUM(N)
if (N % f == 0):
  print("Yes")
else:
  print("No")
n = int(input())
A = []
ans = 0
for i in range(n):
    x =int(input())
    lists = [list(map(int,input().split())) for j in range(x)]
    A.append(lists)

for i in range(2**n):
    honesty = [0]*n
    for j in range(n):
        if (i>>j) & 1:
            honesty[j] = 1
    true = 1
    for j in range(n):
        if honesty[j] == 1:
            for k in range(len(A[j])):
                x,y = A[j][k]
                
                if  honesty[x] != y :
                    true = 0
                    break
    if true == 1:
        ans = max(ans,sum(honesty))
print(ans)

### FIXED CODE ###

n = int(input())
A = []
ans = 0
for i in range(n):
    x =int(input())
    lists = [list(map(int,input().split())) for j in range(x)]
    A.append(lists)

for i in range(2**n):
    honesty = [0]*n
    for j in range(n):
        if (i>>j) & 1:
            honesty[j] = 1
    true = 1
    for j in range(n):
        if honesty[j] == 1:
            for k in range(len(A[j])):
                x,y = A[j][k]
                if not honesty[x-1] == y:
                    true = 0
                    break
    if true == 1:
        ans = max(ans,sum(honesty))
print(ans)
n, m = map(int, input().split())

aa = [[1]*(m + 2) for i in range(n+2)]

for i in range(1, n+1):
  for j in range(1, m+1):
    aa[i][j-1] *= -1
    aa[i][j] *= -1
    aa[i][j+1] *= -1
    aa[i-1][j-1] *= -1
    aa[i-1][j] *= -1
    aa[i-1][j+1] *= -1
    aa[i+1][j-1] *= -1
    aa[i+1][j] *= -1
    aa[i+1][j+1] *= -1
aa = aa[1:-1]
bb = [b[1:-1] for b in aa]
cc = [x  for y in bb for x in y]
ans = cc.count(-1)

print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
if n > 2 and m > 2:
  ans = (n-2)*(m-2)
elif n == 2 or m == 2:
  ans = 0
elif n == 1 and m == 1:
  ans = 1
elif n == 1:
  ans = m - 2
elif m == 1:
  ans = n - 2

print(ans)
x=int(input())
dp=[0]*(x+1)
dp[0]=1
for i in range(1,x+1):
  if i-100>=0 and dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
    dp[i]=1
  else:
    dp[i]=0
print(dp[x])

### FIXED CODE ###

x=int(input())
if (x//100)*105>=x:
  print(1)
else:
  print(0)
import math
 
A, B = list(map(int, input().split()))
 
rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]
 
if rangeA[0] < rangeB[0]:
  if math.ceil(rangeB[0]) < rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
elif rangeA[0] > rangeB[0]:
  if math.ceil(rangeA[0]) < rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
else:  # rangeA[0] == rangeB[0]
  if math.ceil(rangeA[0]) < rangeB[1] and math.ceil(rangeA[0]) < rangeA[1]: 
    print(math.ceil(rangeA[0]))
  	exit(0)
print(-1)

### FIXED CODE ###

import math
 
A, B = list(map(int, input().split()))
 
rangeA = [A / 0.08, (A + 1) / 0.08]
rangeB = [B / 0.1, (B + 1) / 0.1]
 
if rangeA[0] < rangeB[0]:
  if math.ceil(rangeB[0]) < rangeA[1]:
    print(math.ceil(rangeB[0]))
    exit(0)
elif rangeA[0] > rangeB[0]:
  if math.ceil(rangeA[0]) < rangeB[1]:
    print(math.ceil(rangeA[0]))
    exit(0)
else:  # rangeA[0] == rangeB[0]
  if math.ceil(rangeA[0]) < rangeB[1] and math.ceil(rangeA[0]) < rangeA[1]: 
    print(math.ceil(rangeA[0]))
    exit(0)
print(-1)
s = input()
t = input()
u = input()
print(t u s)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(c, a, b)
S = input()
h = S/3600
m = (S - 3600*h)/60
s = S -3600*h -60*m
print h ":" m ":" s

### FIXED CODE ###

S = input()
h = S/3600
m = (S - 3600*h)/60
s = S -3600*h -60*m
print "%d:%d:%d" %(h, m, s)
L, N = map(int,input().split())
words = []
for i in range(N):
  words.append(input())

words.sort()
print(''.join(words))

### FIXED CODE ###

N, L = map(int,input().split())
words = []
for i in range(N):
  words.append(input())
 
words.sort()
print(''.join(words))
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

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


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
try:
    paint(tmp[0][0], -1)
except KeyError:
    print(0)
print(tmp[0][1]) # color num    a
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

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


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
N,M = map(int,input().split())
S = input()
T = input()
import math
gcd_in = (math.gcd(N,M))
print(gcd_in)
lcm_in =  M*N / gcd_in
if gcd_in == 1:
    print(M*M)
elif gcd_in == M or gcd_in == N:
    for i in range(gcd_in):
        counter=0
        if S[(N//gcd_in)*i] == T[(M//gcd_in)*i]:
            counter += 1
    if counter==gcd_in:
        print(max(N,M))
    else:
        print(-1)
else:
    for i in range(min(lcm_in/N,lcm_in/M)):
        counter=0
        if S[lcm_in/M*i] == T[lcm_in/N*i]:
            counter += 1
        if counter==(min(lcm_in/N,lcm_in/M)):
            print(lcm_in)
        else:
            print(-1)

### FIXED CODE ###

n,m = map(int,input().split())
s = input()
t = input()
#greatest common divisor/least common multiple
import fractions
gcd = int(fractions.gcd(n,m))
lcm = int(n*m/gcd)
counter=0
for i in range(gcd):
    if s[int(n/gcd)*i]!=t[int(m/gcd)*i]:
        print(-1)
        counter+=1
        exit()
if counter == 0:
    print(lcm)
n=int(input())
a=list(map(int,input().split()))
a=[i if i%2==1 else None  for i in a]
if a.count()%2==1:
  print('NO')
else:
  print('YES')

### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
a=[]
for i in x:
  if i%2==1:
      a+=[i]
if len(a)%2==1:
  print('NO')
else:
  print('YES')
a = [int(i) for i in input().split()]

if a[4] - a[0] <= a[5]:
    print("Yay!")
else:
    print(":(")

### 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("Yay!")
else:
    print(":(")
from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    common = lcm(1, A[0])
    for a in A:
        common = lcm(common, a)

    cnt = M // common
    if (cnt + 0.5) * common <= M:
        print(cnt + 1)
    else:
        print(cnt)

if __name__ == "__main__":
    main()

### FIXED CODE ###

from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

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

def cnt_div_2(x):
    cnt = 0
    while x > 0:
        if x % 2 == 0:
            x //= 2
            cnt += 1
        else:
            break
    return cnt

def main():
    N, M = map(int, input().split())
    A = list(set(map(int, input().split())))
    cnt_2 = cnt_div_2(A[0])
    for a in A:
        if cnt_div_2(a) != cnt_2:
            print(0)
            exit()


    common = lcm_list(A)
    max_A = max(A)
    cnt = M // common
    if ((2 * cnt + 1) * common) // 2 <= M:
        print(cnt + 1)
    else:
        print(cnt)
    
if __name__ == "__main__":
    main()
lis_raw=[int(i) for i in input().split()]
print(max(lis[0]+lis[1], lis[0]-lis[1], lis[0]*lis[1]))

### FIXED CODE ###

a, b=map(int, input().split())
print(max(a + b, a - b, a*b))
import sys
sys.setrecursionlimit(10**7)

n, m = list(map(int, input().split()))
par = list(range(n+1))
dist = [0 for _ in range(n+1)]

def root(x):
  if x == par[x]:
    return x
  r = root(par[x])
  dist[x] += direct_cost(par[x])
  par[r] = r
  return r

def direct_cost(x):
  if x == par[x]:
    return 0
  return dist[x] + direct_cost(par[x])
  
def diff(x, y):
  return dist[x] - dist[y]

flag = True
for _ in range(m):
  l, r, d = list(map(int, input().split()))
  # 根が異なってたらとりあえず併合、同じならdifを取って整合性を確かめる
  rootx, rooty = root(l), root(r)
  if rootx != rooty:
    if r != rooty:
      # 直接yにつなげる
      dist[rootx] = d - direct_cost(x)
    else:
      # yの根につなげる
      dist[rootx] = d - (dist[l] - dist[rooty])
    par[rootx] = rooty
  else:
    if d != diff(l, r):
      flag = False
"""
[print("[{}]{}".format(idx, v), end=" ") for idx, v in enumerate(par)]
print()
[print("[{}]{}".format(idx, v), end=" ") for idx, v in enumerate(dist)]
print()
"""

print("Yes" if flag else "No")
  

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

class WeightedUnionFindTree:
  def __init__(self, n):
    self.par = list(range(n))
    self.rank = [0 for _ in range(n)]
    self.weight = [0 for _ in range(n)]
   
  def root(self, t):
    if t == self.par[t]:
      return t
    # 経路圧縮してみる
    r = self.root(self.par[t])
    self.weight[t] += self.weight[self.par[t]]
    self.par[t] = r
    return r
   
  def rec_weight(self, t):
    if t == self.par[t]:
      return 0
    return self.weight[t] + self.rec_weight(self.par[t])
   
  def same(self, x, y):
    return self.root(x) == self.root(y)
     
  def unite(self, x, y, w):
    rootx = self.root(x)
    rooty = self.root(y)
    if rootx != rooty:
      if y != rooty:
        # 直接yにつなげる
        self.weight[rootx] = w - self.rec_weight(x)
      else:
        # 根につなげる
        self.weight[rootx] = w - (self.weight[x] - self.weight[y])
      # ここで親を更新
      self.par[rootx] = y
    else:
      return w == self.diff(x, y)
 
  def diff(self, x, y):
    return self.rec_weight(x) - self.rec_weight(y)

n, m = list(map(int, input().split()))
par = list(range(n+1))
dist = [0 for _ in range(n+1)]


wuft = WeightedUnionFindTree(n+1)
flag = True
for _ in range(m):
  l, r, d = list(map(int, input().split()))
  # 根が異なってたらとりあえず併合、同じならdifを取って整合性を確かめる
  a = wuft.unite(l, r, d)
  if a is not None:
    if a == False:
      flag = False
"""
[print("[{}]{}".format(idx, v), end=" ") for idx, v in enumerate(wuft.par)]
print()
[print("[{}]{}".format(idx, v), end=" ") for idx, v in enumerate(wuft.weight)]
print()
"""

print("Yes" if flag else "No")
n,m=map(int,input().split())
g=[list(map(int,input().split())) for i in range(n)] 
c=[list(map(int,input().split())) for i in range(m)] 

for i in g:
    tmp=1000
    
    for j in range(m):
        t2=abs(i[0]-c[j][0]) + abs(i[1]-c[j][1])
        if t2 <tmp:
            no=j+1
            tmp=t2
            
    print(no)



### FIXED CODE ###

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

for i in g:
    tmp=10**9
    
    for j in range(m):
        t2=abs(i[0]-c[j][0]) + abs(i[1]-c[j][1])
        if t2 <tmp:
            no=j+1
            tmp=t2
            
    print(no)
a,b = map(int, input().split())

t = 0
pt = 0
for i in range(1000):
    t += i
    if a < pt and b < t:
        if (pt-a) == (t-b):
            print(pt-a)
            break
    pt = t

         


### FIXED CODE ###

s = int(input())
if s>999:
     print("ABD")
else:
  print("ABC")
for i in range(n+1):
    for j in range(n+1-i):
        k=n-i-j
        if 10000*i+5000*j+1000*k==y:
            print(i,j,k)
            flag=False
            break

if flag:
    print(-1,-1,-1)


### FIXED CODE ###

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

for i in range(n+1):
    for j in range(n+1-i):
        k=n-i-j
        if 10000*i+5000*j+1000*k == y:
            print(i,j,k)
            exit()

print(-1,-1,-1)
N =int(input())
i = 0

while True:
  i += N % 10
  N = int(N/10)
  if N == 0:
    break

if i % 9 == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N =input()
array = list(map(int, N))

if sum(array) % 9 == 0:
  print("Yes")
else:
  print("No")