AtCoder Beginner Contest 059 - Alice&Brown

Alice and Brown loves games. Today, they will play the following game.
In this game, there are two piles initially consisting of X and Y stones, respectively.
Alice and Bob alternately perform the following operation, starting from Alice:
 - Take 2i stones from one of the piles. Then, throw away i of them, and put the remaining i in the other pile. Here, the integer i (1≤i) can be freely chosen as long as there is a sufficient number of stones in the pile.
The player who becomes unable to perform the operation, loses the game.
Given X and Y, determine the winner of the game, assuming that both players play optimally.

-----Constraints-----
 - 0 ≤ X, Y ≤ 10^{18}

-----Input-----
Input is given from Standard Input in the following format:
X Y

-----Output-----
Print the winner: either Alice or Brown.

-----Sample Input-----
2 1

-----Sample Output-----
Brown

Alice can do nothing but taking two stones from the pile containing two stones. As a result, the piles consist of zero and two stones, respectively. Then, Brown will take the two stones, and the piles will consist of one and zero stones, respectively. Alice will be unable to perform the operation anymore, which means Brown's victory.

Difficulty: MEDIUM_HARD

Starter code:

Solutions:
import os
import sys
from functools import lru_cache
if os.getenv('LOCAL'):
	sys.stdin = open('_in.txt', 'r')
sys.setrecursionlimit(2147483647)
INF = float('inf')
(X, Y) = list(map(int, sys.stdin.readline().split()))

@lru_cache(maxsize=None)
def grundy(x, y):
	if (x, y) in [(0, 1), (1, 0), (1, 1)]:
		return 0
	gs = set()
	for i in range(2, x + 1, 2):
		gs.add(grundy(x - i, y + i // 2))
	for i in range(2, y + 1, 2):
		gs.add(grundy(x + i // 2, y - i))
	ret = 0
	while ret in gs:
		ret += 1
	return ret
if abs(X - Y) <= 1:
	print('Brown')
else:
	print('Alice')


(x, y) = map(int, input().split())
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


printn = lambda x: print(x, end='')
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
ins = lambda : input().strip()
DBG = True
BIG = 10 ** 18
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
(x, y) = inm()
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


import sys
sys.setrecursionlimit(300000)

def solve(X: int, Y: int):
	if abs(X - Y) <= 1:
		ret = 'Brown'
	else:
		ret = 'Alice'
	print(ret)
	return

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	X = int(next(tokens))
	Y = int(next(tokens))
	solve(X, Y)
main()


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


def solve():
	(x, y) = list(map(int, input().split()))
	if abs(x - y) <= 1:
		print('Brown')
	else:
		print('Alice')

def __starting_point():
	solve()
__starting_point()


(x, y) = list(map(int, input().split()))
if x == y or x + 1 == y or x == y + 1:
	print('Brown')
else:
	print('Alice')


(a, b) = map(int, input().split())
if abs(a - b) <= 1:
	print('Brown')
else:
	print('Alice')


import sys

def read_int_list():
	return list(map(int, input().split()))

def read_str_list():
	return input().split()

def read_int():
	return int(input())

def read_str():
	return input()
solution = {}
choice = {}

def solve(x, y):
	if (x, y) in solution:
		return solution[x, y]
	for j in range(2, x + 1, 2):
		i = j // 2
		if not solve(x - 2 * i, y + i):
			res = True
			solution[x, y] = res
			choice[x, y] = (x - 2 * i, y + i)
			return res
	for j in range(2, y + 1, 2):
		i = j // 2
		if not solve(x + i, y - 2 * i):
			res = True
			solution[x, y] = res
			choice[x, y] = (x + i, y - 2 * i)
			return res
	res = False
	solution[x, y] = res
	return res

def solve2(x, y):
	return abs(x - y) >= 2

def test(N):
	for x in range(N):
		for y in range(N):
			if solve(x, y):
				print(x, y, '     ', choice[x, y])

def main():
	(x, y) = read_int_list()
	res = solve2(x, y)
	if res:
		print('Alice')
	else:
		print('Brown')
main()


(X, Y) = map(int, input().split())
print(['Alice', 'Brown'][abs(X - Y) < 2])


import sys

def solve():
	input = sys.stdin.readline
	(X, Y) = map(int, input().split())
	if abs(X - Y) > 1:
		print('Alice')
	else:
		print('Brown')
	return 0
solve()


(n, m) = map(int, input().split())
if abs(n - m) < 2:
	print('Brown')
else:
	print('Alice')


(a, b) = map(int, input().split())
print(abs(a - b) < 2 and 'Brown' or 'Alice')


print('ABlriocwen'[abs(eval(input().replace(' ', '-'))) < 2::2])


(X, Y) = map(int, input().split())
if max(X, Y) - min(X, Y) > 1:
	print('Alice')
else:
	print('Brown')


(x, y) = (int(i) for i in input().split())
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


import sys
(x, y) = map(int, sys.stdin.readline().split())

def main():
	return 'Brown' if abs(x - y) <= 1 else 'Alice'
ans = main()
print(ans)


import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce, lru_cache

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return list(map(int, input().split()))

def LIST():
	return list(map(int, input().split()))

def ZIP(n):
	return list(zip(*(MAP() for _ in range(n))))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
(X, Y) = MAP()
if abs(X - Y) <= 1:
	print('Brown')
else:
	print('Alice')


(a, b) = map(int, input().split())
print('ABlriocwen'[abs(a - b) <= 1::2])


(a, b) = map(int, input().split())
print(['Alice', 'Brown'][-1 <= a - b <= 1])


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10 ** 9 + 7
inf = float('inf')

def I():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))
(x, y) = LI()
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


def main():
	(X, Y) = map(int, input().split())
	if max(X, Y) <= 1:
		print('Brown')
	elif abs(X - Y) <= 1:
		print('Brown')
	else:
		print('Alice')
main()


import sys
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
(X, Y) = lr()
if abs(Y - X) >= 2:
	print('Alice')
else:
	print('Brown')


(X, Y) = map(int, input().split())
if X > Y:
	(X, Y) = (Y, X)
if Y - X >= 2:
	print('Alice')
else:
	print('Brown')


import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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


import io
(nim, mike) = map(int, input().split())
print('Brown' if abs(nim - mike) < 2 else 'Alice')


import sys

def main():
	(x, y) = map(int, input().split())
	s = 2 * x + y
	t = 2 * y + x
	if s // 3 - (s % 3 == 0) == t // 3 - (t % 3 == 0):
		print('Brown')
	else:
		print('Alice')
main()


import sys
sys.setrecursionlimit(10 ** 6)

def MI():
	return map(int, sys.stdin.readline().split())

def main():
	(x, y) = MI()
	if x > y:
		(x, y) = (y, x)
	if y > x + 1:
		print('Alice')
	else:
		print('Brown')
main()


(a, b) = map(int, input().split())
if -2 < a - b < 2:
	print('Brown')
else:
	print('Alice')


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
(X, Y) = MAP()
memo = list2d(1007, 1007, -1)

def rec(x, y):
	if memo[x][y] != -1:
		return memo[x][y]
	if x < 2 and y < 2:
		memo[x][y] = 0
		return 0
	res = 0
	for i in range(2, x + 1):
		if not rec(x - i, y + i // 2):
			res = 1
	for i in range(2, y + 1):
		if not rec(x + i // 2, y - i):
			res = 1
	memo[x][y] = res
	return res
if abs(X - Y) >= 2:
	print('Alice')
else:
	print('Brown')


(X, Y) = list(map(int, input().split()))
if X + Y <= 1:
	print('Brown')
else:
	n = X - Y
	if n < 0:
		n = -1 * n
	if n <= 1:
		print('Brown')
	else:
		print('Alice')


def main():
	(X, Y) = list(map(int, input().split(' ')))
	if abs(X - Y) > 1:
		print('Alice')
	else:
		print('Brown')

def __starting_point():
	main()
__starting_point()


import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
	(x, y) = map(int, readline().split())
	if abs(x - y) > 1:
		print('Alice')
	else:
		print('Brown')
main()


import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))

def solve():
	(x, y) = inl()
	if x > y:
		(x, y) = (y, x)
	d = y - x
	if d <= 1:
		return False
	return True
print('Alice' if solve() else 'Brown')


(X, Y) = list(map(int, input().split()))
if X + Y < 2 or abs(X - Y) < 2:
	print('Brown')
else:
	print('Alice')


import sys
input = sys.stdin.readline
from collections import *

def dfs(x, y):
	res = False
	for i in range(2, x + 1, 2):
		res |= not dfs(x - i, y + i // 2)
	for i in range(2, y + 1, 2):
		res |= not dfs(x + i // 2, y - i)
	return res
(X, Y) = map(int, input().split())
if abs(X - Y) <= 1:
	print('Brown')
else:
	print('Alice')


memo = {(0, 1): False, (1, 1): False}

def solve(p):
	(x, y) = p
	if x > y:
		(x, y) = (y, x)
	if (x, y) in memo:
		return memo[x, y]
	if x < 2 and y < 2:
		return False
	hand = []
	for i in range(2, x + 1, 2):
		hand.append((x - i, y + i // 2))
	for i in range(2, y + 1, 2):
		hand.append((x + i // 2, y - i))
	if all(map(solve, hand)):
		memo[x, y] = False
	else:
		memo[x, y] = True
	return memo[x, y]

def solve2(p):
	(x, y) = p
	if x > y:
		(x, y) = (y, x)
	return not -1 <= y - x <= 1
(X, Y) = map(int, input().split())
print('Alice' if solve2((X, Y)) else 'Brown')


(x, y) = map(int, input().split())
print(['Alice', 'Brown'][abs(x - y) < 2])


import sys

def solve(X: int, Y: int):
	print('Brown' if -1 <= X - Y <= 1 else 'Alice')

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	X = int(next(tokens))
	Y = int(next(tokens))
	solve(X, Y)

def __starting_point():
	main()
__starting_point()


(x, y) = map(int, input().split())
print('BArloiwcne'[abs(x - y) > 1::2])


import sys
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip()
YesNo = lambda b: bool([print('Yes')] if b else print('No'))
YESNO = lambda b: bool([print('YES')] if b else print('NO'))
int1 = lambda x: int(x) - 1

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


(X, Y) = list(map(int, input().split()))
if X == 0 and Y == 0 or (X == 0 and Y == 1) or (X == 1 and Y == 0) or (X == 1 and Y == 1):
	print('Brown')
	return
num = abs(X - Y)
if num <= 1:
	print('Brown')
else:
	print('Alice')


a = list(map(int, input().split(' ')))
if abs(a[0] - a[1]) < 2:
	print('Brown')
else:
	print('Alice')


import sys
sys.setrecursionlimit(10 ** 7)

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return map(int, sys.stdin.readline().rstrip().split())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI2():
	return list(map(int, sys.stdin.readline().rstrip()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def LS2():
	return list(sys.stdin.readline().rstrip())
(X, Y) = MI()
print('Alice' if abs(X - Y) >= 2 else 'Brown')


def alice_and_brown(X: int, Y: int) -> str:
	return 'Alice' if abs(X - Y) > 1 else 'Brown'
(X, Y) = map(int, input().split())
ans = alice_and_brown(X, Y)
print(ans)


import sys
input = sys.stdin.readline
(x, y) = map(int, input().split())
g = max(x, y) - min(x, y)
if g == 0 or g == 1:
	print('Brown')
else:
	print('Alice')


print('Brown' if abs(eval(input().replace(' ', '-'))) <= 1 else 'Alice')


import sys
sys.setrecursionlimit(10 ** 6)
readline = sys.stdin.readline
(x, y) = [int(i) for i in readline().split()]
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


from collections import defaultdict

def main():
	(X, Y) = map(int, input().split())
	print('Alice' if abs(X - Y) > 1 else 'Brown')
main()


import sys

def main():
	mod = 1000000007
	inf = float('inf')
	sys.setrecursionlimit(10 ** 6)

	def input():
		return sys.stdin.readline().rstrip()

	def ii():
		return int(input())

	def mi():
		return map(int, input().split())

	def mi_0():
		return map(lambda x: int(x) - 1, input().split())

	def lmi():
		return list(map(int, input().split()))

	def lmi_0():
		return list(map(lambda x: int(x) - 1, input().split()))

	def li():
		return list(input())
	(x, y) = mi()
	print('Brown') if abs(x - y) <= 1 else print('Alice')
main()


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float('inf')
(YES, Yes, yes, NO, No, no) = ('YES', 'Yes', 'yes', 'NO', 'No', 'no')
(dy4, dx4) = ([0, 1, 0, -1], [1, 0, -1, 0])
(dy8, dx8) = ([0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1])

def inside(y, x, H, W):
	return 0 <= y < H and 0 <= x < W

def ceil(a, b):
	return (a + b - 1) // b

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


(X, Y) = (int(x) for x in input().split())
if abs(X - Y) < 2:
	print('Brown')
else:
	print('Alice')


import sys
input = sys.stdin.readline
import math
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
MOD = 10 ** 9 + 7
INF = float('inf')
AZ = 'abcdefghijklmnopqrstuvwxyz'

def I():
	return int(input().strip())

def S():
	return input().strip()

def IL():
	return list(map(int, input().split()))

def SL():
	return list(map(str, input().split()))

def ILs(n):
	return list((int(input()) for _ in range(n)))

def SLs(n):
	return list((input().strip() for _ in range(n)))

def ILL(n):
	return [list(map(int, input().split())) for _ in range(n)]

def SLL(n):
	return [list(map(str, input().split())) for _ in range(n)]

def DD(arg):
	return defaultdict(arg)

def inv(n):
	return pow(n, MOD - 2, MOD)
kaijo_memo = []

def kaijo(n):
	if len(kaijo_memo) > n:
		return kaijo_memo[n]
	if len(kaijo_memo) == 0:
		kaijo_memo.append(1)
	while len(kaijo_memo) <= n:
		kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
	return kaijo_memo[n]
gyaku_kaijo_memo = []

def gyaku_kaijo(n):
	if len(gyaku_kaijo_memo) > n:
		return gyaku_kaijo_memo[n]
	if len(gyaku_kaijo_memo) == 0:
		gyaku_kaijo_memo.append(1)
	while len(gyaku_kaijo_memo) <= n:
		gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD)
	return gyaku_kaijo_memo[n]

def nCr(n, r):
	if n == r:
		return 1
	if n < r or r < 0:
		return 0
	ret = 1
	ret = ret * kaijo(n) % MOD
	ret = ret * gyaku_kaijo(r) % MOD
	ret = ret * gyaku_kaijo(n - r) % MOD
	return ret

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	return divisors

def make_primes(N):
	max = int(math.sqrt(N))
	seachList = [i for i in range(2, N + 1)]
	primeNum = []
	while seachList[0] <= max:
		primeNum.append(seachList[0])
		tmp = seachList[0]
		seachList = [i for i in seachList if i % tmp != 0]
	primeNum.extend(seachList)
	return primeNum

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return a * b // gcd(a, b)

def count_bit(n):
	count = 0
	while n:
		n &= n - 1
		count += 1
	return count

def base_10_to_n(X, n):
	if X // n:
		return base_10_to_n(X // n, n) + [X % n]
	return [X % n]

def base_n_to_10(X, n):
	return sum((int(str(X)[-i - 1]) * n ** i for i in range(len(str(X)))))

def base_10_to_n_without_0(X, n):
	X -= 1
	if X // n:
		return base_10_to_n_without_0(X // n, n) + [X % n]
	return [X % n]

def int_log(n, a):
	count = 0
	while n >= a:
		n //= a
		count += 1
	return count
(X, Y) = IL()
if abs(X - Y) >= 2:
	print('Alice')
else:
	print('Brown')


def main():
	(x, y) = map(int, input().split())
	if abs(x - y) <= 1:
		print('Brown')
	else:
		print('Alice')

def __starting_point():
	main()
__starting_point()


(X, Y) = [int(it) for it in input().split()]
if abs(X - Y) // 2 == 0:
	print('Brown')
else:
	print('Alice')


import sys
from functools import lru_cache

def solve():
	(x, y) = map(int, input().split())
	ans = 'Alice' if abs(x - y) >= 2 else 'Brown'
	print(ans)
solve()


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

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


import sys
input = sys.stdin.readline
from collections import *
(X, Y) = map(int, input().split())
if abs(X - Y) <= 1:
	print('Brown')
else:
	print('Alice')


def main():
	(x, y) = map(int, input().split())
	if x == y:
		print('Brown')
	elif abs(x - y) % 3 == 0:
		print('Alice')
	elif abs(x - y) == 1:
		print('Brown')
	else:
		print('Alice')
main()


import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10 ** 9))
write = lambda x: sys.stdout.write(x + '\n')
(x, y) = list(map(int, input().split()))
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


import itertools
import math
(x, y) = map(int, input().split())
if abs(x - y) >= 2:
	print('Alice')
else:
	print('Brown')


(X, Y) = map(int, input().split())
(A, B) = (X, Y)
while A >= 2 or B >= 2:
	if A > B:
		a = A // 2
		A -= 2 * a
		B += a
	else:
		b = B // 2
		B -= 2 * b
		A += b
if X - Y == A - B:
	print('Brown')
else:
	print('Alice')


from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10 ** 5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right

def LI():
	return list(map(int, stdin.readline().split()))

def LF():
	return list(map(float, stdin.readline().split()))

def LI_():
	return list(map(lambda x: int(x) - 1, stdin.readline().split()))

def II():
	return int(stdin.readline())

def IF():
	return float(stdin.readline())

def LS():
	return list(map(list, stdin.readline().split()))

def S():
	return list(stdin.readline().rstrip())

def IR(n):
	return [II() for _ in range(n)]

def LIR(n):
	return [LI() for _ in range(n)]

def FR(n):
	return [IF() for _ in range(n)]

def LFR(n):
	return [LI() for _ in range(n)]

def LIR_(n):
	return [LI_() for _ in range(n)]

def SR(n):
	return [S() for _ in range(n)]

def LSR(n):
	return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

def A():
	a = input().split()
	a = list(map(lambda x: x.capitalize(), a))
	(a, b, c) = a
	print(a[0] + b[0] + c[0])
	return

def B():
	a = II()
	b = II()
	if a > b:
		print('GREATER')
	if a < b:
		print('LESS')
	if a == b:
		print('EQUAL')
	return

def C():
	II()
	a = LI()

	def f(suma, b):
		for i in a[1:]:
			if suma * (suma + i) < 0:
				suma += i
				continue
			b += abs(suma + i) + 1
			suma = -1 * (suma > 0) or 1
		return b
	if a[0] == 0:
		ans = min(f(1, 1), f(-1, 1))
	else:
		ans = min(f(a[0], 0), f(1 * (a[0] < 0) or -1, abs(a[0]) + 1))
	print(ans)
	return

def D_():
	s = S()
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			print(i + 1, i + 2)
			return
	for i in range(len(s) - 2):
		if s[i] == s[i + 2]:
			print(i + 1, i + 3)
			return
	print(-1, -1)

def D():
	(x, y) = LI()
	a = abs(x - y)
	if a <= 1:
		print('Brown')
	else:
		print('Alice')
	return
D()


def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getArray(intn):
	return [int(input()) for i in range(intn)]

def input():
	return sys.stdin.readline().rstrip()

def rand_N(ran1, ran2):
	return random.randint(ran1, ran2)

def rand_List(ran1, ran2, rantime):
	return [random.randint(ran1, ran2) for i in range(rantime)]

def rand_ints_nodup(ran1, ran2, rantime):
	ns = []
	while len(ns) < rantime:
		n = random.randint(ran1, ran2)
		if not n in ns:
			ns.append(n)
	return sorted(ns)

def rand_query(ran1, ran2, rantime):
	r_query = []
	while len(r_query) < rantime:
		n_q = rand_ints_nodup(ran1, ran2, 2)
		if not n_q in r_query:
			r_query.append(n_q)
	return sorted(r_query)
from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
from math import sqrt, pi
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right
import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7
(X, Y) = getNM()
X = int(X)
Y = int(Y)
if (X - Y) ** 2 > 1:
	print('Alice')
else:
	print('Brown')


(X, Y) = map(int, input().split())
if X + Y <= 1 or (X == 1 and Y == 1):
	print('Brown')
elif abs(X - Y) <= 1:
	print('Brown')
else:
	print('Alice')


(x, y) = map(int, input().split())
print(['Brown', 'Alice'][abs(x - y) > 1])


xy = list(map(int, input().split()))
x = xy[0]
y = xy[1]
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
(X, Y) = map(int, input().split())
print('Brown' if abs(X - Y) <= 1 else 'Alice')


import sys

def main():
	input = sys.stdin.readline
	(X, Y) = map(int, input().split())
	if X > Y:
		(X, Y) = (Y, X)
	if X == Y or Y - X == 1:
		print('Brown')
	else:
		print('Alice')
main()


import sys
input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
inf = float('inf')
mod = 10 ** 9 + 7

def INT_(n):
	return int(n) - 1

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

def MI_():
	return map(INT_, input().split())

def LI():
	return list(MI())

def LI_():
	return [int(x) - 1 for x in input().split()]

def LF():
	return list(MF())

def LIN(n: int):
	return [I() for _ in range(n)]

def LLIN(n: int):
	return [LI() for _ in range(n)]

def LLIN_(n: int):
	return [LI_() for _ in range(n)]

def LLI():
	return [list(map(int, l.split())) for l in input()]

def I():
	return int(input())

def F():
	return float(input())

def ST():
	return input().replace('\n', '')

def main():
	(X, Y) = MI()
	if abs(X - Y) <= 1:
		print('Brown')
	else:
		print('Alice')
main()


(x, y) = map(int, input().split())
a = abs(x - y)
if a == 0 or a == 1:
	print('Brown')
else:
	print('Alice')


import sys
INF = float('inf')

def solve(X: int, Y: int):
	if abs(X - Y) <= 1:
		print('Brown')
	else:
		print('Alice')
	return

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	X = int(next(tokens))
	Y = int(next(tokens))
	solve(X, Y)
main()


print(['Alice', 'Brown'][abs(eval(input().replace(' ', '-'))) < 2])


import copy
import random
import bisect
import fractions
import math
mod = 10 ** 9 + 7
(X, Y) = map(int, input().split())
if abs(X - Y) > 1:
	print('Alice')
else:
	print('Brown')


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(10000)

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(X, Y):
	if abs(X - Y) > 1:
		return 'Alice'
	return 'Brown'

def main():
	(X, Y) = read_int_n()
	print(slv(X, Y))
main()


import sys

def MI():
	return map(int, sys.stdin.readline().rstrip().split())
(X, Y) = MI()
print('Alice' if abs(X - Y) >= 2 else 'Brown')


def examD():
	(X, Y) = LI()
	if abs(X - Y) <= 1:
		ans = 'Brown'
	else:
		ans = 'Alice'
	print(ans)
import sys
import copy
import bisect
from collections import Counter, defaultdict, deque

def I():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def S():
	return sys.stdin.readline().strip()
mod = 10 ** 9 + 7
inf = float('inf')
examD()


import sys
input = sys.stdin.readline

def I():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return list(map(int, input().split()))

def main():
	mod = 10 ** 9 + 7
	(x, y) = MI()
	if abs(x - y) <= 1:
		print('Brown')
	else:
		print('Alice')
main()


(X, Y) = input().split()
X = int(X)
Y = int(Y)
if (X - Y) ** 2 > 1:
	print('Alice')
else:
	print('Brown')


import sys
stdin = sys.stdin

def li():
	return [int(x) for x in stdin.readline().split()]

def li_():
	return [int(x) - 1 for x in stdin.readline().split()]

def lf():
	return [float(x) for x in stdin.readline().split()]

def ls():
	return stdin.readline().split()

def ns():
	return stdin.readline().rstrip()

def lc():
	return list(ns())

def ni():
	return int(ns())

def nf():
	return float(ns())
(x, y) = li()
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


(a, b) = [int(x) for x in input().split()]
if abs(a - b) <= 1:
	print('Brown')
else:
	print('Alice')


import sys
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
GOSA = 1.0 / 10 ** 10
MOD = 10 ** 9 + 7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z') + 1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def DP(N, M, first):
	return [[first] * M for n in range(N)]

def DP3(N, M, L, first):
	return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe

def dump(*args):
	names = {id(v): k for (k, v) in currentframe().f_back.f_locals.items()}
	print(', '.join((names.get(id(arg), '???') + ' => ' + repr(arg) for arg in args)), file=sys.stderr)

def local_input():
	from pcm.utils import set_stdin
	import sys
	from pathlib import Path
	parentdir = Path(os.path.dirname(__file__)).parent
	inputfile = parentdir.joinpath('test/sample-1.in')
	if len(sys.argv) == 1:
		set_stdin(inputfile)

def solve():
	(x, y) = map(int, input().split())
	if abs(x - y) <= 1:
		print('Brown')
	else:
		print('Alice')
	return 0
try:
	local_input()
except:
	pass
solve()


import sys
input = sys.stdin.readline
(x, y) = map(int, input().split())
print('Brown' if y - 1 <= x <= y + 1 else 'Alice')


from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random

def LI():
	return list(map(int, sys.stdin.readline().split()))

def I():
	return int(sys.stdin.readline())

def LS():
	return list(map(list, sys.stdin.readline().split()))

def S():
	return list(sys.stdin.readline())[:-1]

def IR(n):
	l = [None for i in range(n)]
	for i in range(n):
		l[i] = I()
	return l

def LIR(n):
	l = [None for i in range(n)]
	for i in range(n):
		l[i] = LI()
	return l

def SR(n):
	l = [None for i in range(n)]
	for i in range(n):
		l[i] = S()
	return l

def LSR(n):
	l = [None for i in range(n)]
	for i in range(n):
		l[i] = SR()
	return l
mod = 1000000007
(x, y) = LI()
if abs(x - y) <= 1:
	print('Brown')
else:
	print('Alice')


(N, M) = map(int, input().split())
if N + M <= 1:
	print('Brown')
elif abs(N - M) <= 1:
	print('Brown')
else:
	print('Alice')


def main():
	(X, Y) = map(int, input().split())

	def solve(x, y):
		return not (X + Y <= 1 or abs(X - Y) <= 1)
	cond = solve(X, Y)
	print('Alice' if cond else 'Brown')
main()


from collections import *
from fractions import gcd
from functools import *
from itertools import *
from operator import mul, itemgetter
from bisect import *
from heapq import *
from math import factorial, pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10 ** 8)

def main():
	(a, b) = map(int, input().split())
	if abs(a - b) >= 2:
		print('Alice')
	else:
		print('Brown')
main()


import sys
sys.setrecursionlimit(2147483647)
INF = float('inf')
MOD = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip()

def resolve():
	(x, y) = map(int, input().split())
	print('Alice' if abs(x - y) > 1 else 'Brown')
resolve()


kr = list(map(int, input().split()))
(x, y) = (kr[0], kr[1])
if abs(x - y) == 1 or abs(x - y) == 0:
	print('Brown')
else:
	print('Alice')


def d_AliceBrown(X, Y):
	if abs(X - Y) <= 1:
		return 'Brown'
	else:
		return 'Alice'
	return None
(X, Y) = [int(i) for i in input().split()]
print(d_AliceBrown(X, Y))


import sys
input = sys.stdin.buffer.readline

def RD():
	return input().rstrip().decode()

def II():
	return int(input())

def FI():
	return int(input())

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

def LI():
	return list(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def TI():
	return tuple(map(int, input().split()))

def main():
	(x, y) = MI()
	a = abs(x - y)
	print('Brown' if a <= 1 else 'Alice')
main()


(X, Y) = map(int, open(0).read().split())
if abs(X - Y) <= 1:
	print('Brown')
else:
	print('Alice')