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

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

shoku=[]

for i in range(X):
    shoku.append(p[i])

for j in range(Y):
    shoku.append(q[j])

shoku.sort()

r_num=0
for k in range(C):
    if r_num == C:
        break

    if shoku[k] < r[r_num]:
        shoku[k] = r[r_num]
        r_num+=1

print(sum(shoku))


### FIXED CODE ###

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

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

shoku=[]

for i in range(X):
    shoku.append(p[i])

for j in range(Y):
    shoku.append(q[j])

shoku.sort()

r_num=0
for k in range(len(shoku)):
    if r_num == C:
        break

    if shoku[k] < r[r_num]:
        shoku[k] = r[r_num]
        r_num+=1

print(sum(shoku))
import numpy as np
H,N=input().split()
H=int(H)
N=int(N)

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

count=0
for i in range(N):
  count+=A[i]

if count=>H:
  print("yes")
else:
  print("no")

### FIXED CODE ###

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

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

count=0
for i in range(N):
  count+=A[i]

if count>=H:
  print("Yes")
else:
  print("No")
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)
else:
  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)
else:
  print(1)
#shellSort(A, n)
n=int(input())
A=[int(input()) for i in range(n)]
cnt = 0
G=[1]
S=str(G[0])
#if 5<n<13:
t=n//2
#elif n<3000:
  #  t=n//9
#else:
  #  t=n//17
Gt=[4, 9, 20, 46, 103, 233, 525, 1182,2660, 5985, 13467]
i=0
while Gt[i]<t:
    G.insert(0,Gt[i])
  #  print (i)
    S=str(G[0])+" "+S
    i+=1
m=len(G)
print (m)
print(S)
for i in range(m):
    g=G[i]
    for j in range(g,n):
        v = A[j]
        k = j - g
        while k >= 0 and A[k] > v:
              A[k+g] = A[k]
              k = k - g
              cnt+=1
        A[k+g] = v 
print(cnt)
for i in range(n):
    print(A[i])

### FIXED CODE ###

#shellSort(A, n)
n=int(input())
A=[int(input()) for i in range(n)]
cnt = 0
G=[1]
S=str(G[0])
#if 5<n<13:
t=n//5
#elif n<3000:
  #  t=n//9
#else:
  #  t=n//17
#Gt=[4, 9, 20, 46, 103, 233, 525, 1182,2660, 5985, 13467]
f=1.0
while f<t:
    f*=2.2
    f=int(f)
    G.insert(0,f)
  #  print (i)
    S=str(G[0])+" "+S
m=len(G)
print (m)
print(S)
for i in range(m):
    g=G[i]
    for j in range(g,n):
        v = A[j]
        k = j - g
        while k >= 0 and A[k] > v:
              A[k+g] = A[k]
              k = k - g
              cnt+=1
        A[k+g] = v 
print(cnt)
for i in range(n):
    print(A[i])
n = int(input())
slist = [int(input()) for _ in range(n)]
slist = sorted(slist)

max_ = 0
for i in range(n+1):
    if i == 0:
        val = sum(slist)
        if val%10 != 0:
            max_ = val
            break
    else:
        for j in range(n-i):
            tmp = slist.copy()
            for k in range(j, j+i):
                tmp.pop(k)
            if (val > max_) and (val%10 != 0):
                max_ = val
            
print(max_)

### FIXED CODE ###

n = int(input())
slist = [int(input()) for _ in range(n)]
total = sum(slist)

if total % 10 != 0:
    print(total)
    exit()
else:
    nonten = []
    for i in range(n):
        if slist[i] % 10 != 0:
            nonten.append(slist[i])
    if len(nonten) == 0:
        print(0)
    else:
        nonten = sorted(nonten)
        total -= nonten[0]
        print(total)
a,b=map(int,inpput().split())
print(max(a+b,max(a,b)+max(a-1,b-1)))


### FIXED CODE ###

a,b=map(int,input().split())
print(max(a+b,max(a,b)+max(a-1,b-1)))
n = int(input())
travel_plan = list(tuple(map(int, input().split())))
travel_plan = [(0, 0, 0)] + travel_plan
for i in range(n+1):
    t1, x1, y1 = travel_plan[i][0] + travel_plan[i][1] + travel_plan[i][2]
    t2, x2, y2 = travel_plan[i+1][0] + travel_plan[i+1][1] + travel_plan[i+1][2]
    x = abs(x1 - x2)
    y = abs(y1 - y2)
    t = t2 - t1
    if x + y < t or (x + y + t) % 2:
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

n = int(input())
travel_plan = []
for i in range(n):
    travel_plan.append(tuple(map(int, input().split())))
travel_plan = [(0, 0, 0)] + travel_plan

for i in range(n):
    t1 = travel_plan[i][0]
    x1 = travel_plan[i][1]
    y1 = travel_plan[i][2]
    t2 = travel_plan[i+1][0]
    x2 = travel_plan[i+1][1]
    y2 = travel_plan[i+1][2]
    x = abs(x1 - x2)
    y = abs(y1 - y2)
    t = t2 - t1
    if x + y > t or (x + y) % 2 != t % 2:
        print("No")
        exit()
print("Yes")
ss = input().split()
N = int(ss[0])
K = int(ss[1])
Q = int(ss[2])
As = []

SCORE = [0] * N

for i in range(Q):
  SCORE[int(input())-1] += 1
for i in range(N):
  if(SCORE[i]<= Q-K):
    print("No")
  else:
    print("Yes")

### FIXED CODE ###

s = input()

if s == "Sunny":
  print("Cloudy")
if s == "Cloudy":
  print("Rainy")
if s == "Rainy":
  print("Sunny")
import colections
H, W = map(int, input().split())
l = [input() for _ in range(H)]
check = [([0] * (W)) for _ in range(H)]
white = 0
for i in range(H):
    white += l[i].count(".")
q = collections.deque()
check[0][0] = 1
q.append([0, 0])
g = False
while q:
    h, w = q.popleft()
    for i, j in ([0, 1], [0, -1], [1, 0], [-1, 0]):
        new_h = h + i
        new_w = w + j
        if new_w < 0 or new_h < 0 or new_w > W-1 or new_h > H-1 or l[new_h][new_w] == "#":
            continue
        elif check[new_h][new_w] == 0:
            check[new_h][new_w] = check[h][w] + 1
            q.append([new_h, new_w])
print(white - check[H-1][W-1] if check[H-1][W-1] != 0 else -1)

### FIXED CODE ###

import collections
H, W = map(int, input().split())
l = [input() for _ in range(H)]
check = [([0] * (W)) for _ in range(H)]
white = 0
for i in range(H):
    white += l[i].count(".")
q = collections.deque()
check[0][0] = 1
q.append([0, 0])
g = False
while q:
    h, w = q.popleft()
    for i, j in ([0, 1], [0, -1], [1, 0], [-1, 0]):
        new_h = h + i
        new_w = w + j
        if new_w < 0 or new_h < 0 or new_w > W-1 or new_h > H-1 or l[new_h][new_w] == "#":
            continue
        elif check[new_h][new_w] == 0:
            check[new_h][new_w] = check[h][w] + 1
            q.append([new_h, new_w])
print(white - check[H-1][W-1] if check[H-1][W-1] != 0 else -1)
# your code goes here
import copy
N=int(input())
k = copy.copy(N)
 
a=[]
while k != 0:
	a.append(k%10)
	k = k//10
 
if N%sum(a)==0:
	print('Yes')
else:
	print('No'

### FIXED CODE ###

# your code goes here
import copy
N=int(input())
k = copy.copy(N)

a=[]
while k != 0:
	a.append(k%10)
	k = k//10

if N%sum(a)==0:
	print('Yes')
else:
	print('No')
import collections

s = raw_input()
count = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		s[i] = 1- s[i]
		count +=1
print count


### FIXED CODE ###

import collections

s = map(int,list(raw_input()))

count = 0
for i in range(1,len(s)):
	if s[i] == s[i - 1]:
		s[i] = 1 - s[i]
		count += 1
print count
from functools import *
N, X = list(map(int, input().split(" ")))
xs = list(map(int, input().split(" ")))
xs = list(map(lambda x: X-x if X>x else x-X, xs))
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b) 
r = reduce(gcd, d)
print(r)


### FIXED CODE ###

from functools import reduce
import numpy as np

def gcd(a, b):
    if b > 0:
        return gcd(b, a%b)
    else:
        return a

def gcd_list(arg_list):
    return reduce(gcd, arg_list)

N, X = tuple(map(int, input().split(" ")))
Xs = [X] + list(map(int, input().split(" ")))
Xs = map(abs, np.diff(Xs))
r = gcd_list(Xs)
print(r)
a,b=map(int,input().split())
ans=-1
arr = [list(map(int,input().split)) for i in range(b)]

for i in range(1001):
  j=str(i)
  if len(j)==a and all(j[s-1]==str(t) for s,t in arr):
    ans = i
    break
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
ans=-1
arr = [list(map(int,input().split())) for i in range(b)]

for i in range(1001):
  j=str(i)
  if len(j)==a and all(j[s-1]==str(t) for s,t in arr):
    ans = i
    break
print(ans)
import sys

N = int(sys.stdin.readline())


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


sorted_list = [2, 4, 8, 16, 32, 64, N][::1]
min_index = sorted_list[sorted_list.index(N) + 1]

cnt = 0
min_cnt = dev(min_index)
for i in reversed(range(min_index, N + 1, 2)):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        print(i)
        exit()
print(min_index)


### FIXED CODE ###

m = int(input())
a = 1
for c in range(7):
  if (2 ** c) > m:
    break
  a = (2 ** c)
 
print(a)
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    N, M, K = map(int, input().split())
    A = deque(list(map(int, input().split())))
    B = deque(list(map(int, input().split())))

    time = 0
    res = 0
    same_flag = False

    while True:
        if len(A) != 0:
            tmp1 = A[0]
        else:
            tmp1 = 10 ** 10
        
        if len(B) != 0:
            tmp2 = B[0]
        else:
            tmp2 = 10 ** 10
        
        if time + tmp1 > K and time + tmp2 > K:
            break

        if tmp1 == 10 ** 10 and tmp2 == 10 ** 10:
            break
        elif tmp1 < tmp2:
            tmp_time = A.popleft()
            time += tmp_time
            res += 1
        elif tmp1 == tmp2:
            sumA = sum(A[1:])
            sumB = sum(B[1:])

            if same_flag:
                tmp_time = A.popleft()
                time += tmp_time
                res += 1
            elif sumA < sumB:
                tmp_time = A.popleft()
                time += tmp_time
                res += 1
            elif sumA > sumB:
                tmp_time = B.popleft()
                time += tmp_time
                res += 1
            else:
                tmp_time = A.popleft()
                time += tmp_time
                res += 1
                same_flag = True
        else:
            tmp_time = B.popleft()
            time += tmp_time
            res += 1
        
        if time > K:
            time -= tmp_time
            res -= 1
            break
    
    print(res)

if __name__ == '__main__':
    main()

### FIXED CODE ###

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    N, M, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    cumsumA = [0] + list(accumulate(A))
    cumsumB = [0] + list(accumulate(B))

    res = 0

    for i in range(N+1):
        if i == 0:
            for j in range(M, -1, -1):
                if cumsumB[j] <= K:
                    max_j = j
                    res = max(res, i + j)
                    break
        else:
            for j in range(max_j, -1, -1):
                time = cumsumA[i] + cumsumB[j]
                if  time <= K:
                    max_j = j
                    res = max(res, i + j)
                    break
    
    print(res)

if __name__ == '__main__':
    main()
def isOver(a,b):
    return True if (a[0]-b[0])**2 + (a[1]-b[1])**2 <= 4.0 else False
 
def largestGroup(mtrx,num):
    mx = 1
    ls = [num]
    for i in mtrx[num]:
       	m = youKnow(mtrx,ls,i)
        mx = max(mx,m)
    return mx
 
def youKnow(mtrx,ls,num):
	mx = len(ls)
	if set(ls) <= set(mtrx[num]):
		ls.append(num)
		for i in list(set(mtrx[num])-set(ls)):
			m = youKnow(mtrx,ls,i)
			mx = max(mx,m)
	return mx
 
while True:
    max_over = 0
    n = int(raw_input())
    if n == 0: break
    seals = [map(float, raw_input().split(",")) for i in range(n)]
 
    overs = []
    for i in range(n):
        over = []
        for j in range(n):
            if isOver(seals[i],seals[j]) and i != j:
                over.append(j)
        overs.append(over)
         
    ref = [i for i in range(n)]
    for i in ref:
		if len(overs[i]) > 0:
       		num_over = largestGroup(overs,i)
       	for j in overs[i]:
           if j in ref: ref.remove(j)
       	if num_over > max_over:
           max_over = num_over
    print max_over

### FIXED CODE ###

def isOver(array,x,y):
	return True if (array[0]-x)**2+(array[1]-y)**2 <= 1.01 else False
	
while True:
    mx = 0
    n = int(raw_input())
    if n == 0: break
    seals = [map(float, raw_input().split(",")) for i in range(n)]
    x = 0
    while x < 10.0:
    	y = 0.0
    	while y < 10.0:
    		num = 0
    		for seal in seals:
    			if isOver(seal,x,y):
    				num += 1
    		mx = max(mx,num)
    		y += 0.1
        x += 0.1
    print mx
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

import collections
import itertools
import operator

class UnionFind:
  def __init__(self, elems=None):
    class KeyDict(dict):
      def __missing__(self, key):
        self[key] = key
        return key

    self.parent = KeyDict()
    self.rank = collections.defaultdict(int)
    self.size_ = collections.defaultdict(lambda: 1)

    if elems is not None:
      for elem in elems:
        _, _, _ = self.parent[elem], self.rank[elem], self.size_[elem]

  def find(self, x):
    if self.parent[x] == x:
      return x
    else:
      self.parent[x] = self.find(self.parent[x])
      return self.parent[x]

  def unite(self, x, y):
    x = self.find(x)
    y = self.find(y)
    if x == y:
      return
    if self.rank[x] < self.rank[y]:
      self.parent[x] = y
      self.size_[y] += self.size_[x]
    else:
      self.parent[y] = x
      self.size_[x] += self.size_[y]
    if self.rank[x] == self.rank[y]:
      self.rank[x] += 1

  def are_same(self, x, y):
    return self.find(x) == self.find(y)

  def grouper(self):
    roots = [(x, self.find(x_par)) for x, x_par in self.parent.items()]
    root = operator.itemgetter(1)
    for _, group in itertools.groupby(sorted(roots, key=root), root):
      yield [x for x, _ in group]

  def size(self,x):
    return self.size_[self.find(x)]


n,m = na()
g = UnionFind()
ans = 0

for i in range(m):
    a,b = na()
    g.unite(a,b)

a = [len(i) for i in list(g.grouper())]

print(max(a))

### FIXED CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

N = 3*10**5

*p, = range(N)
size = [1]*N
def root(x):
    if x == p[x]:
        return x
    p[x] = y = root(p[x])
    return y
def unite(x, y):
    px = root(x); py = root(y)
    if px == py:
        return 0
    sx = size[px]; sy = size[py]
    if sy < sx:
        p[py] = px
        size[px] += sy
    else:
        p[px] = py
        size[py] += sx
    return 1

n,m = na()
ans = 0

for i in range(m):
    a,b = na()
    unite(a,b)

print(max(size))
w = input()
alp = 'abcdefghijklmnopqrstuvwxyz'
c = []
for i in range(26):
    a = w.count(alp[i])
    c.append(a)
d = 0
for i in range(len(w)):
    if int(c[i]) % 2 == 0:
        d = 1
    else:
        break
if d == 0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

w = input()
alp = 'abcdefghijklmnopqrstuvwxyz'
c = []
for i in range(26):
    a = w.count(alp[i])
    c.append(a)
d = 0
for i in range(26):
    if c[i] % 2 == 0:
        d = 1
    else:
        d = 0
        break
if d == 0:
    print('No')
else:
    print('Yes')
import numpy as np

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

an = np.array(A, dtype=np.int64)

for i in range(1,N):
   for j in range(i+1,N):
      if(an[0] == an[i]^an[j]):
         tmp = an[1]
         an[1] = an[i]
         an[i] = tmp

         tmp = an[2]
         an[2] = an[j]
         an[j] = tmp

         doo = 1
         break
      else:
         doo = 0

if(doo == 0):
   print('No')
   break

for i in range(2,N):
   for j in range(i+1,N):
      if(an[i-1] == an[i]^an[j]):
         tmp = an[i+1]
         an[i+1] = an[j]
         an[j] = tmp
         doo=1
         break
      else:
         doo=0

   if(doo==0):
      print('No')
      break


if(an[0] == an[1]^an[N-1]):
   doo=1
else:
   doo=0

if(doo==1):
   print('Yes')


### FIXED CODE ###

import numpy as np
import sys

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

an = np.array(A, dtype=np.int64)

chk = 0
for i in range(0,N):
   chk = chk ^ an[i] 

if(chk == 0):
   print('Yes')
else:
   print('No')
#16D8101023J 久保田凌弥 kubotarouxxx python3


stak = []
for i in input().split():
    if i in "+-*":
       a = stak.pop()
       b = stak.pop()
        stak.append(str(eval(b + i + a)))
    else:
        stak.append(i)
print(stak.pop())


### FIXED CODE ###

stak = []
for i in input().split():
    if i in "+-*":
        x = stak.pop()
        y = stak.pop()
        stak.append(str(eval(y + i + x)))
    else:
        stak.append(i)
print(stak.pop())
import math

n=input()
a=[int(i) for i in input().split()]
ac=a[:]


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

while(len(ac)>1):
    x=ac.pop()
    y=ac.pop()
    ac.append(lcm(x, y))

g=ac[0]-1

ans=0
for i in a:
    ans+=g%i

print(ans)


### FIXED CODE ###

n=input()
a=[int(i) for i in input().split()]
ac=a[:]


def lcm(x, y):
    x2=x
    y2=y
    while y != 0:
        x, y = y, x%y
    return (x2 * y2) // x

while(len(ac)>1):
    x=ac.pop()
    y=ac.pop()
    ac.append(lcm(x, y))

g=ac[0]-1

ans=0
for i in a:
    ans+=g%i

print(ans)
N, M = map(int, input().split())
cond = [list(map(int, input().split())) for _ in range(M)]
flag = True
ans = [-1]*N

if M == 0:
    if N == 1:
        print(0)
    else:
        print('1'+'0'*(N-1))
else:
    for i in cond:
    digit = i[0]-1
    if digit > N-1:
        flag = False
        break
    elif ans[digit] != -1 and ans[digit] != i[1]:
        flag = False
        break
    elif i == [1, 0] and N > 1:
        flag = False
        break
    else:
        ans[digit] = i[1]

    if flag:
        if ans[0] == -1:
            ans[0] = 1
        
        for i in range(1, N):
            if ans[i] == -1:
                ans[i] = 0
        
        print(''.join(map(str, ans)))
    else:
        print(-1)

### FIXED CODE ###

N, M = map(int, input().split())
cond = [list(map(int, input().split())) for _ in range(M)]
flag = True
ans = [-1]*N

if M == 0:
    if N == 1:
        print(0)
    else:
        print('1'+'0'*(N-1))
else:
    for i in cond:
        digit = i[0]-1
        if digit > N-1:
            flag = False
            break
        elif ans[digit] != -1 and ans[digit] != i[1]:
            flag = False
            break
        elif i == [1, 0] and N > 1:
            flag = False
            break
        else:
            ans[digit] = i[1]

    if flag:
        if ans[0] == -1:
            ans[0] = 1
        
        for i in range(1, N):
            if ans[i] == -1:
                ans[i] = 0
        
        print(''.join(map(str, ans)))
    else:
        print(-1)
# Counting Characters
import sys

charList = list('abcdefghijklmnopqrstuvwxyz')
lines = sys.stdin.readlines()
totalSentence = []
for s in range(lines):
    sentence = list(input().rstrip().lower())
    # print(sentence)
    for c in range(sentence):
        totalSentence.append(c)

for char in charList:
    count = 0
    for i in range(len(totalSentence)):
        if totalSentence[i] == char:
            count += 1
    print(char + ' : ' + str(count))



### FIXED CODE ###

# Counting Characters
import sys

charList = list('abcdefghijklmnopqrstuvwxyz')
lines = sys.stdin.readlines()
combinedLine = ""
for line in lines:
    line = line.strip("\n").lower()
    combinedLine += line
totalSentence = list(combinedLine)
# print(totalSentence)

for char in charList:
    count = 0
    for i in range(len(totalSentence)):
        if totalSentence[i] == char:
            count += 1
    print(char + ' : ' + str(count))
def solve():
    def dfs(start):
        unvisited = [True] * (n + 1)
        queue = [(start, 1)]
        max_chain_len = 1
        while queue:
            ring, chain_len = queue.pop()
            if unvisited[ring]:
                unvisited[ring] = False
                max_chain_len = max(max_chain_len, chain_len)
                for r in adj_list[ring]:
                    if unvisited[r]:
                        queue.append((r, chain_len + 1))
        return max_chain_len
    
    import sys
    file_input = sys.stdin
    
    while True:
        n = int(file_input.readline())
        if n == 0:
            break
        
        adj_list = [[] for _ in range(n + 1)]
        for _ in range(n):
            a, b = map(int, file_input.readline().split())
            adj_list[a].append(b)
            adj_list[b].append(a)
        
        max_len = 0
        for s in range(1, n + 1):
            max_len = max(max_len, dfs(s))
        
        print(max_len)

solve()


### FIXED CODE ###

def solve():
    def dfs(ring, chain_len=1):
        unchecked[ring] = False
        unvisited[ring] = False
        len_rec[ring] = max(len_rec[ring], chain_len)
        for r in adj_list[ring]:
            if unvisited[r]:
                dfs(r, chain_len + 1)
        unvisited[ring] = True
    
    import sys
    file_input = sys.stdin
    
    while True:
        n = int(file_input.readline())
        if n == 0:
            break
        
        rings = []
        adj_list = [[] for _ in range(101)]
        for _ in range(n):
            a, b = map(int, file_input.readline().split())
            adj_list[a].append(b)
            adj_list[b].append(a)
            rings.extend([a, b])
        rings = set(rings)
        
        len_rec = [1] * 101
        unchecked = [True] * 101
        unvisited = [True] * 101
        
        for r in rings:
            if unchecked[r]:
                dfs(r)
        dfs(len_rec.index(max(len_rec)))
        
        print(max(len_rec))

solve()
import sys
n = list(map(int, sys.stdin.readline()))
s = sum(i if i <= 5 else 10 - i for i in n)


### FIXED CODE ###

n = list(map(int, input()[::-1])) + [0]
s = 0
res = 0
for i, ni in enumerate(n[:-1]):
    k = ni + s
    if k < 5 or (k == 5 and int(n[i + 1]) < 5):
        res += k
        s = 0
    else:
        res += 10 - k
        s = 1
res += s
print(res)
while True:
    try:
        line = input()
    except EOFError:
        break
    print(len(filter(lambda c: c in '123456789', line)))

### FIXED CODE ###

while True:
    try:
        line = input()
    except EOFError:
        break
    s = sum(map(int, line.split()))
    num = 0
    for c in str(s):
        if c.isdigit():
            num += 1
    print(num)
t  =int(input())
h =int(input())
a=13-t
if h>t:
	a=a-1
print(a)

### FIXED CODE ###

t,h=map(int,input().split())
a=t
if t>h:
	a=a-1
print(a)
N = int(input())
B = [int(i) for i in input().split()]
S = [0]*N
cnt = 0
for i in range(N-1, -1, -1):
  A = S[i::i+1]
  if sum(A)%2 == B[i]:
    continue
  elif sum(A)%2 == 0 and B[i] == 1:
    S[i] += 1
    cnt += 1
  elif sum(A)%2 == 1 and B[i] == 0:
    S[i] += 1
    cnt += 1
print(cnt)
for i in range(N):
  if S[i] == 1:
    print(i+1, end=" ")

### FIXED CODE ###

a = int(input())
print(3*a**2)
import math
A,B,N = map(int,input().split())

if B > N:
  ans = math.floor(A * N / B) - A * math.floor(N // B)
else:
  ans = math.floor(A * (B - 1) / B) - A * math.floor(N // (B - 1))
  
print(ans)

### FIXED CODE ###

import math
A,B,N = map(int,input().split())

if B > N:
  ans = math.floor(A * N / B)
else:
  ans = math.floor(A * (B - 1) / B)
  
print(ans)
N = int(input())
A = list(map(int, input()))

print(max(A) - min(A))

### FIXED CODE ###

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

print(max(A) - min(A))