Harryxun/stf_run huggingface dataset:
C = raw_input()
C_ord = ord(C)
print(chr(C_ord + 1))

### FIXED CODE ###

C = ord(raw_input())
print(chr(C+1))
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(2,n+1):
  if hoge[j] == 0:
    continue
  else:
    hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    if j == 1:
      hoge[j] = hoge[j-1]
    else:
      hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))
import sys
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    ans = []
    if m%2:
        l = 1
        r = m
        while l+1<r:
            ans.append(l,r)
            l += 1;r-=1
        l = r
        r = 2*m+1
        while l<r:
            ans.append([l,r])
            l+=1;r-=1
    else:
        l = 1
        r = m+1
        while l+1<r:
            ans.append(l,r)
            l += 1;r-=1
        l = r
        r = 2*m+1
        while l<r:
            ans.append([l,r])
            l+=1;r-=1
    
    for a in ans:
        print(*ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    ans = []
    r = 2*m+1
    if m%2:
        for i in range(1,m//2+1):
            ans.append([i,m+1-i])
        for i in range(m+1,(m+1+r)//2+1):
            ans.append([i,m+1+r-i])
    else:
        for i in range(1,m//2+1):
            ans.append([i,m+1-i])
        for i in range(m+1,(m+1+r)//2):
            ans.append([i,m+1+r-i])            
    for a in ans:
        print(*a)


if __name__ == "__main__":
    main()
x,y = map(int,input.split())
if x*y%2==0
    print("Even")
    else print("Odd")
end



### FIXED CODE ###

a,b = map(int,input().split())
if a*b%2==0:
    print('Even')
elif a*b%2==1:
    print('Odd')
import math

n,x=map(int,input().split())
l=[abs(c-x) for c in list(map(int,input().split()))]
if len(l)<2:
	print(l[0])
else:
	l.append(math.gcd(l[0],l[1]))
	for x in range(n-2):
		l.append(math.gcd(l[-1],l[x+2]))
	print(l[-1])

### FIXED CODE ###

def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))
G, B = map(int,input().split())

if G*B <= 0:
  print('Zero')

elif G > 0:
  print('Positive')

elif (b - a) % 2 == 0:
  print('Negative')

### FIXED CODE ###

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

if G>0 and B>0:
    print('Positive')

elif G<=0 and B>=0:
    print('Zero')

elif G < 0 and B < 0:
    if (B - G) % 2 == 0:
        print("Negative")
    else:
        print("Positive")
_, m = map(int, input().split())

mi, mx = map(int, input().split())
for i in range(m-1):
    l, r = map(int, input().split())
    if mi < l <= mx:
        mi = l
    if mi <= r < mx:
        mx = r
    if mx < l or r < mi:
        flag = True
        break

if flag:
    print(0)
else:
    print(mx - mi + 1)

### FIXED CODE ###

_, m = map(int, input().split())

mi, mx = map(int, input().split())
flag = False
for i in range(m-1):
    l, r = map(int, input().split())
    if mi < l <= mx:
        mi = l
    if mi <= r < mx:
        mx = r
    if mx < l or r < mi:
        flag = True
        break

if flag:
    print(0)
else:
    print(mx - mi + 1)
#coding:utf-8
N,K=list(map(int,input().split()))
print(K*(K-1)**(N-1))


### FIXED CODE ###

#coding:utf-8
a,b,c=list(map(int,input().split()))

if a==b and b==c:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)
s = str(input())
k = int(input())
for i in range(k):
    if s[k] != 1:
        print(s[k])
        exit()
print(1)

### FIXED CODE ###

s = str(input())
k = int(input())
for i in range(k):
    if s[i] != "1":
        print(s[i])
        exit()
print(1)
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque, defaultdict
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

mod = 1000000007

N = n1()
(A, B) = ([], [])
for i in range(N):
    a, b = nn()
    if a < 0: a *= -1; b *= -1
    g = gcd(a, b)
    if g < 0: g *= -1
    A.append(a // g)
    B.append(b // g)

d = defaultdict(int)
for i in range(N):
    d[(A[i], B[i])] += 1

ans = 1
while len(d) > 0:
    #print(d, ans)
    (x, y), n1 = d.items()[0]
    d.pop((x, y))
    if y < 0: x *= -1; y *= -1
    if (y, -x) in d:
        n2 = d.pop((y, -x))
        ans = (ans * ((2**n1 -1 + 2**n2 - 1) % mod + 1)) % mod
    else:
        ans = (ans * (2**n1 % mod)) % mod

print(ans-1)


### FIXED CODE ###


import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque, defaultdict
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

mod = 1000000007

N = n1()
(A, B) = ([], [])
for i in range(N):
    a, b = nn()
    g = gcd(a, b)
    if g != 0: a //= g; b //=g
    A.append(a)
    B.append(b)

d = defaultdict(int)
for i in range(N):
    d[(A[i], B[i])] += 1

ans = 1
n = 0
if (0, 0) in d:
    n = d.pop((0, 0))

while len(d) > 0:
    #print(d, ans)
    (x, y), n1 = d.popitem()
    if y < 0: x *= -1; y *= -1

    n2 = 0
    if (y, -x) in d: n2 += d.pop((y, -x))
    if (-y, x) in d: n2 += d.pop((-y, x))

    ans = (ans * ((pow(2,n1,mod) -1 + pow(2,n2,mod) - 1) % mod + 1)) % mod

print((ans-1+n)%mod)
import numpy as np
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)

### FIXED CODE ###

from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
  for j in range(1, k+1):
    GCD = gcd(i, j)
    for l in range(1, k+1):
      ans += gcd(GCD, l)
print(ans)
a,b = [i for i in int(input())]
if a+b =3:
		print(3)
		
elif  a+b = 4:
		print(2)

else:
		print(1)

### FIXED CODE ###

a= int(input())
b= int(input())
if a+b ==3:
		print(3)
		
elif  a+b == 4:
		print(2)
 
else:
		print(1)
a = input().split()
if a[1] == '+':
  print(a[0]+a[2])
else:
  print(a[0]-a[2])

### FIXED CODE ###

a = input().split()
if a[1] == '+':
  print(int(a[0])+int(a[2]))
else:
  print(int(a[0])-int(a[2]))
n,a,b=map(int,input()split())

if n*a>b:
  return b

else:
  return n*a

### FIXED CODE ###

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

if li[0]*li[1]>li[2]:
  print(li[2])
else:
  print(li[0]*li[1])
n = int(input())
     
    num_list = sorted([ int(v) for v in input().split() ],reverse = True)
     
    a_sum, b_sum = 0, 0
     
    for i in range(n):
      if i % 2 == 0:
        a_sum += num_list[i]
      else:
        b_sum += num_list[i]
     
    print(a_sum-b_sum)

### FIXED CODE ###

n = int(input())

num_list = sorted([ int(v) for v in input().split() ])

a_sum, b_sum = 0, 0

for i in range(n):
  if i % 2 == 0:
    a_sum += num_list[i]
  else:
    b_sum += num_list[i]

print(abs(a_sum-b_sum))
import sys
n=int(input())

xyh=[[int(l) for l in k] for k in [j.split() for j in [i.strip() for i in sys.stdin.readlines()]]]

#print(xyh)
ef=0

def hgh(c,p):
    return abs(c[0]-p[0])+abs(c[1]-p[1])+p[2]

#ans=[]

for x in range(101):
    if ef:
        break
    for y in range(101):
        th = 0
        for plc in xyh:
            c=1
            if not th and not plc[2]:
                continue
            h = hgh([x,y],plc)
            if not th:
                th = h
                continue
            if h!=th:
                c=0
                break
        if c:
            ef=1
            ans=[str(s) for s in [x,y,th]]
            break

print(" ".join(ans))



### FIXED CODE ###

import sys
n=int(input())

xyh=[[int(l) for l in k] for k in [j.split() for j in [i.strip() for i in sys.stdin.readlines()]]]
xyh=sorted(xyh, key= lambda x : x[2], reverse=True)
#print(xyh)
ef=0

def hgh(c,p):
    return abs(c[0]-p[0])+abs(c[1]-p[1])+p[2]

#ans=[]

for x in range(101):
    if ef:
        break
    for y in range(101):
        th = -1
        c=1
        for plc in xyh:
            #if not plc[2]:
            #    continue
            h = hgh([x,y],plc)
            #print(x,y,h)
            if th<0:
                th = h
                continue
            if h==th:
                continue
            if  h >= th:
                if not plc[2]:
                    continue
            c=0
            break
        if c:
            ef=1
            ans=[str(s) for s in [x,y,th]]
            break

print(" ".join(ans))
N = int(input())
S = list(map(str, input()))

def next_char(candidate, cor_char_index, ctr):
	# print("next_char")
	# print(candidate, cor_char_index, ctr)
	char = S[cor_char_index]
	satisfy = []
	for i in candidate:
		if cor_char_index < i - ctr + 1 and i + 1 < N and S[i + 1] == char:
			satisfy.append(i + 1)
	if len(satisfy) >= 1:
		return next_char(satisfy, cor_char_index + 1, ctr + 1)
	else:
		return ctr
	
ret = 0
for i in range(N):
	if ret > N - i:
		break
	else:
		tmp = (next_char([j for j in range(i, N)], i, 0))
		ret = max(ret, tmp)
		
print(ret)

### FIXED CODE ###

N = int(input())
S = list(map(str, input()))

dp = [[0 for _ in range(N)] for _ in range(N)]
edge_r = N - 1
edge_d = N - 1
for i in reversed(range(N)):
	for j in reversed(range(N)):
		if i == edge_d or j == edge_r:
			if S[i] == S[j]:
				dp[i][j] = 1
			else:
				dp[i][j] = 0
		else:
			if S[i] == S[j]:
				dp[i][j] = dp[i + 1][j + 1] + 1
ans = 0
for i in range(N):
	for j in range(N):
		if i >= j:
			continue
		# ij間の距離よりもdp[i][j]が大きいならば、それはかぶってる
		tmp = min(dp[i][j], j - i)
		ans = max(tmp, ans)
		
print(ans)
import math
from functools import reduce
n = map(int, input().split())
x = list(map(int, input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(x))

### FIXED CODE ###

import math
n = int(input())
l = [int(i) for i in input().split()]

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) #再帰定義
s = gcd(l[0],l[1])
for i in l:
    s = gcd(s,i)
   

print(s)
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2])))

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))
n=int(input())
h=list(map(int,input().split()))
count=flag=0
for i in range (n-1):
    if(n[i]>=n[i+1]):
          flag+=1
    else:
          if flag>count:
               count=flag
          flag=0
print(count)

### FIXED CODE ###

n = int(input())

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

x = 0
y = 0

for i in range(1, n):
    if(a[i] <= a[i-1]):
        y +=1
    else:
        x = max(x,y)
        y = 0

print(max(x,y))
import heapq

n, m = map(int, input().split())
jobs = [tuple(map(int, input().split())) for _ in range(n)]
jobs.sort()

i = 0
works = []
reward = 0
for d in range(m):
  while i < n and jobs[i][0] <= d + 1:
    heapq.heappush(works, -jobs[i][1])
    i += 1
  if works:
    reward -= heapq.heappop(words)
print(reward)

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
jobs = [tuple(map(int, input().split())) for _ in range(n)]
jobs.sort()

i = 0
works = []
reward = 0
for d in range(m):
  while i < n and jobs[i][0] <= d + 1:
    heapq.heappush(works, -jobs[i][1])
    i += 1
  if works:
    reward -= heapq.heappop(works)
print(reward)
A, B = map(int, input().split())
if A + B < C:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

A, B, C = map(int, input().split())
if A + B < C:
    print("No")
else:
    print("Yes")
a=int(input)
b=int(input)
c=int(input)
print(a*b*c//2)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
print((a+b)*c//2)
from collections import deque

x, y, a, b, c = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P = sorted(P, reverse=True)[:x]

Q = sorted(Q, reverse=True)[:y]

P.extend(Q)
T = deque(sorted(P, reverse=True))
R = deque(sorted(R, reverse=True))

ans = 0
for i in range(x+y):
    if T[0] >= R[0] or len(R) == 0:
        ans += T.popleft()
    else:
        ans += R.popleft()

print(ans)


### FIXED CODE ###

from collections import deque

x, y, a, b, c = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P = sorted(P, reverse=True)[:x]

Q = sorted(Q, reverse=True)[:y]

P.extend(Q)
R.extend(P)

T = sorted(R, reverse=True)[:x+y]
print(sum(T))
def solve():
    H,W,A,B=map(int,input().split())
    data=[[0]*W for i in range(H)]
    if A==B==0:
        return data
    elif A==0:
        if W>=2:
            return [[-1]]
        else:
            for i in range(B):
                data[i][0]=1
            return data
    elif B==0:
        if H>=w:
            return [[-1]]
        else:
            for i in range(A):
                data[0][i]=1
                return data
    elif W%A!=0 or H%B!=0:
        return [[-1]]
    elif W//A!=H//B:
        return[[-1]]
    ci=cj=0
    for k in range(H//A):
        for i in range(ci,ci+A):
            for j in range(cj,cj+B):
                data[i][j]=1
            cj+=B
        ci+=A
    return data

data=solve()
for i in data:
    print(*i)

### FIXED CODE ###

def solve():
    H,W,A,B=map(int,input().split())
    data=[[0]*W for i in range(H)]
    for i in range(B):
        for j in range(A):
            data[i][j]=1
    for i in range(B,H):
        for j in range(A,W):
            data[i][j]=1
    return data

data=solve()
for i in data:
    print(''.join(map(str,i)))
import itertools
import heapq
n,k = map(int,input().split())
a = list(map(int,input().split()))
if n>=2k:
  a_plus = heapq.nlargest(k, a)
  a_minus = heapq.nsmallest(k, a)
  a_new = a_plus+a_minus
  comb = itertools.combinations(a_new,k)
else:
  comb = itertools.combinations(a,k)

l = []
for i in comb:
  l.append(list(i))
  
A = []
one = [1]*len(l)
for i in range(len(l)):
  for j in range(k):
    one[i]*=l[i][j]
    A.append(one[i])
    
l_max = max(one)
waru = 10**9 + 7
 
mod = l_max % waru
print(mod)

### FIXED CODE ###

import sys
 
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mod = pow(10, 9)+7
zero = 0
plus = []
minus = []
for i in range(n):
  if a[i] == 0:
    zero += 1
  elif a[i] > 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
 
P, M = len(plus), len(minus)
plus.sort(reverse=True)
minus.sort()
ans = 1
if n == k:
  for i in range(n):
    ans *= a[i]
    ans %= mod
elif P+M < k:
  ans = 0
elif P == 0:
  if zero and k%2:
    ans = 0
  else:
    if k%2:
      minus.reverse()
    for i in range(k):
      ans *= minus[i]
      ans %= mod
else:
  q = 0
  if k%2:
    ans *= plus[0]
    ans %= mod
    q = 1
  judge = []
  for i in range((len(plus)-q)//2):
    judge.append(plus[2*i+q]*plus[2*i+q+1])
  for i in range(len(minus)//2):
    judge.append(minus[2*i]*minus[2*i+1])
  judge.sort(reverse=True)
  for i in range(k//2):
    ans *= (judge[i]%mod)
    ans %= mod
 
print(ans)
n=int(input())
S=[]
for i in range(n):
    S.append(input())

from collections import defaultdict
d = defaultdict(lambda:0)

for k in S:
    d[str(k)]+=1

dmax=max(d.value())
ansn=dmax
ans=[]
for i in set(S):
    if d[i]==ansn:
        ans.append(i)

ans=sorted(ans)
for i in range(len(ans)):
    print(ans[i])


### FIXED CODE ###

from collections import *
n=int(input())
a=[]
for _ in range(n):
  a.append(input())
aset=set(a)
cnt=Counter(a)
cnt=dict(cnt)
maxi=0
for k in cnt.keys():
  maxi=max(maxi,cnt[k])

anss=[]
for s in aset:
  if cnt[s]==maxi:
    anss.append(s)
anss.sort()
for i in range(len(anss)):
  print(anss[i])
N,M  = map(int, input().split())
A_list = list(map(int, input.split()))

avail = N - sum(A_list)

if avail >= 0: 
  print(avail)
  
else:
  print(-1)

### FIXED CODE ###

N,M  = map(int, input().split())
A_list = list(map(int, input().split()))
 
avail = N - sum(A_list)
 
if avail >= 0: 
  print(avail)
  
else:
  print(-1)
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
p = input() .split()
s = set()
for i in range(1, len(p)):
    s.add(p[i])
print(len(set(s)))

### FIXED CODE ###

s, w = map(int, (input().split()))
if s <= w:
    print("unsafe")
else:
    print("safe")
N = int(input())

position = []
for n in range(N):
    x, y = map(int, input().split())
    position.append((x, y))

dis_dic = {}
for n in range(N):
    for m in range(N):
        if (n != m):
            distance_tuple = (position[n][0] - position[m]
                              [0], position[n][1] - position[m][1])

            if distance_tuple in dis_dic.keys():
                dis_dic[distance_tuple] += 1
            else:
                dis_dic[distance_tuple] = 1

print(N - max(dis_dic.values()))


### FIXED CODE ###

N = int(input())

position = []
for n in range(N):
    x, y = map(int, input().split())
    position.append((x, y))

if (N != 1):
    dis_dic = {}
    for n in range(N):
        for m in range(N):
            if (n != m):
                distance_tuple = (position[n][0] - position[m]
                                  [0], position[n][1] - position[m][1])

                if distance_tuple in dis_dic.keys():
                    dis_dic[distance_tuple] += 1
                else:
                    dis_dic[distance_tuple] = 1

    print(N - max(dis_dic.values()))
else:
    print(1)
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, Q = map(int, input().split())
S = [0] * N
T = [0] * N
X = [0] * N
D = [0] * Q
event = []
working = []
for i in range(N):
	S[i], T[i], X[i] = map(int, input().split())
	event.append((S[i] - X[i], 1, X[i]))
	event.append((T[i] - X[i], -1, X[i]))
	
for i in range(Q):
	D[i] = int(input())
	
event.sort()
j = 0
for i in range(len(event)):		
	while event[i][0] > D[j]:
		if len(working) > 0:
			print(min(working))
		else:
			print(-1)
		j += 1
	
	if event[i][1] == 1:
		working.append(event[i][2])
	else:
		working.remove(event[i][2])

while j < Q:
	print(-1)
	j += 1

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, Q = map(int, input().split())
S, T, X = [0] * N, [0] * N, [0] * N
work = []

for i in range(N):
	S[i], T[i], X[i] = map(int, input().split())
	work.append((X[i], S[i] - X[i], T[i] - X[i]))

D = [int(input()) for _ in range(Q)]

work.sort()
ans = [-1] * Q
skip = [-1] * Q

for i in range(N):
	left = bisect.bisect_left(D, work[i][1])
	right = bisect.bisect_left(D, work[i][2])
	
	while left < right:
		if skip[left] == -1:
			skip[left] = right
			ans[left] = work[i][0]
			left += 1
		else:
			left = skip[left]					
		
for i in ans:
	print(i)
def bubble_sort(A):
    swap_cnt = 0
    for i in range(len(A)):
        for j in range(len(A), i + 1, -1):
            if A[j] < A[j - 1]:
                A[j], A[j - 1] = A[j - 1], A[j]
                swap_cnt += 1
    return A, swap_cnt


n = int(input())
A = list(map(int, input().split()))
A, swap_cnt = bubble_sort(A)
print(' '.join(A))
print(swap_cnt)



### FIXED CODE ###

def bubble_sort(A):
    swap_cnt = 0
    for i in range(len(A)):
        for j in range(len(A) - 1, i, -1):
            if A[j] < A[j - 1]:
                A[j], A[j - 1] = A[j - 1], A[j]
                swap_cnt += 1
    return A, swap_cnt


n = int(input())
A = list(map(int, input().split()))
A, swap_cnt = bubble_sort(A)
print(' '.join(map(str, A)))
print(swap_cnt)
n = input()
a = 9 if n[0]="1" else a = 1
b = 9 if n[1]="1" else b = 1
c = 9 if n[2]="1" else c = 1
print(a*100+b*10+c)

### FIXED CODE ###

N = list(input())
for i in range(len(N)):
  if N[i] == "1":
    print("9", end="")
  else:
    print("1", end="")
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

else:
    print(int((R + 100(10 - N))))


### FIXED CODE ###

l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

elif N < 10:
    print((R + 100 * (10 - N)))
N = int(input())
As = list(map(int, input().split()))
Q = int(input())
 
sumAs = 0
dictAs = [0] * 1E5
for i in range(len(As)):
  sumAs += As[i]
  dictAs[As[i] - 1] = 1


for _ in range(Q):
  b, c = map(int, input().split())
  sumAs += dictAs[b - 1] * (c - b)
  dictAs[c - 1] += dictAs[b - 1]
  dictAs[b - 1] = 0
  print(sumAs)
  

### FIXED CODE ###

N = int(input())
As = list(map(int, input().split()))
Q = int(input())
 
sumAs = 0
dictAs = [0] * 100000
for i in range(len(As)):
  sumAs += As[i]
  dictAs[As[i] - 1] += 1


for _ in range(Q):
  b, c = map(int, input().split())
  sumAs += dictAs[b - 1] * (c - b)
  dictAs[c - 1] += dictAs[b - 1]
  dictAs[b - 1] = 0
  print(sumAs)
from collections import Counter, defaultdict
G = defaultdict(list)
C = Counter()
N = int(input())
ans = {}
o = []
for i in range(N-1):
    a, b = map(int, input().split())
    C[a] += 1
    C[b] += 1
    G[a].append(b)
    G[b].append(a)
    ans[(a, b)] = 0
    o.append((a,b))

a = C.most_common(1)[0][0]
b = C.most_common(1)[0][1]

visited = [False] * (N+1)
def dfs(v, p):
    visited[v] = True
    counter = p
    for c in G[v]:
        if not visited[c]:
            c2,v2 = min(c,v), max(c,v)
            counter += 1
            if counter == N+1:
                counter = 1
            ans[(c2, v2)] = counter
            dfs(c, counter)

dfs(a, 0)

print(b)
for a,b in o:
    print(ans[(a,b)])

### FIXED CODE ###

from collections import Counter, defaultdict
from queue import Queue
G = defaultdict(list)

C = Counter()
N = int(input())
ans = {}
o = []
for i in range(N-1):
    a, b = map(int, input().split())
    C[a] += 1
    C[b] += 1
    G[a].append(b)
    G[b].append(a)
    ans[(a, b)] = 0
    o.append((a,b))

cs = [0] * (N+1)
def bfs(v):
    ret = 0
    visited = set()
    q = Queue()
    visited.add(v)
    q.put(v)
    while not q.empty():
        v = q.get()
        counter = 1
        for c in G[v]:
            if not c in visited:
                visited.add(c)
                if counter == cs[v]:
                    counter += 1
                cs[c] = ans[(c,v)] = ans[(v,c)] = counter
                counter += 1
                q.put(c)

bfs(1)
print(C.most_common(1)[0][1])
for a,b in o:
    print(ans[(a,b)])