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

def f(a, b):
    x = int(max(a, b))
    return len(str(x))

results = []

for i in range(1, (n // 2) + 1):
    if n % i == 0:
        a = i
        b = n / i
    result = f(a, b)
    results.append(result)

print(min(results))

### FIXED CODE ###

n = int(input())

def f(a, b):
    x = int(max(a, b))
    return len(str(x))

results = []

for i in range(1, int(n ** (1/2)) + 1):
    if n % i == 0:
        a = i
        b = n / i
    result = f(a, b)
    results.append(result)

print(min(results))
def ABC086(a,b):
  a=int(input())
  b=int(input())

  if (a*b)%2==0:
    print('Even')
  else:
    print('Odd')
ABC086(a,b)

### FIXED CODE ###

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

if (a*b)%2==0:
  print('Even')
else:
  print('Odd')
n = int(input())
t_state = 0
x_state = 0
y_state = 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    if  t - t_state < d or (t-t_state)%2 != d%2
        print("No")
        exit()
    t_state = t
    x_state = x
    y_state = y
print("Yes")

### FIXED CODE ###

n = int(input())
t_state, x_state, y_state = 0, 0, 0
for i in range(n):
    t, x, y = map(int, input().split())
    d = abs(x - x_state) + abs(y - y_state)
    td = t - t_state
    if  td < d or td%2 != d%2:
        print("No")
        exit()
    t_state, x_state, y_state = t, x, y
print("Yes")
S = list(input())
N = int(input())
ma=0
for i in range(N-1):
    ma=max(len(set(S[:i]) & set(S[i:])), ma)
print(ma)

### FIXED CODE ###

N= int(input())
S = list(input())
count=0
saidai=0
for i in range(1, N-1):
    count = len(set(S[:i]) & set(S[i:]))
    saidai=max(saidai, count) 
print(saidai)
X = int(input())
 
ans = 1
p = 2
A = set()
for i in range(2,X):
  if(i in A):
    continue
  p = 1
  while(True):
    p += 1
    power = i ** p
    if(power <= X):
      A.add(power)
      tmp = power
      pass
    else:
      break
  if(ans<tmp):
    ans = tmp
  if(p == 2):
    break
  
print(ans)
X = int(input())
 
ans = 0
p = 2
A = set()
for i in range(X):
  if(i in A):
    continue
  p = 1
  while(True):
    p += 1
    power = i ** p
    if(power <= X):
      A.add(power)
      tmp = power
      pass
    else:
      break
  if(ans<tmp):
    ans = tmp
  if(p == 2):
    break
  
print(ans)


### FIXED CODE ###

X = int(input())
 
ans = 1
p = 2
A = set()
for i in range(2,X):
  if(i in A):
    continue
  p = 1
  while(True):
    p += 1
    power = i ** p
    if(power <= X):
      A.add(power)
      tmp = power
      pass
    else:
      break
  if(ans<tmp):
    ans = tmp
  if(p == 2):
    break
  
print(ans)
N, X = map(int, input().split())

a = [2**(i+2) - 3 for i in range(N+1)]
p = [2**(i+1) - 1 for i in range(N+1)]

ans = 0

def calc(n, x):
    if n == 0:
        return 1
    if x == 1:
        return 0
    elif 1 < x < a[n-1]+1:
        return calc(n-1, x-1)
    elif x == 2 + a[n-1]:
        return p[n-1] + 1
    elif 2 + a[n-1] < x < 3 + 2*a[n-1]:
        return p[n-1] + 1 + calc(n-1, x-2-a[n-1])
    elif x == 3 + 2*a[n-1]:
        return 2*p[n-1] + 1


ans = calc(N, X)
print(ans)

### FIXED CODE ###

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

a = [2**(i+2) - 3 for i in range(N+1)]
p = [2**(i+1) - 1 for i in range(N+1)]

ans = 0

def calc(n, x):
    if n == 0:
        return 1
    if x == 1:
        return 0
    elif 1 < x < a[n-1]+2:
        return calc(n-1, x-1)
    elif x == 2 + a[n-1]:
        return p[n-1] + 1
    elif 2 + a[n-1] < x < 3 + 2*a[n-1]:
        return p[n-1] + 1 + calc(n-1, x-2-a[n-1])
    elif x == 3 + 2*a[n-1]:
        return 2*p[n-1] + 1


ans = calc(N, X)
print(ans)
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(N):
  del A[1]
  del B[1]

### FIXED CODE ###

a = int(input())
print(a+a*a+a*a*a)
n,m = map(int,input().split())
a = [0]*m
for i in range(m):
    a[i] = int(input())
b=a[0]
for i in range(m-1):
    b = max(b,a[i+1]-a[i])
fib=[0,1]
for i in range(b-1):
    fib.append(fib[i]+fib[i+1])
ans = fib[a[0]]
for i in range(m-1):
    ans *= fib[a[i+1]-a[i]-1]
    ans % 1000000007
    print(ans)
ans *= fib[n-a[m-1]]
print(ans%1000000007)

### FIXED CODE ###

n, m = map(int, input().split())
mod = 10**9 + 7
dp = [1]*(n+1)
 
for _ in range(m):
    a = int(input())
    dp[a] = 0
 
for i in range(2, n+1):
    if dp[i]>0:
        dp[i] = (dp[i-1]+dp[i-2])%mod
 
print(dp[n])
全部１０の倍数ならNG
一番小さい10お倍数以外を引く

### FIXED CODE ###

n=int(input())
a = []

for i in range(n):
  a.append(int(input()))
a.sort()
suma=sum(a)
if suma%10!=0:
  print(suma)
  exit()
else:
  for i in range(n):
    suma=suma-a[i]
    if suma%10!=0:
      print(suma)
      exit()
    else:
      suma=suma+a[i]
print(0)
N, M=(int(i) for i in input().split())
P=[[int(i) for i in input().split()] for  _ in range(M)]
P=[[P[i][0]-1,P[i][1]] for i in range(M)]
f=True

ans=["*"]*N
for i in range(M):
    if ans[P[i][0]]!="*" and ans[P[i][0]]!=str(P[i][1]):
        print(-1)
        f=False
    else:
        ans[P[i][0]]=str(P[i][1])
if N==1 and P[0][1]==0 and f:
    print(0)
else:
    if f:
        if ans[0]=="*":
            ans[0]=1
        for i in range(1,N):
            if ans[i]=="*":
                ans[i]="0"
        if len(str(int("".join(ans))))==N:
            print(int("".join(ans)))
        else:
            print(-1)


### FIXED CODE ###


N, M=(int(i) for i in input().split())
P=[[int(i) for i in input().split()] for  _ in range(M)]
P=[[P[i][0]-1,P[i][1]] for i in range(M)]
f=True

ans=["*"]*N
for i in range(M):
    if ans[P[i][0]]!="*" and ans[P[i][0]]!=str(P[i][1]):
        print(-1)
        f=False
    else:
        ans[P[i][0]]=str(P[i][1])
if M>0:
    if N==1 and P[0][1]==0 and f:
        print(0)
    else:
        if f:
            if ans[0]=="*":
                ans[0]="1"
            for i in range(1,N):
                if ans[i]=="*":
                    ans[i]="0"
            if len(str(int("".join(ans))))==N:
                print(int("".join(ans)))
            else:
                print(-1)
else:
    if N==1:
        print(0)
    elif N==2:
        print(10)
    else:
        print(100)
N = int(input())
res = 1000000000000
for i in range(N):
    count = 0
    x = int(input())
    while x%2==0:
        x /= 2
        count += 1
    if res > count: res = count
print(res)


### FIXED CODE ###

N = int(input())
res = 1000000000000
x = list(map(int, input().split()))
for x in x:
    count = 0
    while x%2==0:
        x /= 2
        count += 1
    if res > count: res = count
print(res)
N,M = map(int,inport().split())
if N == M:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

N,M = map(int,input().split())
if N == M:
  print("Yes")
else:
  print("No")
import sys
import numpy as np

read = sys.stdin.buffer.read

H,W,M = list(map(int, input().split()))

hw = np.zeros((H+1,W+1),dtype=np.int64)
w = np.zeros(3*10**5,dtype=np.int64)
h = np.zeros(3*10**5,dtype=np.int64)
 
for i in range(M):
    h_i, w_j = list(map(int, input().split()))
    hw[h_i, w_j] = 1
    h[h_i] += 1
    w[w_j] += 1

a = 0
d = 0
for i in np.where(h==h.max())[0]:
    for j in np.where(w==w.max())[0]:
        mxh_v = h[i]
        mxw_v = w[j]
        d = hw[i, j]
        # print(i,j,a, mxh_v , mxw_v , d)
        a = max(a, mxh_v + mxw_v - d)
    if d == 0:
        break
print(a)

### FIXED CODE ###

H,W,M = list(map(int, input().split()))

hw = set()
w = [0] * 3*10**5
h = [0] * 3*10**5

for i in range(M):
    h_i, w_j = map(int, input().split())
    hw.add((h_i-1) + (w_j-1)*3*10**6)
    h[h_i-1] += 1
    w[w_j-1] += 1

a = 0
d = 1
mxh_v = max(h)
mxw_v = max(w)

x = [i for i,j in enumerate(h) if j == mxh_v]
y = [i for i,j in enumerate(w) if j == mxw_v]

for i in x:
    for j in y:
        if not(i + j*3*10**6 in hw):
            print(mxh_v+mxw_v)
            exit()
print(mxh_v+mxw_v-d)
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.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
x=0
y=0
R=0
z=0
s=0
while (x<X or y<Y) and z<X+Y:
  if (max(p[0],q[0],r[0])==p[0] or (y==Y and r[0]<p[0])) and x<X:
    s+=p[0]
    x+=1
    p[0]=p[x]
    z+=1
  elif (max(p[0],q[0],r[0])==q[0] or (x==X and r[0]<q[0])) and y<Y:
    s+=q[0]
    y+=1
    q[0]=q[y]
    z+=1
  else:
    s+=r[0]
    R+=1
    r[0]=r[R]
    z+=1
print(s)

### FIXED CODE ###

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.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
x=0
y=0
R=0
z=0
s=0
while (x<X or y<Y) and z<X+Y:
  if (max(p[0],q[0],r[0])==p[0] or (y==Y and r[0]<p[0])) and x<X:
    s+=p[0]
    x+=1
    if x<A:
      p[0]=p[x]
    else:
      p[0]=0
    z+=1
  elif (max(p[0],q[0],r[0])==q[0] or (x==X and r[0]<q[0])) and y<Y:
    s+=q[0]
    y+=1
    if y<B:
      q[0]=q[y]
    else:
      q[0]=0
    z+=1
  else:
    s+=r[0]
    R+=1
    if R<C:
      r[0]=r[R]
    else:
      r[0]=0
    z+=1
print(s)
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(a.count(a >= k))

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
print(len([e for e in a if e >= k]))
from fracitons import gcd
a, b = map(int, input().split())
print((a*b)//gcd(a,b))


### FIXED CODE ###

a, b = map(int, input().split())
if a < b:
    a, b = b, a
A = a
B = b
while a % b != 0:
    a, b = b, a % b
print((A*B)//b)
n = int(input())
limit = int(math.ceil(math.sqrt(n)))
ans =0
for i in range(1,limit):
    a = n // i - 1
    if i * a + i == n:
        ans += a
print(ans)

### FIXED CODE ###

limit = 0
n = int(input())
for v in range(1,n):
    if v*v >n:
        limit= v-1
        break
ans =0
for i in range(1,limit+1):
    a = n // i - 1
    if n//a == n%a:
        ans += a
print(ans)
n = int(input())
if "7" in n:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

n = list(input())
if "7" in n:
  print("Yes")
else:
  print("No")
import math

H,N = map(int,input().split())
ab = [list(map(int,input().split()))for _ in range(N)]

dp=[[[float('INF'),0] for _ in range(H+1)]for i in range(N+1)]
dp[0]=[[0,0]for _ in range(H+1)]
for i in range(1,N+1):
  a = ab[i-1][0]
  b = ab[i-1][1]
  for j in range(1,H+1):
    limit = math.floor(j/a)+2
    for k in range(limit):
        mana = dp[i-1][j-(a*k)][0]+b*k
        damage = dp[i-1][j-(a*k)][1]+(a*k)
        if damage >= j:
            if dp[i][j][0] > mana:
                dp[i][j]=[mana,damage]
print(dp[N][H][0])

### FIXED CODE ###

#モンスターの体力は H
#トキはN種類の魔法が使え、
#i番目の魔法を使うと、モンスターの体力を Ai減らすことができますが、
#トキの魔力を Bi消耗します。

#dp[i] = モンスターの体力を i 減らすため消耗する魔力の最小値
#dp[i+1] = min(dp[i-Ai]+Bi,dp[i])
#dp[0]=0

import numpy as np
 
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab = np.array(ab)
 
a = ab[:, 0]
b = ab[:, 1]
 
dp = np.zeros(100001, dtype=np.int)
for i in range(1, h+1):
    dp[i] = (dp[i-a]+b).min()
print(dp[h])
import math
def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]
    
    dp = {(-1,0): 0, (-1,1): -math.inf}
    for i in range(0, N):
        dp[(i,0)] = max(dp[(i-1, 0)] + As[i], dp[(i-1,1)] - As[i])
        dp[(i,1)] = max(dp[(i-1, 0)] - As[i], dp[(i-1,1)] + As[i])
    print("{}".format(dp[(N-1,0)]))

sub()


### FIXED CODE ###

def sub():
    N, As = [input() for _ in range(2)]
    N = int(N)
    As = [int(e) for e in As.split(" ")]

    dp = {(-1, 0): 0, (-1, 1): -1e10}
    for i in range(0, N):
        dp[(i, 0)] = max(dp[(i - 1, 0)] + As[i], dp[(i - 1, 1)] - As[i])
        dp[(i, 1)] = max(dp[(i - 1, 0)] - As[i], dp[(i - 1, 1)] + As[i])
    print("{}".format(dp[(N - 1, 0)]))


sub()
DEBUG = False

N, M, X = map(int, input().split())
A = []
C = []
for _ in range(N):
    CA = list(map(int, input().split()))
    C.append(CA[0])
    A.append(CA[1::])

if DEBUG:
    print(A)
    print(C)

max_money = 10**5 * N
ans_money = max_money
# ans_algorythm = None
for i in range(2**N):
    bit = bin(i)[2::]
    bit = bit.zfill(M)
    if DEBUG:
        print("i: {}, bit: {}".format(i, bit))
    tmp_money = 0
    tmp_algorythm = [0] * M
    for j, b in enumerate(bit):
        if b == '1':
            tmp_money += C[j]
            for k, c in enumerate(A[j]):
                tmp_algorythm[k] += c
    if DEBUG:
        print("tmp_money: {}, tmp_algorythm: {}".format(tmp_money, tmp_algorythm))
    if len(list(filter(lambda x: x < X, tmp_algorythm))) == 0:
        ans_money = min(tmp_money, ans_money)
        if DEBUG:
            print("ans_money: {}".format(ans_money))
        # break

if ans_money == max_money:
    print(-1)
else:
    print(ans_money)


### FIXED CODE ###

DEBUG = False

N, M, X = map(int, input().split())
A = []
C = []
for _ in range(N):
    CA = list(map(int, input().split()))
    C.append(CA[0])
    A.append(CA[1::])

if DEBUG:
    print(A)
    print(C)

max_money = 10**5 * N + 1
ans_money = max_money
# ans_algorythm = None
for i in range(2**N):
    bit = bin(i)[2::]
    bit = bit.zfill(N)
    if DEBUG:
        print("i: {}, bit: {}".format(i, bit))
    tmp_money = 0
    tmp_algorythm = [0] * M
    for j, b in enumerate(bit):
        if b == '1':
            tmp_money += C[j]
            for k, c in enumerate(A[j]):
                tmp_algorythm[k] += c
    if DEBUG:
        print("tmp_money: {}, tmp_algorythm: {}".format(tmp_money, tmp_algorythm))
    if len(list(filter(lambda x: x < X, tmp_algorythm))) == 0:
        ans_money = min(tmp_money, ans_money)
        if DEBUG:
            print("ans_money: {}".format(ans_money))
        # break

if ans_money == max_money:
    print(-1)
else:
    print(ans_money)
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B = mapint()
if A+B-1>N or N>A*B:
    print(-1)
else:
    cnt = N
    blocks = list(range(B, 0, -1))
    blocks.extend([0]*B*(A-1))
    flg = True
    loop = 0
    while flg:
        flg = False
        for i in range(A-1, 0, -1):
            blocks[i*B-loop] = cnt
            cnt -= 1
            if cnt==B:
                break
        else:
            flg = True
            loop += 1
    blocks = [i for i in blocks if i!=0]
    print(*blocks)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B = mapint()
from collections import deque
if A+B-1>N or N>A*B:
    print(-1)
else:
    blocks = []
    blocks.append(' '.join(map(str, range(B, 0, -1))))
    now = B+1
    rest = N-A+2

    while now:
        if now>=rest:
            break
        if now+B>rest:
            blocks.append(' '.join(map(str, range(rest, now-1, -1))))
            rest += 1
            break
        blocks.append(' '.join(map(str, range(now+B-1, now-1, -1))))
        now = now+B
        rest += 1
    blocks.append(' '.join(map(str, range(rest, N+1))))
    print(' '.join(blocks))
N = int(input())
S = map(input().split())
flag = 0
for i in range(N):
  if S[i] == "Y":
    flag += 1
if flag > 0:
  print("Four")
else:
  print("Three")

### FIXED CODE ###

N = int(input())
S = list(input().split())
flag = 0
for i in range(N):
  if S[i] == "Y":
    flag += 1
if flag > 0:
  print("Four")
else:
  print("Three")
a = list(map(int, input().split()))
#print(a)
try:
    b=[0]*a[1]
    c=[0]*(a[1]+1)
    b[0]=int(input())
    c[0]=b[0]-0
    for x in range(a[1]-1):
        b[x+1]=int(input())
        c[x+1]=b[x+1]-b[x]-1
    c[-1]=a[0]-b[-1]
    max = 0
    min = a[0]+100
except:
    print(0)
for x in c:
    if x>max:
        max=x
    if x<min:
        min=x
        
#print(c)
#print(max," ",min)
if min==0:
    print(0)
else:
    num=[0]*(max)
    for x in range(max):
        if x==0:
            num[0]=1
        elif x==1:
            num[1]=1
        else:
            num[x]=num[x-1]+num[x-2]
        #print("num[",x,"]=",num[x])
        
    answer=1
    for x in c:
        answer *=num[x-1]
        if answer==0:
            print(0)
            break
        else:
            answer%=1000000007
    print(answer)

### FIXED CODE ###

n,m = list(map(int, input().split()))
a=[]
a.append(-1)
for x in range(m):
  tmp=int(input())
  a.append(tmp)
a.append(n+1)
diff = []
for x in range(len(a)-1):
  diff.append(a[x+1]-a[x])
              
large = 0
small = 123456789012345
for x in diff:
  large=max(large,x)
  small=min(small,x)

num=[0,0,1]
for _ in range(large):
  num.append((num[-1]+num[-2])%1000000007)
    
answer=1
for x in diff:
  #print(x,num[x])
  answer *=num[x]
  answer%=1000000007
print(answer)
H, W=map(int,input().split())
print("#"*(w+2))
for i in range(h):
  s=input()
  s="#"+s+"#"
  print(s)
print("#"*(w+2))

### FIXED CODE ###

H, W=map(int,input().split())
print("#"*(W+2))
for i in range(H):
  s=input()
  s="#"+s+"#"
  print(s)
print("#"*(W+2))
n,m=map(int,input().split())
ans=n*(n-1)/2
l=[-1]*n
a=[1]*n
b=[input().split() for _ in range(m)]
c=[0]*m+[ans]
def r(s):
  t=l[s]
  return s if t<0 else r(t)
def f(s):
  return r(int(s)-1)
for i in range(m-1,-1,-1):
  x,y=map(f,b[i])
  if x!=y:
    l[x]=y
    ans-=a[x]*a[y]
    a[y]+=a[x]
  c[i]=ans
for x in c[1:]:
  print(x)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
n,m=map(int,input().split())
z=n*(n-1)//2
l=[-1]*n
a=[1]*n
b=[input().split() for _ in range(m)]
c=[0]*m+[z]
def r(s):
  t=l[s]
  if t<0:
    return s
  else:
    l[s]=r(t)
    return l[s]
def f(s):
  return r(int(s)-1)
for i in range(m-1,-1,-1):
  x,y=map(f,b[i])
  if x!=y:
    l[x]=y
    z-=a[x]*a[y]
    a[y]+=a[x]
  c[i]=z
for x in c[1:]:
  print(x)
D = int(input())
 
if D == 25:
  print(Christmas)
else if D == 24:
  print(Christmas Eve)
else if D == 23:
  print(Christmas Eve Eve)
else if D == 22:
  print(Christmas Eve Eve Eve)

### FIXED CODE ###

#A問題を2回間違えた灰コーダー

D = int(input())
 
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 22:
  print("Christmas Eve Eve Eve")
l = input().split()
p = [int(l[0]),int(l[1])]
q = [int(l[2]),int(l[3])]
r = [r1,r2]
s = [s1,s2]

if p[0]==q[0]:
    m = q[1]-p[1]
    r[0]=q[0]-m
    r[1]=q[1]
    s[0]=p[0]-m
    s[1]=p[1]
else:
    m = q[0]-p[0]
    r[0] = q[0] 
    r[1] = q[1]+m
    s[0] = p[0] 
    s[1] = p[1]+m
print(str(r1)+" "+str(r2)+" "+str(s1)+" "+str(s2))

### FIXED CODE ###

l = input().split(" ")
p = [int(l[0]),int(l[1])]
q = [int(l[2]),int(l[3])]
r = [0,0]
s = [0,0]
if p[0]==q[0]:
    m = q[1]-p[1]
    r[0] = q[0]-m
    r[1] = q[1]
    s[0] = p[0]-m
    s[1] = p[1]
else:
    v = [q[1]-p[1],q[0]-p[0]]
    r[0]= q[0]-v[0]
    r[1]=q[1]+v[1]
    s[0]=p[0]-v[0]
    s[1]=p[1]+v[1]
print(str(r[0])+" "+str(r[1])+" "+str(s[0])+" "+str(s[1]))
s = input()

for i in range(len(S)):
  if len(set(s)) > 3:
    print("No")
  else:
    s = list(set(s))
    if count(s[0]) == count(s[1]):
      print("Yes")
   	else:
      print("No")

### FIXED CODE ###

s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')
#(1,0)と(1,1)が敗戦の最終状態。そこから遷移する状態を考える。
#(2,0),(3,0)は勝利状態。
#(2,1),(2,2)はどう遷移しても上記勝利状態に遷移してしまうので、敗北状態。
#(3,1),(4,0),(4,1),(5,0)...などが上記敗北状態に遷移できる状態なので勝利状態。
#実験を重ねると|X-Y|<=1が敗戦状態ではないか、という仮説が立つ。
#少し考えると、|X-Y|<=1からの遷移は必ず|X'-Y'|>1にならざるを得なくて
#|X-Y|>1からは必ず|X'-Y'|<=1となる遷移が存在することが分かる。
#最終的には|X-Y|<=1の状態は2N手後に(1,0)と(1,1)へと収斂するので、勝利条件が確定する。

X,Y=map(int,input().split())
if abs(X-Y)<=1:
    print("Brown")
else:
    print("Alice")


### FIXED CODE ###

s = list(input().split())


ans = "".join([s[0][0],s[1][0],s[2][0]]).upper()
print(ans)
import sys

def split(g):
  sub = []
  for i in range(len(g)-1):
    sub.append(g[i+1] - g[i])
  m = max(sub)
  i = sub.index(m) + 1
  return g[:i], g[i:]


def main():
  input = sys.stdin.readline
  N, M = map(int, input().split())
  g = [int(a) for a in input().split()]
  g = sorted(g)
  if N >= M:
    ans = 0
  else:
    sp = []
    for _ in range(N-1):
      s, g = split(g)
      sp.append(s)
    sp.append(g)
    ans = 0
    for s in sp:
      ans += s[-1] - s[0]
  print(ans)


if __name__ == '__main__':
  main()

### FIXED CODE ###

import sys

def main():
  input = sys.stdin.readline
  N, M = map(int, input().split())
  ans = 0
  if N < M:
    g = [int(a) for a in input().split()]
    g = sorted(g)
    L = g[:-1]
    R = g[1:]
    sub = [b - a for a, b in zip(L, R)]
    sub = sorted(sub)
    ans = sum(sub[:(M-N)])
  print(ans)


if __name__ == '__main__':
  main()
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n

while (1):

    c = True
    for ii in range(0, 4):
        b = b // 10
        d = b % 10

        if b == 0:
            break

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)


### FIXED CODE ###

#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n
b = n
while (1):

    c = True
    b = n
    while (b != 0):
        d = b % 10
        b = b // 10

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)
h,w = map(int,input().split())
x = [''.join(["#"]*(w+2))]
s = x+["#"+input()+"#" for _ in range(h)]+x
ans = 0
checked_ = [[False]*(w+1) for _ in range(h+2)]

for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j]=="#":
            continue
        checked=checked.copy()
        checked[i][j]=True
        stack=[[i,j]]
        stack_=[]
        count = 1
        while stack:
            pair=stack.pop()
            for x,y in [[1,0],[-1,0],[0,1],[0,-1]]:
                if s[pair[0]+x][pair[1]+y]=="." and [pair[0]+x,pair[1]+y] == False:
                    stack_.append([pair[0]+x,pair[1]+y])
                    checked[pair[0]+x][pair[1]+y] = True
            if stack==[]:
                stack = stack_.copy()
                stack_ = []
                count += 1

        ans = max(ans,count)
        
print(ans-2)

### FIXED CODE ###

h,w = map(int,input().split())
x = [''.join(["#"]*(w+2))]
s = x+["#"+input()+"#" for _ in range(h)]+x
ans = 0

for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j]=="#":
            continue
        checked = [[False]*(w+2) for _ in range(h+2)]
        checked[i][j]=True
        stack=[[i,j]]
        stack_=[]
        count = 1
        while stack:
            pair=stack.pop()
            for x,y in [[1,0],[-1,0],[0,1],[0,-1]]:
                if s[pair[0]+x][pair[1]+y]=="." and checked[pair[0]+x][pair[1]+y] == False:
                    stack_.append([pair[0]+x,pair[1]+y])
                    checked[pair[0]+x][pair[1]+y] = True
            if stack==[]:
                stack = stack_.copy()
                stack_ = []
                count += 1

        ans = max(ans,count)
        
print(ans-2)
n = input()
k = input()
price = []
cost = 0
for p in range(n + 1):
        p = int(input())
        price.append(p)

price.sort(reverse = True)
for  p in price:
        cost += p

print(price)

### FIXED CODE ###

n, k,  =map(int, input().split())
cost = 0
price = list(map(int, input().split()))
        
price.sort()
del price[k:]
for p in price:
        cost += p

print(cost)
import math
i = list(map(int, input().split()))
a = i[0]
#print('a=',a)
b = i[1]
#print('b=',b)
h = i[2]
#print('h=',h)
m = i[3]
#print('m=',m)
#長針の角度を求める
ma = m*6
#print('ma=',ma)
#短針の角度を求める
ha = h*30+0.5*m
#print('ha=',ha)
#角度の差の絶対値
if ma ==0 or ha ==0:
  ang = max(ma,ha)
else
ang =abs(ma-ha)
#print(ang)
#長針と短針の角度が同じなら長針ー短針をすればいい。
if ma == ha:
  print(b-a)
else:
  e = math.cos(math.radians(ang))
  #print(e)
  #print(-2*a*b*e)
  #print(a*a + b*b -2*a*b*e)
  d = a*a + b*b -2*a*b* e
  #print(d)
  c = math.sqrt(d)
  print(c)
  
#print('あくまでテスト',math.sqrt(9+16-2*3*4*math.cos(math.radians(80))))

### FIXED CODE ###

import math
i = list(map(int, input().split()))
a = i[0]
#print('a=',a)
b = i[1]
#print('b=',b)
h = i[2]
#print('h=',h)
m = i[3]
#print('m=',m)
#長針の角度を求める
ma = m*6
#print('ma=',ma)
#短針の角度を求める
ha = h*30+0.5*m
#print('ha=',ha)
#角度の差の絶対値
ang = ha -ma
#print(ang)
#長針と短針の角度が同じなら長針ー短針をすればいい。
e = math.cos(math.radians(ang))
d = a*a + b*b -2*a*b* e
#print(d)
c = math.sqrt(d)
print(c)
  
#print('あくまでテスト',math.sqrt(9+16-2*3*4*math.cos(math.radians(80))))