Harryxun/stf_run huggingface dataset:
n = int(input())
x = input()

def popcount(ni):
    n_b = str(bin(ni))
    return n_b.count("1")

def ans(n,x):
    x_i = int(x, 2)
    x_orig = popcount(x_i)
    x_i_t = x_i % (x_orig+1)
    x_i_b = x_i % (x_orig-1)
    solve = 0
    n_i = 2**(n-1)
    for i in range(n):
        x_count = x_orig
        if x[i] == "0":
            x_count += 1
            solve = x_i_t + (n_i % x_count)
        else:
            x_count -= 1
            solve = x_i_b - (n_i % x_count) 
        n_i = n_i >> 1 
        count = 0

        if solve != 0 :
            solve = solve % x_count
            count+=1

        while solve > 0:
            solve = solve % popcount(solve)
            count+=1

        print(count)

    
ans(n,x)


### FIXED CODE ###


n = int(input())
x = input()

def popcount(ni):
    n_b = str(bin(ni))
    return n_b.count("1")

def ans(n,x):
    x_i = int(x, 2)
    x_orig = popcount(x_i)
    x_i_t = x_i % (x_orig+1)
    if x_orig != 1:
        x_i_b = x_i % (x_orig-1)
    else:
        x_i_b = x_i
    solve = 0
    for i in range(n):
        x_count = x_orig
        if x[i] == "0":
            x_count += 1
            solve = x_i_t + pow(2,n-1-i,x_count)
        else:
            x_count -= 1
            if x_count != 0:
                solve = x_i_b - pow(2,n-1-i,x_count)
            else:
                print(0)
                continue
        count = 0

        if x_count != 0 :
            solve = solve % x_count
            count+=1

        while solve > 0:
            solve = solve % popcount(solve)
            count+=1

        print(count)

    
ans(n,x)
s = input()
n = len(s)
a = s[:(n-1)//2-1]
b = s[-(n+3)//2:]

t = s[::-1]
c = t[:(n-1)//2-1]
d = t[-(n+3)//2:]
if (a==d) and (b==c) :
  if(a==b):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

s = input()
n = len(s)
a = s[:(n-1)//2]
b = s[(n+3)//2-1:]

t = s[::-1]
c = t[:(n-1)//2]
d = t[(n+3)//2-1:]
if (a==b) and (b==c) and (c==d) and (d==a):
  print('Yes')
else:
  print('No')
a,b = map(int,input().split())
if a=>b:
  print(a)
else:
  print(a-1)

### FIXED CODE ###

a,b = map(int,input().split())
if a>b:
  print(a-1)
else:
  print(a)
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
for i in res_dict.keys():
  if res_dict[i] == max(res_dict.values()):
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

### FIXED CODE ###

N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)
import math as m
import sys
a,b=map(int,input().split())
c=0
if a+b<0:
  for i in range(a-1):
    c+=m.sqrt(b)
    b+=1
  print(c)
  sys.exit()
else:
  for i in range(a-1):
    c+=(b+1)
    b+=1
  print(c)
  

### FIXED CODE ###

n,l=map(int,input().split())
ans=[]
sum=0
for i in range(n):
    ans.append([abs(l+i),l+i])
    sum+=l+i
ans.sort()
print(sum-ans[0][1])
import sys
def main():
    input=sys.stdin.readline
    N,K=map(int,input().split())
    D=list(map(int,input().split()))
    L=[]
    for i in range(10):
        if i not in D:
            L.append(i)
    for p in L:
        if len(str(N))==1:
            if p>=N:
                print(p)
                return
        else:
            for q in L:
                if len(str(N))==2:
                    pay=p*10+q
                    if pay>=N:
                        print(pay)
                        return
                else:
                    for r in L:
                        if len(str(N))==3:
                            pay=p*100+q*10+r
                            if pay>=N:
                                print(pay)
                                return
                        else:
                            for s in L:
                                pay=p*1000+q*100+r*10+s
                                if pay>=N:
                                    print(pay)
                                    return
    if L[0]==0:
        print(L[1]*10**len(str(N)))
    else:
        print("".join([L[0] for _ in range(len(str(N)))]))
    return
            

if __name__=="__main__":
    main()

### FIXED CODE ###

import sys
def main():
    input=sys.stdin.readline
    N,K=map(int,input().split())
    D=list(map(int,input().split()))
    L=[]
    for i in range(10):
        if i not in D:
            L.append(i)
    for p in L:
        if len(str(N))==1:
            if p>=N:
                print(p)
                return
        else:
            for q in L:
                if len(str(N))==2:
                    pay=p*10+q
                    if pay>=N:
                        print(pay)
                        return
                else:
                    for r in L:
                        if len(str(N))==3:
                            pay=p*100+q*10+r
                            if pay>=N:
                                print(pay)
                                return
                        else:
                            for s in L:
                                pay=p*1000+q*100+r*10+s
                                if pay>=N:
                                    print(pay)
                                    return
    if L[0]==0:
        print(L[1]*10**len(str(N)))
    else:
        print("".join([str(L[0]) for _ in range(1+len(str(N)))]))
    return
            

if __name__=="__main__":
    main()
list = int(map(int, input().split()))
uplist = sorted(list)

print(" ".join(map(str,uplist))


### FIXED CODE ###

list = input().split()
uplist = sorted(list)

print(" ".join(map(str,uplist)))
X = int(raw_input())
if X==3 or X==5 or X==7:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

X = int(input())
if X==3 or X==5 or X==7:
    print("YES")
else:
    print("NO")
from itertools import accumulate
def acc(X): return list(accumulate(X))

N, M = map(int, input().split())
A = [int(a)-1 for a in input().split()]

X = [0] * M # 1,1,1,...
Y = [0] * M # 1,2,3,...

def tri(l, r, a = 1):
    if l < M:
        Y[l] += a
    if r + 1 < M:
        Y[r+1] -= a
        X[r+1] -= (r-l+1) * a

def box(l, r, a = 1):
    if l < M:
        X[l] += a
    if r + 1< M:
        X[r+1] -= a
    
def calc(a, b):
    if a <= b - 2:
        tri(a+2, b)
    elif a > b and a <= b + M - 2:
        tri(a+1, M-1)
        tri(0, b)
        box(0, b, b-a-1)

ans = 0
for i in range(1, N):
    ans += (A[i] - A[i-1]) % M
    calc(A[i-1], A[i])

Y = acc(Y)
X = [X[i] + Y[i] for i in range(N)]
X = acc(X)

ans -= max(X)
print(ans)

### FIXED CODE ###

from itertools import accumulate
def acc(X): return list(accumulate(X))

N, M = map(int, input().split())
A = [int(a)-1 for a in input().split()]

X = [0] * M # 1,1,1,...
Y = [0] * M # 1,2,3,...

def tri(l, r, a = 1):
    if l < M:
        Y[l] += a
    if r + 1 < M:
        Y[r+1] -= a
        X[r+1] -= (r-l+1) * a

def box(l, r, a = 1):
    if l < M:
        X[l] += a
    if r + 1< M:
        X[r+1] -= a
    
def calc(a, b):
    if a <= b - 2:
        tri(a+2, b)
    elif a > b and a <= b + M - 2:
        tri(a+2, M-1)
        tri(0, b)
        box(0, b, -a+M-2)
        
    # print(a, b, X, Y, rev())

def rev():
    ret = acc(Y)
    ret = [X[i] + ret[i] for i in range(M)]
    return acc(ret)
    
ans = 0
for i in range(1, N):
    ans += (A[i] - A[i-1]) % M
    calc(A[i-1], A[i])

X = rev()
# print(X)
ans -= max(X)
print(ans)
x, k, d = map(int, input().split())
if k%2 == 0 and abs(x)==abs(d):
  print(abs(x))
  exit()

for i in range(k):
  if abs(x - d) <= abs(x + d):
      x = x - d
  else:
      x = x + d
  
print(abs(x))

### FIXED CODE ###

s = input()
iter = 0
if s[0] =="R"and s[1]=="R" and s[2]=="R":
  print(3)
elif s[0] =="R"and s[1]=="R":
  print(2)
elif s[1]=="R" and s[2]=="R":
  print(2)
elif s[0] =="R"or s[1]=="R" or s[2]=="R":
  print(1)
elif s[0] =="R"and s[2]=="R":
  print(1)
else:
  print(0)
N = int(input())
S=[0]*N
P=[0]*N 
for i in range(N):
    S[i], P[i] = input().split()
    P[i] = int(P[i])

S_mid = sorted(S, key=lambda idx: P[idx] )
fin = sorted(range(N), key=lambda idx: S_mid[idx])
for i in fin:
    print (i)

### FIXED CODE ###

A, P = map(int, input().split())
P += A*3
pi = int(P/2)
print (pi)
l = int(input())
if l[0] < l[1] and l[1] < l[2]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

inp=input().split()
if inp[0] < inp[1] and inp[1] < inp[2]:
    print("Yes")
else:
    print("No")
a = input().split()
for i in range(4):
  if a[i] = 0:
    print(i)

### FIXED CODE ###

a = list(map(int, input().split()))
n = 0
for i in range(5):
  if a[n] == 0:
    print(n+1)
    break
  else:
    n += 1
N, *A = map(int, open(0).read().split())

A_MAX = max(abs(A[0]), abs(A[-1]))
A.remove(A_MAX)
X = sorted(A)
x = X[0]
ans = []
for v in X[1:]:
    ans.append((x, v))
    x -= v

if x <= 0:
    print(A_MAX - x)
    ans.append((A_MAX, x))
else:
    print(x - A_MAX)
    ans.append((x, A_MAX))
for i in range(N - 1):
    print(*ans[i])

### FIXED CODE ###

N, *A = map(int, open(0).read().split())

x = sorted([v for v in A if v >= 0])
y = sorted([v for v in A if v < 0], reverse=True)

ans = []
if len(y) == 0:
    cnt = x[0]
    for v in x[1:-1]:
        ans.append((cnt, v))
        cnt -= v
    ans.append((x[-1], cnt))
    print(x[-1] - cnt)
elif len(x) == 0:
    cnt = y[0]
    for v in y[1:]:
        ans.append((cnt, v))
        cnt -= v
    print(cnt)
else:
    for v in x[:-1]:
        ans.append((y[0], v))
        y[0] -= v
        
    cnt = x[-1]
    for v in y:
        ans.append((cnt, v))
        cnt -= v
    print(cnt)
    
for v in ans:
    print(*v)
def resolve():
    a, b, = int(input())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    a, b = map(int, input().split())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()
a,b=map(int,input())
if a==3:
  print(3-b)
elif b==3:
  print(3-a)
else:
  print(a+b)    
  

### FIXED CODE ###

a=int(input())
b=int(input())
if a==3:
  print(3-b)
elif b==3:
  print(3-a)
else:
  print(3)
print(int(input() ** 2)


### FIXED CODE ###

print(int(input())**2)
from functools import lru_cache


N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

mod = 10 ** 9 + 7

i = 0
b = []
for ai in a:
    b.append(ai - i)
    i = ai + 1
b.append(N + 1 - i)


@lru_cache(maxsize=None)
def f(n):
    if n < 2:
        return n
    else:
        return f(n - 2) + f(n - 1)


ans = 1
for bi in b:
    ans *= f(bi) % mod
print(ans % mod)


### FIXED CODE ###

import sys
from functools import lru_cache

sys.setrecursionlimit(1000000)

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

mod = 10**9 + 7

i = 0
b = []
for ai in a:
    b.append(ai - i)
    i = ai + 1
b.append(N + 1 - i)


@lru_cache(maxsize=None)
def f(n):
    if n < 2:
        return n
    else:
        return f(n - 2) + f(n - 1)


ans = 1
for bi in b:
    ans *= f(bi) % mod
print(ans % mod)
N = int(input())
S = input()

ans = 0
i = 0
while i < N:
    if S[i] == "A":
        i += 1
        if S[i] == "B":
            i += 1
            if S[i] == "C":
                ans += 1
            else:
                i += 1
        else:
            i += 1
    else:
        i += 1

print(ans)


### FIXED CODE ###

N = int(input())
S = input()

ans = 0
for i in range(N):
    if S[i : i + 3] == "ABC":
        ans += 1

print(ans)
s = str(input())
a = []
b = ["A", "T", "G", "C"]
c = ""
for s_ in s:
    
    if s_ in b:
        c = c + s_
    else:
        a.append(c)
        c = ""
aa = [len(i) for i in a]
print(max(aa))

### FIXED CODE ###

s = str(input())
a = 0
b = ["A", "T", "G", "C"]
c = 0
for s_ in s:    
    if s_ in b:
        c += 1
    else:
        a = max(c, a)
        c = 0
a = max(c,a)        
print(a)
#!/usr/bin/env python3

import functools

def cmp1(p0, p1):
    (_, t0, a0), (_, t1, a1) = p0, p1
    return (t1 - a0) - (t0 - a1)

def cmp2(p0, p1):
    (_, t0, a0), (_, t1, a1) = p0, p1
    return (a1 - t0) - (a0 - t1)

n = int(input())
AB = [tuple((i, *(int(x) for x in input().split()))) for i in range(n)]

A = sorted(AB, key=functools.cmp_to_key(cmp1))
B = sorted(AB, key=functools.cmp_to_key(cmp2))
used = {-1}
a, b = -1, -1
ans = 0

for _ in range(n // 2):
    while a in used:
        a, s, _ = A.pop(0)
    used.add(a)
    ans += s

    while b in used:
        b, _, s = B.pop(0)
    used.add(b)
    ans -= s

if n % 2 == 1:
    while a in used:
        a, s, _ = A.pop(0)
    used.add(a)
    ans += s

print(ans)


### FIXED CODE ###

#!/usr/bin/env python3

n = int(input())
A = [tuple(int(x) for x in input().split()) for i in range(n)]
A.sort(key=lambda ab: -(ab[0] + ab[1]))
print(sum(a for a, _ in A[::2]) - sum(b for _, b in A[1::2]))
N, R = map(int, input().split())
q = N/K
num = 0
while q >0:
  q = q / K**num
  num = num + 1
print(num)

### FIXED CODE ###

N, K = map(int, input().split())
num = 0
q = N
while q > 0:
	num = num + 1
	q = N // (K**num)
print(num)
a,b,c = input()

if a<b<c:
  print 'yes'
else:
  print 'no'

### FIXED CODE ###

a,b,c = map(int,raw_input().split())

if a<b and b<c:
  print 'Yes'
else:
  print 'No'
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
a.pop(0)
b.pop(0)

ans = 0
j = m-1
for i in range(n):
    if a[i] > k:
        break
    else:
        while a[i]+b[j] > k:
            j -= 1
        ans = max(ans, i+j+2)
print(ans)

### FIXED CODE ###

from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])

ans = 0
j = m
for i in range(n+1):
    if a[i] > k:
        break
    else:
        while a[i]+b[j] > k:
            j -= 1
        ans = max(ans, i+j)
print(ans)
import numpy as np

N, K, Q = [int(value) for value in input().split(' ')]
A = [int(input()) for _ in range(Q)]

points = np.full(N, K)

for i in range(Q):
    points = points - 1
    points[A[i] - 1] += 1

for point in points:
    if point > 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, K, Q = [int(value) for value in input().split(' ')]
A = [int(input()) for _ in range(Q)]

points = [K - Q] * N

for value in A:
    points[value - 1] += 1

for point in points:
    if point <= 0:
        print('No')
    else:
        print('Yes')
import bisect
import math
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
m=0
for i in range(1,n):
  b=bisect.bisect_left(a[:i],a[i]/2)

  r=math.factorial(a[i])/(math.factorial(a[b])*math.factorial(a[i]-a[b]))
  if b-1>=0:
    l=math.factorial(a[i])/(math.factorial(a[b-1])*math.factorial(a[i]-a[b-1]))
  else:
    l=0
  if max(r,l)>m:
    m=max(r,l)
    ans1=a[i]
    if r>l:
      ans2=a[b]
    else:
      ans2=a[b-1]
print(ans1,ans2)


### FIXED CODE ###

n=int(input())
a=[int(i) for i in input().split()]
m=max(a)
m2 = m / 2

f = m
ans = -m
for i in a:
  if i != m and abs(m2 - i) <=f:
    f = abs(m2 - i)
    ans = i
print(m,ans)
import numba

@numba.jit
def main():
    n, s = list(map(int, input().split()))
    a = list(map(int, input().split()))
    dp = [[None] * (s+1) for _ in range(n+1)]
    M = 998244353


    for j in range(s+1):
        dp[0][j] = 0
    for i in range(n+1):
        dp[i][0] = i+1

    for i in range(1,n+1):
        for j in range(1, s+1):
            dp[i][j] = dp[i-1][j]
            if j-a[i-1]>=0:
                dp[i][j] += dp[i-1][j-a[i-1]]
            dp[i][j] %= M
    total = 0
    for i in range(n+1):
        total += dp[i][s]
    return total%M
if __name__=="__main__":
    print(main())

### FIXED CODE ###



n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [[None] * (s+1) for _ in range(n+1)]
M = 998244353


for j in range(s+1):
    dp[0][j] = 0
for i in range(n+1):
    dp[i][0] = i+1

for i in range(1,n+1):
    for j in range(1, s+1):
        dp[i][j] = dp[i-1][j]
        if j-a[i-1]>=0:
            dp[i][j] += dp[i-1][j-a[i-1]]
        dp[i][j] %= M
print(sum((dp[i][s] for i in range(n+1)))%M)
s=input()
c=s.count("9")
if c==len(s):
    print(c*9)
else:
    print((c-1)*9+int(s[0]-1))


### FIXED CODE ###

s=input()
c=s.count("9")
if c==len(s):
    print(c*9)
elif len(s)==1:
    print(s)
elif s[1:].count("9")==len(s)-1:
    print(s[1:].count("9")*9+int(s[0]))
else:
    print((len(s)-1)*9+int(s[0])-1)
import string
s = input()
d = {i:0 for i in string.ascii_uppercase}
for i in s:
  d[i] += 1

def solve():
	for i in d.values():
	  if i not in [0, 2]:
	    print("No")
        return
    print("Yes")

solve()


### FIXED CODE ###

import string
s = input()
d = {i:0 for i in string.ascii_uppercase}
for i in s:
  d[i] += 1

def solve():
  for i in d.values():
    if i not in [0, 2]:
      print("No")
      return
  print("Yes")

solve()
a=[]
N,L=map(int,input().split())
for _ in range (N):
    a.append(str(input()))
    a=sorted(a)
print(*a,sep='')

### FIXED CODE ###

a=list(sorted(map(int,input().split()))[::-1])
if a[0]==7 and a[1]==5 and a[2]==5 :
    print("YES")
else:
    print("NO")
N = int(input())
src = list(map(int,input().split()))
odd = two = four = 0
for a in src:
    if a%2: odd += 1
    elif a%4==0: four += 1
    else: two += 1
if two:
    print('Yes' if odd <= four else 'No)
else:
    print('Yes' if odd <= four+1 else 'No')

### FIXED CODE ###

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

x1 = x2 = x4 = 0
for a in src:
    if a%2 == 1:
        x1 += 1
    elif a%4 == 0:
        x4 += 1
    else:
        x2 += 1

def solve():
    if x4 >= x1: return True
    if x4 + 1 == x1:
        return x2 == 0
    else: return False

print('Yes' if solve() else 'No')
import math
from decimal import Decimal

N = int(input())
T, A = [int(x) for x in input().split()]

for i in range(1,N):
        T2, A2 = [int(x) for x in input().split()]
        n = max(math.ceil(Decimal(T)/Decimal(T2)),math.ceil(Decimal(A)/Decimal(A2))
        T = T2*n
        A = A2*n

print(T + A)

### FIXED CODE ###

import math
from decimal import Decimal

N = int(input())
T, A = [Decimal(x) for x in input().split()]

for i in range(1,N):
        T2, A2 = [Decimal(x) for x in input().split()]
        n = Decimal(max(math.ceil(T/T2),math.ceil(A/A2)))
        T = T2 * n
        A = A2 * n

print(T+A)
length = int(input())
eles = [int(l) for l in input().split()]
is_stable = 'Stable'

import copy
_copy = copy.deepcopy(eles)

for i in range(length):
    for j in range(length-1, 0, -1):
        if _copy[j][1] < _copy[j-1][1]:
            _copy[j], _copy[j-1] = _copy[j-1], _copy[j]

print(*_copy)
print(is_stable)

__copy = copy.deepcopy(eles)

for i in range(length-1):
    _min = i
    for l in range(i, length):
        if __copy[l][1] < __copy[_min][1]:
            _min = l
            is_stable = 'Not Stable'
    __copy[i], __copy[_min] = __copy[_min], __copy[i]

print(*__copy)
print(is_stable)

### FIXED CODE ###

length = int(input())
eles = [l for l in input().split()]
is_stable = 'Stable'

_copy = eles[::]

for i in range(length):
    for j in range(length-1, 0, -1):
        if _copy[j][1] < _copy[j-1][1]:
            _copy[j], _copy[j-1] = _copy[j-1], _copy[j]

print(*_copy)
print(is_stable)

__copy = eles[::]
for i in range(length-1):
    _min = i
    for l in range(i, length):
        if __copy[l][1] < __copy[_min][1]:
            _min = l
    if __copy[i][1] > __copy[_min][1]:
        __copy[i], __copy[_min] = __copy[_min], __copy[i]

print(*__copy)

for i in range(length -1):
    if _copy[i] != __copy[i]:
        is_stable = 'Not stable'

print(is_stable)
import sys
sys.setrecursionlimit(10**5)

n,m,k = map(int, input().split())

F = [[] for _ in range(n+1)]
B = [[] for _ in range(n+1)]

for _ in range(m):
    x,y = map(int, input().split())
    F[x].append(y)
    F[y].append(x)

for _ in range(k):
    x,y = map(int, input().split())
    B[x].append(y)
    B[y].append(x)

belongs = [-1 for _ in range(n+1)]

def f_search(root, group_ID):
    for j in F[root]:
        if belongs[j] == -1:
            belongs[j] = group_ID
            f_search(j, group_ID)

group_ID = 0
for i in range(n+1):
    if belongs[i] == -1:
        belongs[i] = group_ID
        for j in F[i]:
            f_search(j, group_ID)
    group_ID += 1

cnt_members = [0 for _ in range(len(set(belongs)))]
for i in belongs[1:]:
    cnt_members[i] += 1

ans = [0 for _ in range(n+1)]
for i in range(1, n+1):
    tmp = 0
    for j in B[i]:
        if belongs[j] == belongs[i]:
            tmp += 1
    ans[i] = cnt_members[belongs[i]] - 1 - len(F[i]) - tmp

print(*ans[1:])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

n,m,k = map(int, input().split())

F = [[] for _ in range(n+1)]
B = [[] for _ in range(n+1)]

for _ in range(m):
    x,y = map(int, input().split())
    F[x].append(y)
    F[y].append(x)

for _ in range(k):
    x,y = map(int, input().split())
    B[x].append(y)
    B[y].append(x)

belongs = [-1 for _ in range(n+1)]
group_ID = 0

def f_search(root, group_ID):
    for j in F[root]:
        if belongs[j] == -1:
            belongs[j] = group_ID
            f_search(j, group_ID)

for i in range(n+1):
    if belongs[i] == -1:
        belongs[i] = group_ID
        f_search(i, group_ID)
        group_ID += 1

cnt_members = [0 for _ in range(len(set(belongs)))]
for i in belongs[1:]:
    cnt_members[i] += 1

ans = [0 for _ in range(n+1)]
for i in range(1, n+1):
    tmp = 0
    for j in B[i]:
        if belongs[j] == belongs[i]:
            tmp += 1
    ans[i] = cnt_members[belongs[i]] - 1 - len(F[i]) - tmp

print(*ans[1:])
n, k = map(int , input().split())
e = []
cnt = 0
for i in range(n):
a, b = map(int, input().split())
for j in range(b):
e.append(a)
e.sort()
print(e[k-1])

### FIXED CODE ###

n, k = map(int , input().split())
a = []
b = []
cnt = 0
for i in range(n):
    atem, btem = map(int , input().split())
    a.append(atem)
    b.append(btem)
c = list(zip(a, b))
c.sort()
a, b = zip(*c)
for i in range(n):
    cnt += b[i]
    if cnt >= k:
        print(a[i])
        break
n=int(input())
s=input()
return "Yes" if s.count("R") > n//2 eise "No" 

### FIXED CODE ###

n=int(input())
s=input()
ans= "Yes" if s.count("R") > n//2 else "No" 
print(ans)
import math

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

if N == 1:
    print(P)

T = int(math.pow(P, 1/N))
Q = [True] * (T + 1)
F = []

Q[0] = False
Q[1] = False

for n in range(2, T + 1):
    if Q[n]:
        F.append(n)
        for m in range(n, T + 1, n):
            Q[m] = False
D = 1
for f in F:
    c = 0
    while P % f == 0:
        c += 1
        P //= f
    D *= f ** (c // N)

print(D)

### FIXED CODE ###

import math

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

if N == 1:
    print(P)
    
else:
    T = int(math.pow(P, 1/N)) * 2

    Q = [False, False] + [True] * T
    F = []
    for n in range(T + 1):
        if Q[n]:
            F.append(n)
            for m in range(n, T + 1, n):
                Q[m] = False
    D = 1
    for f in F:
        c = 0
        while P % f == 0:
            c += 1
            P //= f
        D *= f ** (c // N)

    print(D)
A,B,C = map(int,input().split()
max(10*A + B + C,A+10*B+C,A+B+10*C)

### FIXED CODE ###

A,B,C = map(int,input().split())
ans = max(10*A + B + C, A+ 10*B + C, A + B + 10*C)
print(ans)