Harryxun/stf_run huggingface dataset:
A,B = map(int,input().split())

C = A / 0.08
D = B / 0.1

if int(C * 0.1) == B:
    if int(D * 0.08) == A:
        print(min(int(C),int(D)))
    else:
        print(int(C))
elif int(D * 0.08) == A:
    print(int(D))
else:
    print(-1)

### FIXED CODE ###

s = input()
if s[0] == s[1] == s[2]:
    print('No')
else:
    print('Yes')
A,B=int(input().split())
print(A*B)

### FIXED CODE ###

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

#0文字の場合をチェック
if ("A" not in s) and ("C" not in s) and ("G" not in s) and ("T" not in s):
    print 0

max = 0
for i, c in enumerate(s):
    if is_ACGT(c):
        if i == (len(s) - 1):
            break
        max = get_ACGT_length(s[i+1:])

print(max)

def is_ACGT(c):
    if (c == "A") or (c == "C") or (c == "G") or (c == "T"):
        return True
    else:
        return False

def get_ACGT_length(s):
    if len(s) == 0:
        return 0

    if not is_ACGT(s[0]):
        return 0

    if len(s) == 1:
        return 1
    return 1 + get_ACGT_length(s[1:])


### FIXED CODE ###

def is_ACGT(c):
    if (c == "A") or (c == "C") or (c == "G") or (c == "T"):
        return True
    else:
        return False

def get_ACGT_length(s):
    if len(s) == 0:
        return 0

    if not is_ACGT(s[0]):
        return 0

    return 1 + (get_ACGT_length(s[1:]))


s = str(input())

result = 0
for i, c in enumerate(s):
    if is_ACGT(c):
        result = max(get_ACGT_length(s[i:]), result)

print(result)
N,T = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(N)]
x=[]
for i in range(N):
  if a[i][1]<=T:
    x.append(a[i])
if len(x)==0:
  print("TLE")
else:
  x.sort(key=lambda x:x[0])
print(x[0][0])
  

### FIXED CODE ###

N,T = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(N)]
x=[]
for i in range(N):
  if a[i][1]<=T:
    x.append(a[i])
if len(x)==0:
  print("TLE")
else:
  x.sort(key=lambda x:x[0])
  print(x[0][0])
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

tmp = -10
res = 0
for i in range(N):
  res += B[A[i]-1]
  
  if A[i] == tmp + 1:
    res += C[tmp]
    
  tmp = A[i]
  
print(res)

### FIXED CODE ###

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

tmp = -10
res = 0
for i in range(N):
  res += B[A[i]-1]
  
  if A[i] == tmp + 1:
    res += C[tmp-1]
    
  tmp = A[i]
  
print(res)
a,b=input().split()
print((b-1)//a+1)

### FIXED CODE ###

a,b = list(map(int, input().split()))
i=0
while b>(a-1)*i+1:
	i+=1
print(i)
N = int(input())
S = []
C0 = 0
C1 = 0
C2 = 0
C3 = 0

for i in range(N):
    i = input()
    if i == AC:
        C0 = C0 + 1
    elif i == WA:
        C1 = C1 + 1
    elif i == TLE:
        C2 = C2 + 1
    else:
        C3 = C3 + 1

print(C0, C1, C2, C3)
    

### FIXED CODE ###

N = int(input())
C0, C1, C2, C3 = 0, 0, 0, 0

for i in range(N):
    S = str(input())
    if S == "AC":
        C0 = C0 + 1
    elif S == "WA":
        C1 = C1 + 1
    elif S == "TLE":
        C2 = C2 + 1
    else:
        C3 = C3 + 1

print("AC x " + str(C0))
print("WA x " + str(C1))
print("TLE x " + str(C2))
print("RE x " + str(C3))
def function(N, L, X):
    D = [0]
    for i in range(1, N+2):
        D.append(D[i-1]+L[i-1])
        if D[-1] > X:
            return i

line = input()
N, X = [int(n) for n in line.split()]
line = input()
L = [int(n) for n in line.split()]
print(function(N, L, X))

### FIXED CODE ###

n, m = map(int, input().split())
l = [int(x) for x in input().split()]
answ = 1
h = 0
for k in l:
  h += k
  if h > m:
    break
  else:
    answ += 1
print(answ)
import sys
sys.setrecursionlimit(10000)

s = list(input())
leng = len(s)
tmp = "R"
lis = [0]*(leng)

for i in range(1,leng):
    if s[i] == "L":
        if tmp == "R":
            s[i] = "G"
            tmp = "L"
        else:
            tmp = "L"
    else:   #s[i] =="R"
        tmp = "R"

def count(num,locat):
    if s[locat] == "L":
        num += 1
        count(num,locat-1)
    if s[locat] == "R":
        num += 1
        count(num,locat+1)
    if s[locat] == "G":
        if num%2 == 0:
            lis[locat] += 1
        else:
            lis[locat-1] += 1

for i in range(leng):
    count(0,i)

print (*lis)

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(100000)

#S     G     S
#RRR..RLL...LRR...

s = list(input())
leng = len(s)
tmp = "R"
s[0] = "S"

for i in range(1,leng):
    if s[i] == "L":
        if tmp == "R":
            s[i] = "G"
        tmp = "L"
    else:
        if tmp == "L":
            s[i] = "S"
        tmp = "R"
lis = [0]*(leng)
tmp_s = 0
tmp_g = leng - 1

for i in range(1,leng):
    if s[i] == "G":
        tmp_g = i
    if s[i] == "S" or i == leng-1:
        if i == leng-1:
            i += 1
        if (tmp_g - tmp_s) % 2 == 0:
            lis[tmp_g-1] = math.floor((i - tmp_s)/2)
            lis[tmp_g] = math.floor((i - tmp_s)/2 + 0.5)
        else:
            lis[tmp_g-1] = math.floor((i - tmp_s)/2 + 0.5)
            lis[tmp_g] = math.floor((i - tmp_s)/2)
        tmp_s = i
        continue

    continue

print (*lis)
list1 = list(map(int,input().split()))
h = list1[0]
w = list1[1]
a = list()
i = 0
n = 0
ans = list()
while i <= h-1:
    a.append(list(map(int,input().split())))
    i += 1
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i][j+1] += 1
            n+=1
            ans.append([i+1,j+1,i+1,j+2])
for i in range(h-1):
    if a[i][w-1] % 2 != 0:
        a[i][w-1] -= 1
        a[i+1][w-1] += 1
        ans.append([i+1, w, i+2, w])
        n+=1
print(n)
for i in range(n):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3])


### FIXED CODE ###

list1 = list(map(int,input().split()))
a = list1[0]
b = list1[1]
if a % 2 != 0:
    if b % 2 != 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')
n = int(input())

ans = []
for i in range(1, n + 1):
    x = i
    for j in range(100):
        if x % 2 == 0:
            x = int(x // 2)
            #ans.append(j)
        else:
            #ans.append(j)
            break
    #ans.append(j)

#print(ans)
print(ans.index(max(ans)) + 1)


### FIXED CODE ###

n = int(input())

ans = []
for i in range(1, n + 1):
    x = i
    for j in range(100):
        if x % 2 == 0:
            x = int(x // 2)
            #ans.append(j)
        else:
            #ans.append(j)
            break
    ans.append(j)

#print(ans)
print(ans.index(max(ans)) + 1)
x, a, b = input().split()
x = int(x)
a = int(a)
b = int(b)

if a + b + c <22:
  print("win")
else:
  print("bust")

### FIXED CODE ###

a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
if a + b + c < 22:
	print("win")
else:
	print("bust")
#!python3

def resolve():
    N, K = map(int, input().rstrip().split())
    R, S, P = map(int, input().rstrip().split())
    T = input().rstrip().split()

    score = {"r":  P, "s": R, "p": S}

    s = 0
    for i in range(i, K):
        s += score[T[i]]

    for i in range(K, N):
        if T[i-K] == T[i]:
            continue
        s += score[T[i]]

    print(s)

if __name__ == "__main__":
    resolve()


### FIXED CODE ###

#!python3

def resolve():
    N, K = map(int, input().rstrip().split())
    R, S, P = map(int, input().rstrip().split())
    T = list(input().rstrip())

    score = {"r":  P, "s": R, "p": S}

    s = 0
    for i in range(K):
        s += score[T[i]]

    for i in range(K, N):
        if T[i-K] == T[i]:
            T[i] = ""
            continue
        s += score[T[i]]

    print(s)

if __name__ == "__main__":
    resolve()
a = input()
print x**3



### FIXED CODE ###

# python3 では input()は文字列として処理される。

x = int(input())
print(x**3)
import numpy as np

n = int(input())
a = list(map(int,input().split()))
a = np.array(a,dtype=np.int64)
point = 0
mod = 10**9+7

b = [((a>>i)&1).sum() for i in range(61)]
c = [n-b[i] for i in range(61)]
d = [c[i]*b[i]%mod for i in range(61)]

point = 0
for i in range(61):
    point += (2**i)*d[i]%mod

point %= mod

print(point)

### FIXED CODE ###

from sys import stdin
n,k = map(int,stdin.readline().rstrip().split())
li = list(map(int,stdin.readline().rstrip().split()))
nai = 0
ato = 0
point = 0
for i in range(n):
    for s in range(i+1,n):
        if li[i] > li[s]:
            nai += 1
    for v in range(n):
        if li[i] > li[v]:
            ato += 1
point += (nai*k)+(ato*k*(k-1)//2)
print(point%(10**9+7))
import math

def main():
    h = int(input())
    n = math.floor(math.log2(h))
    print(2**(n+1)-1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import math

def main():
    h = int(input())
    n = math.floor(math.log(h,2))
    print(2**(n+1)-1)


if __name__ == '__main__':
    main()
a,b=map(int(input().split()))
print(b%a+1)

### FIXED CODE ###

a, b = map(int, input().split())
for i in range(50):
    if  a * i  - (i-1) >= b:
        print(i)
        exit()
def main():
    a,b,c,d,e,f= map(int,input().split())

    # 100gあたりE [g]溶ける
    # ビーカーにF [g]いれられる
    # 濃度は100*砂糖 / (水＋砂糖)


    mizu=[]
    sato=[]


    x = int(f/100/a) +1
    y = int(f/100/b) +1

    for i in range(x):
        for j in range(y):
            mizu.append(i*100*a + j*100*b)

    mizu = [i for i in mizu if i <= f]
    mizu = list(set(mizu))
    mizu.sort()

    tokeru = int(f/100) * e
    x = int(tokeru / c) +1
    y = int(tokeru / d) +1

    for i in range(x):
        for j in range(y):
            sato.append(i*c + j*d)

    sato = [i for i in sato if i < tokeru]
    sato = list(set(sato))
    sato.sort()
    sato.remove(0)
    mizu.remove(0)

    tmp =0

    for i in mizu:
        for j in sato:
            if i + j <= f:
                if int(i/100)*e >=j:
                    if tmp <= (100*j) / (i + j):
                        tmp = (100*j) / (i + j)
                        ans = [i+j,j]

    print(ans)


if __name__ == "__main__":
        main()


### FIXED CODE ###


def main():
    a,b,c,d,e,f= map(int,input().split())

    # 100gあたりE [g]溶ける
    # ビーカーにF [g]いれられる
    # 濃度は100*砂糖 / (水＋砂糖)


    mizu=[]
    sato=[]


    x = int(f/100/a) +1
    y = int(f/100/b) +1

    for i in range(x):
        for j in range(y):
            mizu.append(i*100*a + j*100*b)

    mizu = [i for i in mizu if i <= f]
    mizu = list(set(mizu))
    mizu.sort()

    tokeru = int(f/100) * e
    x = int(tokeru / c) +1
    y = int(tokeru / d) +1

    for i in range(x):
        for j in range(y):
            sato.append(i*c + j*d)

    sato = [i for i in sato if i < tokeru]
    sato = list(set(sato))
    sato.sort()
#    sato.remove(0)
#    mizu.remove(0)

    tmp =0

    for i in mizu:
        for j in sato:
            if i + j <= f and i + j !=0:
                if int(i/100)*e >=j:
                    if tmp <= (100*j) / (i + j):
                        tmp = (100*j) / (i + j)
                        ans = str(i+j) + " " + str(j)

    print(ans)


if __name__ == "__main__":
        main()
for i in range(3000):
    a, b = map(int, input().split())
    
    if a == b == 0
        break
    
    if a < b:
        print(a, b)
    else
        print(b, a)
    
    
    


### FIXED CODE ###

for i in range(3000):
    a, b = map(int, input().split())
    
    if a == b == 0:
        break
    elif a < b:
        print(a, b)
    else:
        print(b, a)
from math import gcd
from itertools import combinations
from functools import reduce


def calc_gcd(nums):
    return reduce(gcd, nums)


def main(input_1, input_2):
    nums_list = list(map(list, list(combinations(input_2, len(input_2)-1))))

    gcd_list = []
    for nums in nums_list:
        calced = calc_gcd(nums)
        gcd_list.append(calced)

    return max(gcd_list)


if __name__ == "__main__":
    input_1 = input()
    input_2 = list(map(int, input().split()))
    print(main(input_1, input_2))


### FIXED CODE ###

from fractions import gcd


def main(input_1, input_2):
    left = [0] * (input_1+1)
    for i in range(input_1):
        left[i+1] = gcd(left[i], input_2[i])

    right = [0] * (input_1 + 1)
    i = input_1 - 1
    while i >= 0:
        right[i] = gcd(right[i+1], input_2[i])
        i -= 1

    while i >= 0:
        right[i] = gcd(right[i+1], input_2[i])

    res = 0
    for i in range(input_1):
        l = left[i]
        r = right[i+1]
        gcd_val = gcd(l, r)
        if gcd_val > res:
            res = gcd_val

    return res


if __name__ == "__main__":
    input_1 = int(input())
    input_2 = list(map(int, input().split()))
    print(main(input_1, input_2))
from fractions import gcd

n, m = [int(i) for i in input().split()]
S = input()
T = input()

g = n * m // gcd(n, m)

try:

    L = [''] * g

except:
    print(-1)

if S[0] != T[0]:
    print(-1)
    exit()

for i, s in zip(range(0, g, g//n), S):
    L[i] = s

for i, t in zip(range(0, g, g//m), T):
    L[i] = t
    
A = []
B = []

for i in range(0, g, g//n):
    A.append(L[i])

for i in range(0, g, g//m):
    B.append(L[i])

if ''.join(A) == S and ''.join(B) == T:
    print(g)
else:
    print(-1)

### FIXED CODE ###

from fractions import gcd

n, m = [int(i) for i in input().split()]
S = input()
T = input()

g = n * m // gcd(n, m)

SA = set()
SB = set()

for i in range(0, g, g//n):
    SA.add(i)

for i in range(0, g, g//m):
    SB.add(i)

SC = SA & SB

for s in SC:
    if S[s//(g//n)] != T[s//(g//m)]:
        print(-1)
        exit()

print(g)
for i in range(n-1,1,-1):
    dif = h[i] - h[i-1]
    if(dif == -1):
        h[i-1] -= 1
    elif(dif < -1):
        print('No')
        exit()

print('Yes')

### FIXED CODE ###

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

for i in range(n-1,1,-1):
    dif = h[i] - h[i-1]
    if(dif == -1):
        h[i-1] -= 1
    elif(dif < -1):
        print('No')
        exit()

print('Yes')
a,b,c,x=[int(input()) for i in range(4)]
print([500*x+100*y+50*z for z in range(c+1) for y in range(b+1) for x in range(a+1)].count(x))

### FIXED CODE ###

N,Y=map(int,input().split())
for x in range(N+1):
    for y in range(N+1):
        z=N-x-y
        if 0<=z<=2000:
            if 10000*x+5000*y+1000*z==Y:
                print(x,y,z)
                exit()
print(-1,-1,-1)
cnt = 0
for i in range(L, R+1):
    if i % d == 0:
        cnt += 1
print(cnt)

### FIXED CODE ###

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

cnt = 0
for i in range(L, R+1):
    if i % d == 0:
        cnt += 1
print(cnt)
import sys
sys.setrecursionlimit(114514)
N=int(input())
a=[-1]+[int(input())-1 for i in range(1,N)]
G=[[] for i in range(N)]
for i in range(1,N):
    G[a[i]].append(i)
def dp(i):
    if len(G[i])==0:
        return 0
    X=sorted([dp(j) for j in G[i]],reverse=True)
    K=len(X)
    Y=[X[i]+i+1 for i in range(K)]
    return max(Y)
print(dp(0))


### FIXED CODE ###

import sys
import heapq
sys.setrecursionlimit(2*10**5)
N=int(input())
a=[-1]+[int(input())-1 for i in range(1,N)]
G=[[] for i in range(N)]
for i in range(1,N):
    G[a[i]].append(i)
def dp(i):
    if len(G[i])==0:
        return 0
    q=[]
    for j in G[i]:
        heapq.heappush(q,-dp(j))
    k=1
    res=0
    while(q):
        x=-heapq.heappop(q)
        res=max(res,x+k)
        k+=1
    return res
print(dp(0))
N,T=map(int,input().split())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

### FIXED CODE ###

N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if(end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
    ans *= num_way(end-start)
    print(ans%1000000007)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if(end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
    ans *= num_way(end-start)
    print(ans%1000000007)
a = input()
n = 2
m = 3
print(a+a**n+a**3)

### FIXED CODE ###

a = int(input())
n = 2
m = 3
print(a + a ** n + a ** m)
def D(n,d):
  r=0
  while n>0:
    r=r+n%d
    n=n//d
  return r

n=int(input())
s=int(input())
if n-s==0:
  print(n+1)
  exit()

A=[]
for i in range(1,int((n-s)**(1/2))+1):
  if (n-s)%i==0:
    A.append(i)
for i in range(len(A)):
  if D(n,A[i]+1)==s:
    print(A[i]+1)
    exit()
print(-1)

### FIXED CODE ###

def D(n,d):
  r=0
  while n>0:
    r=r+n%d
    n=n//d
  return r

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)
    divisors.sort()
    return divisors

n=int(input())
s=int(input())
if n-s==0:
  print(n+1)
  exit()
if s>n:
  print(-1)
  exit()

A=make_divisors(n-s)
for i in range(len(A)):
  if D(n,A[i]+1)==s:
    print(A[i]+1)
    exit()
print(-1)
n, m = map(int, input().split())
a_list = []
b_list = ["f"] * (10**5+1)
count_ac = 0
count_wa = 0
for i in range(m):
    a,b = map(str, input().split())
    a_list.append((int(a),b))
for i in range(m):
    if a_list[i][1] == "WA" and b_list[a_list[i][0]] == "f":
        count_wa += 1
    if a_list[i][1] == "AC":
        if b_list[a_list[i][0]] == "f":
            count_ac += 1
        b_list[a_list[i][0]] = "t"
for i in range(m):
    if b_list[a_list[i][0]] == "f" and b_list[a_list[i][1]] == "WA":
        count_wa -= 1
print(count_ac,count_wa)

### FIXED CODE ###

n, m = map(int, input().split())
a_list = []
b_list = ["f"] * (10**5+1)
count_ac = 0
count_wa = 0
for i in range(m):
    a,b = map(str, input().split())
    a_list.append((int(a),b))
for i in range(m):
    if a_list[i][1] == "WA" and b_list[a_list[i][0]] == "f":
        count_wa += 1
    if a_list[i][1] == "AC":
        if b_list[a_list[i][0]] == "f":
            count_ac += 1
        b_list[a_list[i][0]] = "t"
for i in range(m):
    if b_list[a_list[i][0]] == "f" and a_list[i][1] == "WA":
        count_wa -= 1
print(count_ac,count_wa)
N, M = map(int, input().split())
MOD = 10**9+7

def factorize(N):
    res = []
    for i in range(2, N):
        if i**2 > N: break
        if N % i != 0: continue
        num = 0
        while N % i == 0:
            N = int(N/i)
            num += 1
        res.append(num)
    if N>1: res.append(1)
    return res

res = factorize(M)

n = max(res) + N 

fac = [1]*n
inv = [1]*n
finv = [1]*n

for i in range(2, n):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD

ans = 1
for m in res:
    a = fac[m+N-1] * (finv[m] * finv[N-1] % MOD) % MOD
    ans = ans*a%MOD

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
MOD = 10**9+7

def factorize(N):
    res = []
    for i in range(2, N):
        if i**2 > N: break
        if N % i != 0: continue
        num = 0
        while N % i == 0:
            N = int(N/i)
            num += 1
        res.append(num)
    if N>1: res.append(1)
    return res

res = factorize(M) if M>1 else [0]

n = max(res) + N 

fac = [1]*n
inv = [1]*n
finv = [1]*n

for i in range(2, n):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD%i] * int(MOD / i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD

ans = 1
for m in res:
    a = fac[m+N-1] * (finv[m] * finv[N-1] % MOD) % MOD
    ans = ans*a%MOD

print(ans)
n = int(input())
ki = [[]for j in range(n)]
for i in range(n-1):
	    a,b=map(int,input().split())
	    a-=1
	    b-=1
	    ki[a].append([b,i])
	    ki[b].append([a,i])


a=[0]*n
for i in range(n):
	    a[i]= len(ki[i])
print(max(a))
clist=[-1]*(n-1)
visited=[[0]for i in range(n)]
def dfs(now,last,ban_color=-1):
	    color =1
	    for next,id in ki[now]:
	    	    
                     
	    	    if next == last:continue
	    	    if color == ban_color:
	    	    	    color+=1
	    	    clist[id] = color
	    	    dfs(next,now,color)
	    	    
	    	    color+=1
	    	    
dfs(0,-1)
for i in range(n-1):
    print(clist[i])


		

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n = int(input())
ki = [[]for j in range(n)]
for i in range(n-1):
	    a,b=map(int,input().split())
	    a-=1
	    b-=1
	    ki[a].append([b,i])
	    ki[b].append([a,i])


a=[0]*n
for i in range(n):
	    a[i]= len(ki[i])
print(max(a))
clist=[-1]*(n-1)
visited=[[0]for i in range(n)]
def dfs(now,last,ban_color=-1):
	    color =1
	    for next,id in ki[now]:
	    	    
                     
	    	    if next == last:continue
	    	    if color == ban_color:
	    	    	    color+=1
	    	    clist[id] = color
	    	    dfs(next,now,color)
	    	    
	    	    color+=1
	    	    
dfs(0,-1)
print(*clist)
N, M=map(int,input().split())
def f(num):
    lis=[]
    for i in range(1,int(num**0.5)+1):
        if num%i==0:
            lis.append(i)
            if i**2!=num:
                lis.append(num//i)
    lis.sort()
    return lis

res=0
def c(m,n):
    if n>0:
        print(n,m,f(m))
        for i in f(m):
            j=m//i
            c(j,n-1)
    else:
        global res
        res+=len(f(m))

c(M,n=N-2)
print(res)  

### FIXED CODE ###

def cmb(n,r):
    r=min(r,n-r)
    result=1
    for i in range(n-r+1,n+1):
        result*=i
    for i in range(1,r+1):
        result//=i
    return result

def factorize(n):
    i=2
    result={}
    while True:
        if i**2>n:
            break
        count=0
        while n%i==0:
            n//=i
            count+= 1
        if count!=0:
            result[i]=count
        i+=1
    if n>1:
        result[n]=1
    return result


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

r = 1
for i,j in l.items():
    r *= cmb(j+N-1,j)%(10**9+7)
    r %= (10**9+7)
print(r)
"""
B - AcCepted
文字列 S が与えられます。S のそれぞれの文字は英大文字または英小文字です。 S
が次の条件すべてを満たすか判定してください。

S の先頭の文字は大文字の A である。
Sの先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1
個含まれる。
以上の A, C を除く S のすべての文字は小文字である。
"""

s = input()

ans = True
if s[0] != "A":
    ans = False
    #print("s[0] is not A")
else:
    cnt_C = 0
    length = len(s)

    n = 1
    for check_char in s[1:-1]:
        
        if check_char.islower() is False:
            if check_char != "C" or n == 1 or n == (length - 1):
                ans = False
            
            cnt_C += 1
        
        n += 1

if cnt_C != 1:
    ans = False

if ans:
    print("AC")
else:
    print("WA")

### FIXED CODE ###

"""
B - AcCepted
文字列 S が与えられます。S のそれぞれの文字は英大文字または英小文字です。 S
が次の条件すべてを満たすか判定してください。

S の先頭の文字は大文字の A である。
Sの先頭から 3 文字目と末尾から 2 文字目の間（両端含む）に大文字の C がちょうど 1
個含まれる。
以上の A, C を除く S のすべての文字は小文字である。
"""

s = input()

cnt_C = 0
ans = True
if s[0] != "A":
    ans = False
    #print("s[0] is not A")
else:
    length = len(s)

    n = 1
    for check_char in s[1:]:
        #print(check_char)
        
        if check_char.islower() is False:
            if check_char != "C" or n == 1 or n == (length - 1):
                ans = False
            
            cnt_C += 1
        
        n += 1

if cnt_C != 1:
    ans = False

if ans:
    print("AC")
else:
    print("WA")