Harryxun/stf_run huggingface dataset:
def solve(s1,s2,n,m,i,j):
    if i==n or j==m:
        return 0
    if s1[i]==s2[j]:
        return 1+solve(s1,s2,n,m,i+1,j+1)
    else:
        return max(solve(s1,s2,n,m,i+1,j),solve(s1,s2,n,m,i,j+1))
s1=input()
s2=input()
n=len(s1)
m=len(s2)
print(solve(s1,s2,n,m,0,0))

### FIXED CODE ###

def solve(s1,s2):
    rows=len(s1)
    cols=len(s2)
    dp=[[0]*(cols+1) for i in range(rows+1)]
    for i in range(1,rows+1):
        for j in range(1,cols+1):
            if s1[i-1]==s2[j-1]:
                dp[i][j]=dp[i-1][j-1]+1
            else:
                dp[i][j]=max(dp[i-1][j],dp[i][j-1])
                
    max_len=dp[rows][cols]
    result=[""]*(max_len+1)
    result[max_len]=""
    i=rows
    j=cols
    while i>0 and j>0:
        if s1[i-1]==s2[j-1]:
            result[max_len-1]=s1[i-1]
            max_len -=1
            i -=1
            j -=1
        elif dp[i-1][j]>dp[i][j-1]:
            i -=1
        else:
            j -=1
    return "".join(result)
            
                
#     if i==n or j==m:
#         return result
#     if s1[i]==s2[j]:
#         result +=s1[i]
#         return result+solve(s1,s2,n,m,i+1,j+1,result)
#     else:
#         left=solve(s1,s2,n,m,i+1,j,result)
#         right=solve(s1,s2,n,m,i,j+1,result)
#         if left:
#             result
        
        ##return max(solve(s1,s2,n,m,i+1,j,result),solve(s1,s2,n,m,i,j+1,result))
s1=input()
s2=input()
n=len(s1)
m=len(s2)
result=""
print(solve(s1,s2))
n,k=map(int,input().split())
l=[int(i) for i in input().split()]
c=0
mn=min(l)
while len(l)>=1:
  if mn==min(l):
    m=l.index(min(l))
    if m==0:
      l=l[m+1:]
    elif m+l[k-1::-1].index(min(l))==len(l):
      c+=m//(k-1)
      if m%(k-1)!=0:
        c+=1
      l=l[m+1:]
    else:
      c+=1
      l=l[k:]
  else:
    c+=len(l)//(k-1)
    if len(l)%(k-1)!=0:
      c+=1
    l=[]
print(c)


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
g=1
while k+(k-1)*(g-1)< n:
  g+=1
print(g)
A,B = map(int,input().split())
q = 0
for i in range(math.ceil(12.5*A),int(12.5*(A+1))):
    if 10*B <= i < 10*(B+1):
        q = i
        break
if q != 0:
    print(i)
else:
    print(-1)

### FIXED CODE ###

A,B = map(int,input().split())
import math
q = 0
for i in range(math.ceil(12.5*A),int(12.5*(A+1))):
    if 10*B <= i < 10*(B+1):
        q = i
        break
if q != 0:
    print(i)
else:
    print(-1)
n = int(input())

if n >=30;
print('Yes')
else
print('No')

### FIXED CODE ###

n = int(input())

if n >=30:
	print('Yes')
else:
	print('No')
a,b=map(int,input().split())
c = a*b
if c%2 == 0:
	print("Even")
  else:
  	print("Odd")
 

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')
N = int(input())
A = int(input())
B = int(input())
if(N == 1):
 print('Hello World')
else:
 print(A+B)

### FIXED CODE ###

N = int(input())
if(N == 1):
 print('Hello World')
else:
 A = int(input())
 B = int(input())
 print(A+B)
def mx(ls,i):
    if i == 0: return 0
    else     : return (i+1)*ls.pop()+ mx(ls,i-1)

def cns(ls,m,sm):
    global n, s
    count = 0
    if m == n:
        if sm == s: return 1
        else      : return 0
    elif s-mx(ls,n-m+1) <= sm <= s:
        for i in range(9-m+1):
            rls = ls[:]
            k = rls.pop(i)
            count += cns(rls,m+1,sm+(m+1)*k)
        return count
    else: return 0

ls = [0,1,2,3,4,5,6,7,8,9]
while True:
    n, s = map(int, raw_input().split())
    if s > mx(ls,n): print 0
    else        : print cns(ls,0,0)

### FIXED CODE ###

def mxmn(ls,m):
	global n
	s1,s2 = 0, 0
	for i in range(m):
		s1 += (n-i)*ls[-i-1]
		s2 += (n-i)*ls[i]
	return s1,s2

def f(ls,m,s):
	global n
	count = 0
	if m > 0:
		mx,mn = mxmn(ls,m)
		if mx < s or mn > s: return 0
		elif mx == s or mn == s: return 1
		for i in range(len(ls)):
			lls = ls[:]
			a = (n-m+1)*lls.pop(i)
			if s-a < 0:	break
			else: count += f(lls,m-1,s-a)
		return count
	else:
		return 1 if s == 0 else 0
			
ls = [i for i in range(10)]
while True:
	try:
		n,s = map(int, raw_input().split())
		print f(ls,n,s)
	except:
		break
n = int(input())
s = input()

def shifter(n, char):
    if ((ord(char) + n) > ord('Z')):
        n = n - 26
    
    return chr(ord(char) + n)

shifted_s = ''.join([shifter(n, char) for char in list(s)])

print(shifted_s)

### FIXED CODE ###

S = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
day = input()
#print day till next sunday
print(len(S) - S.index(day))
string = input()
num = int(input())
if num == 0:
    print(string)
else:
    out=string[0]
    for i,s in zip([i for i in range(len(string))],string):
        if i != 0:
            if i%num == 0:
                out=out+string[i]
    print(out)


### FIXED CODE ###

l = input().split()
if int(l[0])+int(l[1])==15:
    print('+')
elif int(l[0])*int(l[1]) ==15:
    print('*')
else:
    print('x')
a = -1
n,m = map(int, input().split())
s_and_c = [tuple(map(int,input().split())) for i in range(m)]
s = []
c = []
l = [0]*m
for t in s_and_c:
  l[t[0]-1] = t[1]
for _ in s_and_c:
  s.append(_[0])
  c.append(_[1])
if max(s) == n:
  a = "".join([str(i) for i in l])
else:
  pass
print(a)

### FIXED CODE ###

n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)
n, m = map(int, input().split())
a = {int(input()) for _ in range(m)]}

s = [1]*(n+1)

if 1 in a:
    s[1] = 0

for i in range(n-1):
    if i+2 in a:
        s[i+2] = 0
        continue
    s[i+2] = (s[i+1] + s[i]) % (10**9+7)
    
print(s[-1])

### FIXED CODE ###

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

s = [1]*(n+1)

if 1 in a:
    s[1] = 0

for i in range(n-1):
    if i+2 in a:
        s[i+2] = 0
        continue
    s[i+2] = (s[i+1] + s[i]) % (10**9+7)
    
print(s[-1])
import numpy as np
import sys
count = 0
N = int(input())
h = list(map(int, input().split()))

h = map(lambda x:  x-min(h) ,h)
count =+ min(h)
if max(h) == 0:
  return count

h = h.append(0)
while max(h) !=0:
    for i in range(len(h)+1):
        if h[i] == 0:
            continue
        else:
            for j in range(i+1,len(h)+1):
                if h[j] != 0:
                    continue
                else h[j] == 0:
                    count += 1
                    break
    h = map(lambda x:  x-1 ,h)
print(count)

### FIXED CODE ###

count = 0
N = int(input())
h = list(map(int, input().split()))
count =+ min(h)
h = list(map(lambda x:  x-min(h) ,h))
# if max(h) == 0:
#     print(count)
h.append(0)
while max(h) != 0:
    for i in range(len(h)):
        if h[i] <= 0:
            continue
        elif h[i-1] > 0:
            continue
        else:
            for j in range(i+1,len(h)+1):
                if h[j] > 0:
                    continue
                else:
                    count += 1
                    break
    h = list(map(lambda x:  x-1 ,h))
print(count)
N = int(input())
result =[]
while(N>=26):
    result.append(chr(N%26 + 96))
    N = int(N/26)12
result.append(chr(N + 96))
result.reverse()
print(''.join(result))

### FIXED CODE ###

N = int(input())
result =[]
alphabet = "zabcdefghijklmnopqrstuvwxy"
while(N>0):
    t = N%26
    result.append(alphabet[t])
    N = N//26
    if t == 0:
        N -= 1
result.reverse()

print(''.join(result))
l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for i in range(l)]
b = [[0 for i in range(n)] for i in range(m)]
c = [[0 for i in range(n)] for i in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += a[i][m] * b[m][j]
 print(" ".join([str(x) for x in c[i]]))

### FIXED CODE ###

l, m, n = map(int,input().split())
a = [[0 for i in range(m)] for i in range(l)]
b = [[0 for i in range(n)] for i in range(m)]
c = [[0 for i in range(n)] for i in range(l)]

for i in range(l):
 a[i] = [int(x) for x in input().split()]

for i in range(m):
 b[i] = [int(x) for x in input().split()]

for i in range(l):
 for j in range(n):
  for k in range(m):
   c[i][j] += (a[i][k] * b[k][j])
 print(" ".join([str(x) for x in c[i]]))
N,X=map(int,input().split())
L=[int(x)for x in input().split()]

count=0
D=0
for i in range(0,N+1):
    if(D>X):
        break
    else:
        count+=1
        D=D+L[i]
print(count)

### FIXED CODE ###

N,X=map(int,input().split())
L=[int(x)for x in input().split()]

count=0
D=0
n=0
for i in range(0,N):
    n+=1
    if(D>X):
        break
    else:
        count+=1
        D=D+L[i]
    
if(n==N and D<=X):
    count+=1
print(count)
import sys
  
class tree:
    def __init__(self):
        self.baby_list=[]
        self.counter=0
    
    def add_value(self):
        for i in self.baby_list:
            hoge[i].counter+=self.counter
            hoge[i].add_value()
            
N,Q=list(map(int, input().split() ))

hoge={i:tree() for i in range(1,N+1)}
    
for i in range(N-1):
    a,b=list(map(int, input().split() ))
    hoge[a].baby_list.append(b)

for i in range(Q):
    root, value = list(map(int, input().split() ))
    hoge[root].counter+=value

hoge[1].add_value()
output = []
for t in hoge:
    output.append(hoge[t].counter)

    
output = list(map(str, output))
print(" ".join(output))

### FIXED CODE ###

import sys

sys.setrecursionlimit(10000000)


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

data={i+1:0 for i in range(N)}

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

relate = [list(map(int, input().split() )) for i in range(N-1)]
relate.sort(key=lambda x :x[0])
    
for i in range(Q):
    root, value = list(map(int, input().split() ))
    data[root]+=value

for a,b in relate:
    data[b]+=data[a]

print(" ".join(list(map(str,list(data.values())))))
predict = input()
real = input()
cnt = 0

for i,j in zip(predict, real):
  if i == j:
    cnt += 1
    
print(cnt
  

### FIXED CODE ###

predict = input()
real = input()
cnt = 0
 
for i,j in zip(predict, real):
  if i == j:
    cnt += 1
    
print(cnt)
input()
a = map(int,input().split(" "))
print(max(a)-min(a))

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split(" ")))
print(max(a)-min(a))
a,b = [int(i) for i in input().split()]
if a > 0:
  print('Positive')
elif a = 0:
  print('Zero')
else:
  if b >= 0:
    print('Zero')
  elif b-a % 2 == 0:
    print('Negative')
  else:
    print('Positive')

### FIXED CODE ###

a,b = [int(i) for i in input().split()]
if a > 0:
  print('Positive')
elif a == 0:
  print('Zero')
else:
  if b >= 0:
    print('Zero')
  elif abs(b-a) % 2 == 0:
    print('Negative')
  else:
    print('Positive')
x, y, a, b, c = map(int, input().split())
R = sorted(list(map(int, input().split())), reverse=True)
G = sorted(list(map(int, input().split())), reverse=True)
M = sorted(list(map(int, input().split())), reverse=True)

ans, r, g, m = 0, 0, 0, 0
mr = R[x - 1]
mg = G[y - 1]

for i in range(x + y):
    print(r, g, m)
    if r >= x:
        if G[g] > M[m] or m >= c:
            ans += G[g]
            g += 1
        else:
            ans += M[m]
            m += 1
    elif g >= y:
        if R[r] > M[m] or m >= c:
            ans += R[r]
            r += 1
        else:
            ans += M[m]
            m += 1
    elif R[r] >= G[g]:
        if R[r] > M[m] or m >= c:
            ans += R[r]
            r += 1
        else:
            ans += M[m]
            m += 1
    elif R[r] < G[g] or r >= x:
        if G[g] > M[m] or m >= c:
            ans += G[g]
            g += 1
        else:
            ans += M[m]
            m += 1
print(ans)

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
r = sorted(list(map(int, input().split())))[a - x:]
g = sorted(list(map(int, input().split())))[b - y:]
m = list(map(int, input().split()))

ans = sorted(r + g + m)
print(sum(ans[len(ans) - x - y:]))
#coding:utf-8
n = int(input())
two = [1, 2, 4, 8, 16, 32, 64]
ans = 0

for i in two:
    if  two <= n:
        ans = two

print(ans)

### FIXED CODE ###

#coding:utf-8
n = int(input())
two = [1, 2, 4, 8, 16, 32, 64]
ans = 0

for i in range(7):
    if  two[i] <= n:
        ans = two[i]

print(ans)
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 998244353
N, S = lr()
A = lr()
dp = [0] * (S+1)
answer = 0
for a in A:
    dp[0] += 1 # Lの数は１個ずつ加わる
    prev = dp.copy()
    for i in range(S-a+1):
        dp[i+a] += prev[i]
    answer += dp[-1] # その位置をRとした時

print(answer % MOD)
# 26


### FIXED CODE ###

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 998244353
N, S = lr()
A = lr()
dp = [0] * (S+1)
answer = 0
for a in A:
    dp[0] += 1 # Lの数は１個ずつ加わる
    prev = dp.copy()
    for i in range(S-a+1):
        dp[i+a] += prev[i]
    answer += dp[-1] # その位置Rとした時

print(answer % MOD)
# 26
inf = 10**9
H, N = map(int, input().split())
AB = [[0, 0] for i in range(N)]
for i in range(N):
    AB[i][0], AB[i][1] = map(int, input().split())
AB.sort()
T = [[inf for i in range(H+1)] for j in range(N)]
for i in range(N):
    T[i][0] = 0
    if i == 0:
        for j in range(1, H+1):
            if j % AB[i][0] > 0:
                T[i][j] = AB[0][1] * (j // AB[0][0] + 1)
            else:
                T[i][j] = AB[0][1] * (j // AB[0][0])
    else:
        for j in range(1, AB[i][0]):
            T[i][j] = min(T[i-1][j], AB[i][1])
        for j in range(AB[i][0], H+1):
            T[i][j] = min(T[i-1][j], T[i][j - AB[i][0]]+AB[i][1])
print(T[N-1][H])

### FIXED CODE ###

inf = 10**9
H, N = map(int, input().split())
AB = [[0, 0] for i in range(N)]
for i in range(N):
    AB[i][0], AB[i][1] = map(int, input().split())
AB.sort()
T = [[inf for i in range(H+1)] for j in range(N)]
for i in range(N):
    T[i][0] = 0
    if i == 0:
        for j in range(1, H+1):
            if j % AB[i][0] > 0:
                T[i][j] = AB[0][1] * (j // AB[0][0] + 1)
            else:
                T[i][j] = AB[0][1] * (j // AB[0][0])
    else:
        for j in range(1, min(AB[i][0], H+1)):
            T[i][j] = min(T[i-1][j], AB[i][1])
        for j in range(AB[i][0], H+1):
            T[i][j] = min(T[i-1][j], T[i][j - AB[i][0]]+AB[i][1])
print(T[N-1][H])
import math
a,b,c,d=map(int,input().split())
cc=math.floor(b/c)-math.ceil(a/c)
dd=math.floor(b/d)-math.ceil(a/d)
cd=math.floor(b/(c*d/math.gcd(c, d)))-math.ceil(a/(c*d/math.gcd(c, d)))
print(b-a-cc-dd+cd)

### FIXED CODE ###


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


f = [c]
x = 1000000
k = [c, d]

while x != 0:
    x = max(k) % min(k)

    if x != 0:
        f.append(x)
    k.sort()
    k[1] = x
#print(min(f))

cc = (b // c)- ((a - 1) // c)
dd = (b // d)- ((a - 1) // d)
cd =(b // (c * d // min(f)))- ((a - 1) // (c * d // min(f)))
#print(cc,"cc")
#print(dd,"dd")
#print(cd,"cd")

print(int(b - a + 1 - cc - dd + cd))
def main():
    d,n = map(int, input().split())
    if n == 100:
        print((100**d) * n+1) 
        sys.exit()
    print((100**d) * n)  
if __name__ == '__main__':
    main()

### FIXED CODE ###

d,n = map(int,input().split())
li = []
for i in range(1,102):
    if i != 100:
        li.append(i*100**d)
print(li[n-1])
A = input()
if A 　== "A":
  print("T")
elif A == "T"
  print("A")
elif A == "C"
  print("G")
elif A == "G"
  print("C")

### FIXED CODE ###

A = input()
if A == "A":
  print("T")
elif A == "T":
  print("A")
elif A == "C":
  print("G")
elif A == "G":
  print("C")
import numpy as np
n,m = map(int,input().split())
A = np.zeros((n,n),dtype=np.bool)
for i in range(m):
    a,b = map(int,input().split())
    A[a-1,b-1] = 1
    
if 1 in A[A[0] == 1,n-1]:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

import numpy as np
n,m = map(int,input().split())
A1 = np.zeros(n,dtype=bool)
Ai = np.zeros(n,dtype=bool)
for i in range(m):
    a,b = map(int,input().split())
    if a == 1:
        A1[b-1] = True
    if b == n:
        Ai[a-1] = True
if np.any(Ai[A1]):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
n = int(raw_input())
 
G = [0 for i in range(n)] 
a = [[0 for i in range(n)] for j in range(n)]
dis = [1000 for i in range(n)]
dis[0] = 0

for i in range(n):
    G = map(int, raw_input().split())
    for j in range(G[1]):
        a[G[0]-1][G[2+j]-1] = 1
 
def bfs_visit(s):
    for k in range(n):
      if a[s][k] == 1:
       if dis[k] > dis[s] + 1:
         dis[k] = dis[s] + 1
         bfs_visit(k)

for s in range(n):
    bfs_visit(s)
for s in range(n):
    if dis[s] == 1000:
       dis[s] = -1
for s in range(n):
    print'{0} {1}'.format(s+1, d[s])
 

### FIXED CODE ###

n = int(raw_input())
   
dis = [99999 for i in range(n)]
G = [0 for i in range(n)]
v = [[0 for i in range(n)] for j in range(n)]
   
def BFS(s):
  for e in range(n):
    if v[s][e] == 1:
      if dis[e] > dis[s] + 1:
        dis[e] = dis[s]+1
        BFS(e)
   
for i in range(n):
  G = map(int, raw_input().split())
  for j in range(G[1]):
    v[G[0]-1][G[2+j]-1] = 1
   
dis[0] = 0
for s in range(n):
  BFS(s)
for s in range(n):
  if dis[s] == 99999:
    dis[s] = -1
for s in range(n):
  print'{0} {1}'.format(s+1, dis[s])
n,k = map(int, input().split())
ki = list(map(int,input().split()))
count = 0

for i in range(n):
  if ki[i] >= k:
    count += 1
  else:
    pass

print(count)
    



### FIXED CODE ###

n = int(input())
count = 0
result = 0
for i in range(n+1):
  if i % 2 == 0:
    pass
  else:
    count +=1

result = count / n

print(result)
n, m = map(int, input().split())
a = []
b = []
for i in range(m):
 a[i], b[i] = map(int, input().split())
cnt = 0

for i in range(1, n+1):
  for j in range(m):
    if a[j] = i:
      cnt += 1
    if b[j] = i:
      cnt += 1
  print(cnt)
  cnt = 0

### FIXED CODE ###

n, m = map(int, input().split())
a = []
b = []
for i in range(m):
  l = list(map(int, input().split()))
  a.append(l[0])
  b.append(l[1])
cnt = 0

for i in range(1, n+1):
  for j in range(m):
    if a[j] == i:
      cnt += 1
    if b[j] == i:
      cnt += 1
  print(cnt)
  cnt = 0
import math as m
import functools


def int_reverse(num):
    num_len = len(bin(num))-2
    f = 2**num_len-1
    return num ^ f

n = int(input())
A = [int(input()) for i in range(n)]
lsbs = [[i for i in range(int(m.log2(a))+1) if (a>>i)&1][0] for a in A]
nim = functools.reduce(lambda x,y:x^y, A)

cnt = 0
if nim == 0:
    ans = 0
else:
    for lsb in reversed(sorted(lsbs)):
        if int(m.log2(nim)) == lsb:
            nim = int_reverse(nim)
            cnt += 1

    ans = cnt if(nim == 0) else -1
print(ans)


### FIXED CODE ###

import math as m
import functools


def int_reverse(num):
    num_len = len(bin(num))-2
    f = 2**num_len-1
    return num ^ f

n = int(input())
A = [int(input()) for i in range(n)]
lsbs = [[i for i in range(int(m.log2(a))+1) if (a>>i)&1][0] for a in A]
nim = functools.reduce(lambda x,y:x^y, A)

cnt = 0
for lsb in reversed(sorted(lsbs)):
    if nim == 0:
        break
    if int(m.log2(nim)) == lsb:
        nim = int_reverse(nim)
        cnt += 1

ans = cnt if(nim == 0) else -1
print(ans)
N = int(input())
A = list(map(int,(input().split())))
 
sum=1
 
if 0 in A:
    print(0)
else:
    for i in range(N):
        sum *= A[i]  
        if sum >= int(1e18):
            break
    print(sum if sum<= int(1e18) else -1)
N = int(input())
A = list(map(int,(input().split())))

sum=1

if 0 in A:
    print(0)
else:
    for i in range(N):
        sum *= A[i]  
        if sum >= int(1e18):
            break
    print(sum if sum<= int(1e18) else -1)


### FIXED CODE ###

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

print(A*B)
n = int(input())
a = list(map(int,input().split()));
q = int(input())
aa = 0;
for i in range(n):
    aa += a[i];

b = [input().split() for l in range(q)]

bu = [None]*(100000);

for i in range(100000):
    bu[i] = a.count(i);
    
for x in range(q):
    c = int(b[x][0])
    d = int(b[x][1])
    aa += (d-c)*(bu[c]);
    bu[d] += bu[c];
    bu[c] = 0;
    print(aa);
    

### FIXED CODE ###


n = int(input())
a = list(map(int,input().split()));
q = int(input())
aa = 0;
for i in range(n):
    aa += a[i];

b = [input().split() for l in range(q)]

bu = [0]*(100000);

for i in range(n):
    bu[a[i]-1] += 1;
    
for x in range(q):
    c = int(b[x][0])
    d = int(b[x][1])
    aa += (d-c)*(bu[c-1]);
    bu[d-1] += bu[c-1];
    bu[c-1] = 0;
    print(aa);
s=int(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)
a = list(map(int,input().split())
a.sort()
print(10*a[2]+a[1]+a[0])

### FIXED CODE ###

a = list(map(int,input().split()))
a.sort()
print(10*a[2]+a[1]+a[0])
i=range(1,10)
for s in i:
 for b in i:
  print "%dx%d=%d",i,j,i*j

### FIXED CODE ###

x = range(1,10)
for i in x:
  for j in x:
    print u"%dx%d=%d"%(i, j, i*j)
n, q = map(int, input().split())
tree = [list() for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
c = [0] * n
for i in range(q):
    p, x = map(int, input().split())
    subtree = tree[p-1].copy()
    c[p-1] += x
    while subtree:
        snode = subtree.pop()
        c[snode] += x
        subtree += tree[snode]
print(*c)


### FIXED CODE ###

n, q = map(int, input().split())
tree = [list() for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
c = [0] * n
for i in range(q):
    p, x = map(int, input().split())
    c[p-1] += x

stack = [0]
j = [False] * n # すでに探索したか
while stack:
    node = stack.pop()
    j[node] = True
    for snode in tree[node]:
        if j[snode]:
            continue
        c[snode] += c[node]
        stack.append(snode)

print(*c)
def function():
    N,M = map(int, input().split())
    paths = []
    for _m in range(M+1):
        paths.append([])    
    
    for _m in range(M):
        A,B = map(int, input().split())
        paths[A].append(B)
        paths[B].append(A)
    
    dist = [-1]*(N+1)
    dist[1] = 0
    pre = [-1]*(N+1)
    q = [1] # 1からスタート
    while len(q) != 0:
        i = q.pop()
        for ne in paths[i]:
            if dist[ne] == -1:
                dist[ne] = dist[i]+1
                pre[ne] = i
                q.append(ne)
    #print(dist)
    print('Yes')
    pre.pop()
    pre.pop()
    for d in pre:
        print(d)

if __name__ == '__main__':
    function()


### FIXED CODE ###

def function():
    N,M = map(int, input().split())
    paths = []
    for _ in range(N+1):
        paths.append([])
    
    for _m in range(M):
        A,B = map(int, input().split())
        paths[A].append(B)
        paths[B].append(A)
    
    dist = [-1]*(N+1)
    dist[1] = 0
    pre = [-1]*(N+1)
    q = [1] # 1からスタート
    while len(q) != 0:
        i = q.pop(0)
        for ne in paths[i]:
            if dist[ne] == -1:
                dist[ne] = dist[i]+1
                pre[ne] = i
                q.append(ne)
    #print(dist)
    print('Yes')
    pre.pop(0)
    pre.pop(0)
    for d in pre:
        print(d)

if __name__ == '__main__':
    function()
a, b=map(int,input().split())
n=len(b)
A=a*(10**n)+b

T=(int(A**0.5))**2

if A==T:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

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

a, b=input().split()
n=len(b)
na = int(a)
nb = int(b)
A=na*(10**n)+nb
 
T=(int(A**0.5))**2
 
if A==T:
  print('Yes')
else:
  print('No')
N,Q=map(int, input().split())
s=list(input())
box=[1]*(N+2)
for _ in range(Q):
    k=1
    t,d=map(str, input().split())
    for j in s:
        if t == j:
            if box[k] > 0:
                if d =='L':
                    box[k-1]+=box[k]
                    box[k]=0
                else:
                    box[k+1]+=box[k]
                    box[k]=0
        k+=1
print(sum(box[1:N+1]))


### FIXED CODE ###

A,B,C=map(int, input().split())
if A == B and B == C:
  print('Yes')
else:
  print('No')