Monocarp and Bicarp live in Berland, where every bus ticket consists of $n$ digits ($n$ is an even number). During the evening walk Monocarp and Bicarp found a ticket where some of the digits have been erased. The number of digits that have been erased is even.

Monocarp and Bicarp have decided to play a game with this ticket. Monocarp hates happy tickets, while Bicarp collects them. A ticket is considered happy if the sum of the first $\frac{n}{2}$ digits of this ticket is equal to the sum of the last $\frac{n}{2}$ digits.

Monocarp and Bicarp take turns (and Monocarp performs the first of them). During each turn, the current player must replace any erased digit with any digit from $0$ to $9$. The game ends when there are no erased digits in the ticket.

If the ticket is happy after all erased digits are replaced with decimal digits, then Bicarp wins. Otherwise, Monocarp wins. You have to determine who will win if both players play optimally.


-----Input-----

The first line contains one even integer $n$ $(2 \le n \le 2 \cdot 10^{5})$ — the number of digits in the ticket.

The second line contains a string of $n$ digits and "?" characters — the ticket which Monocarp and Bicarp have found. If the $i$-th character is "?", then the $i$-th digit is erased. Note that there may be leading zeroes. The number of "?" characters is even.


-----Output-----

If Monocarp wins, print "Monocarp" (without quotes). Otherwise print "Bicarp" (without quotes).


-----Examples-----
Input
4
0523

Output
Bicarp

Input
2
??

Output
Bicarp

Input
8
?054??0?

Output
Bicarp

Input
6
???00?

Output
Monocarp



-----Note-----

Since there is no question mark in the ticket in the first example, the winner is determined before the game even starts, and it is Bicarp.

In the second example, Bicarp also wins. After Monocarp chooses an erased digit and replaces it with a new one, Bicap can choose another position with an erased digit and replace it with the same digit, so the ticket is happy.

Difficulty: MEDIUM_HARD
Tags: Game theory

Mathematics

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
n = int(input())
s = input()
nuq1 = 0
nuq2 = 0
sum1 = 0
sum2 = 0
for i in range(n):
	if s[i] == '?' and i < n // 2:
		nuq1 += 1
	elif s[i] == '?' and i >= n // 2:
		nuq2 += 1
	elif i < n // 2:
		sum1 += int(s[i])
	else:
		sum2 += int(s[i])
if sum1 - sum2 == 9 * ((nuq2 - nuq1) // 2):
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
sd = 0
qd = 0
for i in range(n // 2):
	if s[i] == '?':
		qd += 1
	else:
		sd += int(s[i])
	if s[n // 2 + i] == '?':
		qd -= 1
	else:
		sd -= int(s[n // 2 + i])
if abs(sd) % 9 > 0:
	print('Monocarp')
	exit()
if sd >= 0:
	qd += 2 * (sd // 9 + (1 if sd % 9 > 0 else 0))
else:
	sd = -1 * sd
	qd -= 2 * (sd // 9 + (1 if sd % 9 > 0 else 0))
print('Bicarp' if qd == 0 else 'Monocarp')


n = int(input())
s = input()
s1 = 0
s2 = 0
c1 = 0
c2 = 0
for i in range(n // 2):
	if s[i] != '?':
		s1 += int(s[i])
	else:
		c1 += 1
	if s[-i - 1] != '?':
		s2 += int(s[-i - 1])
	else:
		c2 += 1
if c1 > c2:
	c1 -= c2
	if s1 + 9 * (c1 // 2) > s2 or s1 + 9 * (c1 // 2) < s2:
		print('Monocarp')
	else:
		print('Bicarp')
else:
	c2 -= c1
	if s2 + 9 * (c2 // 2) > s1 or s2 + 9 * (c2 // 2) < s1:
		print('Monocarp')
	else:
		print('Bicarp')


from math import *
from sys import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def factor(n):
	potentional_p = 3
	itog_list = {}
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			if n in itog_list:
				itog_list[n] += 1
			else:
				itog_list[n] = 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			if potentional_p in itog_list:
				itog_list[potentional_p] += 1
			else:
				itog_list[potentional_p] = 1
		potentional_p += 2
	return itog_list

def sm(s):
	lst = list(s)
	return sum([int(x) for x in lst])

def main():
	n = int(input())
	s = input()
	ff = s[:n // 2]
	ss = s[n // 2:]
	ff = ff.replace('?', '0')
	ss = ss.replace('?', '9')
	l = sm(ff) - sm(ss)
	ff = s[:n // 2]
	ss = s[n // 2:]
	ff = ff.replace('?', '9')
	ss = ss.replace('?', '0')
	r = sm(ff) - sm(ss)
	if l + r == 0:
		print('Bicarp')
	else:
		print('Monocarp')
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.readline

def aliceWillWin(ticket):
	bal = 0
	qs = 0
	for (i, c) in enumerate(ticket):
		if i < len(ticket) // 2:
			if c == '?':
				qs += 1
			else:
				bal += int(c)
		elif c == '?':
			qs -= 1
		else:
			bal -= int(c)
	if bal == -qs // 2 * 9:
		return False
	return True

def main():
	n = int(input())
	isAlice = aliceWillWin(input().strip())
	if isAlice:
		print('Monocarp')
	else:
		print('Bicarp')
main()


n = int(input())
a = input()
if a.count('?') % 2 == 1:
	print('Monocarp')
else:
	x = y = k = m = 0
	for q in range(n):
		if q * 2 < n:
			if a[q] == '?':
				k += 1
			else:
				x += int(a[q])
		elif a[q] == '?':
			m += 1
		else:
			y += int(a[q])
	if (y - x) % 9 == 0 and (y - x) // 9 == (k - m) // 2:
		print('Bicarp')
	else:
		print('Monocarp')


n = int(input())
arr = input()
lsum = 0
rsum = 0
lq = 0
rq = 0
for i in range(n // 2):
	if arr[i] == '?':
		lq += 1
	else:
		lsum += int(arr[i])
for i in range(n // 2, n):
	if arr[i] == '?':
		rq += 1
	else:
		rsum += int(arr[i])
if (lq + rq) % 2 == 1:
	print('Monocarp')
elif (lsum - rsum) // 9 == (rq - lq) // 2 and (lsum - rsum) % 9 == 0:
	print('Bicarp')
elif (rsum - lsum) // 9 == (lq - rq) // 2 and (rsum - lsum) % 9 == 0:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
left = 0
right = 0
left_ques = 0
right_ques = 0
for i in range(n):
	if i < n // 2:
		if s[i] == '?':
			left_ques += 1
		else:
			left += int(s[i])
	elif s[i] == '?':
		right_ques += 1
	else:
		right += int(s[i])
x = min(left_ques, right_ques)
left_ques -= x
right_ques -= x
if left_ques == 0 and right_ques == 0:
	if left == right:
		print('Bicarp')
	else:
		print('Monocarp')
elif left_ques == 0:
	if right_ques % 2 == 0:
		x = 9 * (right_ques // 2) + right
		if x == left:
			print('Bicarp')
		else:
			print('Monocarp')
	else:
		print('Monocarp')
elif left_ques % 2 == 0:
	x = 9 * (left_ques // 2) + left
	if x == right:
		print('Bicarp')
	else:
		print('Monocarp')
else:
	print('Monocarp')


import sys
n = int(sys.stdin.readline().strip())
m = n // 2
s = sys.stdin.readline().strip()
s1 = 0
s2 = 0
x1 = 0
x2 = 0
for i in range(0, m):
	if s[i] == '?':
		x1 = x1 + 1
	else:
		s1 = s1 + int(str(s[i]))
	if s[m + i] == '?':
		x2 = x2 + 1
	else:
		s2 = s2 + int(str(s[m + i]))
if s1 + x1 // 2 * 9 == s2 + x2 // 2 * 9:
	print('Bicarp')
else:
	print('Monocarp')


import os
import sys
from math import *
from collections import *
from heapq import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

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

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
a = [i for i in input()]
left = 0
right = 0
d = 0
for i in range(n):
	if i < n // 2:
		if a[i] == '?':
			left += 1
		else:
			d -= int(a[i])
	elif a[i] == '?':
		right += 1
	else:
		d += int(a[i])
tot = left + right
win = 0
if tot % 2 == 0:
	if d == 0:
		if left == right:
			win = 1
		else:
			win = 0
	else:
		over = min(left, right)
		tot -= 2 * over
		tot //= 2
		if abs(d) == tot * 9:
			win = 1
		if d < 0 and left > right or (d > 0 and left < right):
			win = 0
if win:
	print('Bicarp')
else:
	print('Monocarp')


import sys
input = sys.stdin.readline
n = int(input())
s = str(input().strip())
(L, R, LS, RS) = (0, 0, 0, 0)
for ch in s[:n // 2]:
	if ch == '?':
		L += 1
	else:
		LS += int(ch)
for ch in s[n // 2:]:
	if ch == '?':
		R += 1
	else:
		RS += int(ch)
diff = LS - RS
ans = (R - L) // 2 * 9 == diff
print(['Monocarp', 'Bicarp'][ans])


from math import ceil
N = int(input())
S = input()
fEmpty = 0
fSum = 0
sEmpty = 0
sSum = 0
for i in range(N >> 1):
	if S[i] != '?':
		fSum += int(S[i])
	else:
		fEmpty += 1
for i in range(N >> 1, N):
	if S[i] != '?':
		sSum += int(S[i])
	else:
		sEmpty += 1
fSum += ceil(fEmpty / 2) * 9
sSum += ceil(sEmpty / 2) * 9
if fSum >= sSum:
	if sSum >= fSum:
		print('Bicarp')
	else:
		print('Monocarp')
elif fSum >= sSum:
	print('Bicarp')
else:
	print('Monocarp')


a = int(input())
s = input()
q1 = 0
sum1 = 0
q2 = 0
sum2 = 0
for i in range(len(s) // 2):
	if s[i] == '?':
		q1 += 1
	else:
		sum1 += int(s[i])
for i in range(len(s) // 2, len(s)):
	if s[i] == '?':
		q2 += 1
	else:
		sum2 += int(s[i])
if q1 == 0 and q2 == 0:
	if sum1 == sum2:
		print('Bicarp')
	else:
		print('Monocarp')
else:
	temp1 = sum1
	temp2 = sum2
	if q1 == q2:
		if temp1 == temp2:
			print('Bicarp')
		else:
			print('Monocarp')
		exit()
	if q1 % 2 == 0:
		temp1 += q1 // 2 * 9
		temp2 += q2 // 2 * 9
	else:
		temp1 += q1 // 2 * 9 + 9
		temp2 += q2 // 2 * 9 + 9
	if temp1 != temp2:
		print('Monocarp')
	else:
		print('Bicarp')


def b4_ticket_game(n, s):
	l = 0
	r = 0
	for i in range(n):
		if s[i] != '?':
			if i < n // 2:
				l += int(s[i])
				r += int(s[i])
			else:
				l -= int(s[i])
				r -= int(s[i])
		elif i < n // 2:
			r += 9
		else:
			l -= 9
	if l + r == 0:
		return True
	else:
		return False
n = int(input())
s = input()
result = b4_ticket_game(n, s)
if result:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
fer = 0
f = 0
l = 0
ler = 0
for i in range(int(n / 2)):
	if s[i] == '?':
		fer += 1
	else:
		f += int(s[i])
for i in range(int(n / 2), n):
	if s[i] == '?':
		ler += 1
	else:
		l += int(s[i])
if (fer + ler) % 2:
	print('Monocarp')
elif f < l:
	if l - f == 9 * ((fer - ler) / 2):
		print('Bicarp')
	else:
		print('Monocarp')
elif f - l == 9 * ((ler - fer) / 2):
	print('Bicarp')
else:
	print('Monocarp')


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))
n = I()
s = input()
(a, b) = (s[:n // 2], s[n // 2:])
(p, q) = (0, 0)
(c, d) = (0, 0)
for i in range(n // 2):
	if a[i] == '?':
		p += 1
	else:
		c += int(a[i])
	if b[i] == '?':
		q += 1
	else:
		d += int(b[i])
if q > p:
	(p, q) = (q, p)
	(c, d) = (d, c)
diff = 9 * (p - q) // 2
if diff == d - c:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
(s1, s2, c1, c2, ans) = (0, 0, 0, 0, 0)
for i in range(n // 2):
	if s[i] == '?':
		c1 += 1
	else:
		s1 += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		c2 += 1
	else:
		s2 += int(s[i])
k = (c1 + c2) // 2
c = c1 // 2 + c1 % 2
(x1, y1) = (s1 + c * 9, s2 + (c2 - (k - c)) * 9)
c = c2 // 2 + c2 % 2
(x2, y2) = (s2 + c * 9, s1 + (c1 - (k - c)) * 9)
if y1 >= x1 and y2 >= x2:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
(l, r) = (0, 0)
(l_t, r_t) = (0, 0)
for i in s[:n // 2]:
	if i == '?':
		l += 1
	else:
		l_t += int(i)
for i in s[n // 2:]:
	if i == '?':
		r += 1
	else:
		r_t += int(i)
if l_t > r_t and r > l:
	tem = (r - l) // 2
	if tem * 9 == l_t - r_t:
		print('Bicarp')
	else:
		print('Monocarp')
elif l_t < r_t and r < l:
	tem = (l - r) // 2
	if tem * 9 == r_t - l_t:
		print('Bicarp')
	else:
		print('Monocarp')
elif l_t == r_t and r == l:
	print('Bicarp')
else:
	print('Monocarp')


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

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

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

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

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

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	n = int(input())
	s = list(input())
	first_part_sum = 0
	for i in range(n // 2):
		if s[i] == '?':
			first_part_sum += 4.5
		else:
			first_part_sum += int(s[i])
	for i in range(n // 2, n):
		if s[i] == '?':
			first_part_sum -= 4.5
		else:
			first_part_sum -= int(s[i])
	if first_part_sum == 0:
		print('Bicarp')
	else:
		print('Monocarp')
t = 1
for _ in range(t):
	solve()


n = int(input())
s = input()
left_cnt = 0
right_cnt = 0
left_num = 0
right_num = 0
for i in range(n // 2):
	if s[i] == '?':
		left_cnt += 1
	else:
		left_num += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		right_cnt += 1
	else:
		right_num += int(s[i])
if left_cnt == right_cnt:
	if left_num == right_num:
		print('Bicarp')
	else:
		print('Monocarp')
	exit()
diff = left_cnt - right_cnt
diff_num = left_num - right_num
if -diff_num == 9 * (diff // 2):
	print('Bicarp')
else:
	print('Monocarp')


ii = lambda : int(input())
kk = lambda : map(int, input().split())
ll = lambda : list(kk())
(n, digs) = (ii(), input())
d1 = [int(digs[i]) for i in range(n // 2) if digs[i] != '?']
d2 = [int(digs[i]) for i in range(n // 2, n) if digs[i] != '?']
missing = n - len(d1) - len(d2)
if len(d1) > len(d2):
	(d1, d2) = (d2, d1)
m1 = n // 2 - len(d1)
m2 = n // 2 - len(d2)
n1 = sum(d1)
n2 = sum(d2)
min1 = n1 + 9 * missing // 2
max1 = n1 + 9 * m1
max2 = n2 + 9 * m2
min2 = n2
if max(min1, min2) > min(max1, max2):
	print('Monocarp')
	exit()
min1 = n1
max1 = n1 + 9 * (m1 - missing // 2)
if max(min1, min2) > min(max1, max2):
	print('Monocarp')
	exit()
print('Bicarp')


n = int(input())
str = input()
L = 0
R = 0
for i in range(n):
	if i < n // 2:
		if str[i] == '?':
			L += 9
		else:
			L += 2 * (ord(str[i]) - ord('0'))
	elif str[i] == '?':
		R += 9
	else:
		R += 2 * (ord(str[i]) - ord('0'))
print('Bicarp' if L == R else 'Monocarp')


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)
import operator as op
from io import BytesIO, IOBase
import sys, os
import threading
threading.stack_size(2 ** 27)

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

def lin():
	return list(map(int, stdin.readline().split()))
import math
ceil = math.ceil
log = math.log
gcd = math.gcd

def main():
	n = iin()
	a = list(input())
	l = a[:n // 2]
	r = a[n // 2:]
	(ch1, ch2) = (l.count('?'), r.count('?'))
	(ch3, ch4) = ((ch1 + 1) // 2, (ch2 + 1) // 2)
	(cl, cr) = (0, 0)
	for i in l:
		if i != '?':
			cl += int(i)
	for i in r:
		if i != '?':
			cr += int(i)
	if cl + ch3 * 9 != cr + ch4 * 9:
		print('Monocarp')
	else:
		print('Bicarp')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def Print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


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

def f(x):
	(q, s) = (0, 0)
	for c in x:
		if c == '?':
			q += 1
		else:
			s += int(c)
	return (q, s)
(lq, ls) = f(x[:n // 2])
(rq, rs) = f(x[n // 2:])
lmin = ls
lmax = ls + 9 * lq
rmin = rs
rmax = rs + 9 * rq
lc = lmin + lmax
rc = rmin + rmax
if lc == rc and (lq + rq) % 2 == 0:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = list(input())
sum_start = 0
sum_end = 0
miss_start = 0
miss_end = 0
for i in range(n):
	if i + 1 > n // 2:
		if s[i] == '?':
			miss_end += 1
		else:
			sum_end += int(s[i])
	elif s[i] == '?':
		miss_start += 1
	else:
		sum_start += int(s[i])
diff_start = sum_start - sum_end + 9 * (miss_start // 2)
if miss_start % 2:
	diff_start += 9
diff_end = sum_end - sum_start + 9 * (miss_end // 2)
if miss_end % 2:
	diff_end += 9
negotiate_end = 9 * (miss_end // 2)
if miss_end % 2:
	negotiate_end += 9
negotiate_start = 9 * (miss_start // 2)
if miss_start % 2:
	negotiate_start += 9
if diff_start > negotiate_end or diff_end > negotiate_start:
	print('Monocarp')
else:
	print('Bicarp')


n = int(input())
l = list(input())
a = 0
b = 0
c = 0
d = 0
for i in range(n // 2):
	if l[i] == '?':
		a += 1
	else:
		c += int(l[i])
for i in range(n // 2, n):
	if l[i] == '?':
		b += 1
	else:
		d += int(l[i])
x = a // 2
if a % 2:
	x += 1
y = b // 2
if b % 2:
	y += 1
if x * 9 + c > y * 9 + d or (a - x) * 9 + c < (b - y) * 9 + d:
	print('Monocarp')
else:
	print('Bicarp')


n = int(input())
s = input()
kv1 = 0
kv2 = 0
sum1 = 0
sum2 = 0
for i in range(n):
	if s[i] == '?':
		if i < n / 2:
			kv1 += 1
		else:
			kv2 += 1
	elif i < n / 2:
		sum1 += int(s[i])
	else:
		sum2 += int(s[i])
t = (kv1 + kv2) // 2
if sum1 > sum2:
	sum1 += 9 * min(kv1, t)
	kv2 -= t - min(kv1, t)
	sum2 += 9 * min(kv2, t)
else:
	sum2 += 9 * min(kv2, t)
	kv1 -= t - min(kv2, t)
	sum1 += 9 * min(kv1, t)
if sum1 == sum2:
	print('Bicarp')
else:
	print('Monocarp')


from sys import stdin
n = int(stdin.readline())
div = n // 2
digs = stdin.readline().strip()
left = 0
right = 0
leftQ = 0
rightQ = 0
for x in range(div):
	if digs[x] != '?':
		left += int(digs[x]) * 2
	else:
		leftQ += 1
		left += 9
	if digs[div + x] != '?':
		right += int(digs[div + x]) * 2
	else:
		rightQ += 1
		right += 9
if left == right:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
lsum = 0
rsum = 0
for c in s[0:n // 2]:
	if c == '?':
		lsum += 9
	else:
		lsum += 2 * int(c)
for c in s[n // 2:]:
	if c == '?':
		rsum += 9
	else:
		rsum += 2 * int(c)
print('Bicarp' if lsum == rsum else 'Monocarp')


n = int(input())
inp = input()
f = inp[:n // 2]
s = inp[n // 2:]
fsm = sum([ord(x) - ord('0') if x != '?' else 0 for x in f])
ssm = sum([ord(x) - ord('0') if x != '?' else 0 for x in s])
diff = fsm - ssm
fcnt = f.count('?')
scnt = s.count('?')
(blowupdiff, blowupf, blowups) = (diff, fcnt, scnt)
(shrinkdiff, shrinkf, shrinks) = (diff, fcnt, scnt)
trn = True
for _ in range(fcnt + scnt):
	if trn:
		if blowupf:
			blowupf -= 1
			blowupdiff += 9
		else:
			blowups -= 1
		if shrinks:
			shrinks -= 1
			shrinkdiff -= 9
		else:
			shrinkf += 1
	else:
		if blowups:
			blowups -= 1
			blowupdiff -= 9
		else:
			blowupf -= 1
		if shrinkf:
			shrinkf -= 1
			shrinkdiff += 9
		else:
			shrinks -= 1
	trn = not trn
if blowupdiff == 0 or shrinkdiff == 0:
	print('Bicarp')
else:
	print('Monocarp')


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	nonlocal factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	nonlocal fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

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

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	nonlocal memory
	memory = dict()

def cached_fn(fn, *args):
	nonlocal memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = False
fac_warm_up_size = 10 ** 5 + 100
optimise_for_recursion = False

def main():
	n = get_int()
	st = list(stdin.readline().strip())
	(ls, rs, lq, rq) = (0, 0, 0, 0)
	for i in range(n // 2):
		if st[i] == '?':
			lq += 1
		else:
			ls += int(st[i])
	for i in range(n // 2, n):
		if st[i] == '?':
			rq += 1
		else:
			rs += int(st[i])
	if (lq + rq) % 2 == 0 and (lq - rq) // 2 * 9 + ls == rs:
		print('Bicarp')
	else:
		print('Monocarp')
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))
n = ii()
s = input()
l = r = tl = tr = 0
for i in s[:n // 2]:
	if i == '?':
		tl += 1
	else:
		l += int(i)
for i in s[n // 2:]:
	if i == '?':
		tr += 1
	else:
		r += int(i)
if tl == tr == 0:
	print('Bicarp') if l == r else print('Monocarp')
	return
if l + cdiv(tl, 2) * 9 - r > cdiv(tr, 2) * 9 or r + cdiv(tr, 2) * 9 - l > cdiv(tl, 2) * 9:
	print('Monocarp')
else:
	print('Bicarp')


t = int(input())
s = input()
l_sum = 0
r_sum = 0
l_count = 0
r_count = 0
for i in range(0, len(s) // 2):
	if s[i] != '?':
		l_sum += int(s[i])
	else:
		l_count += 1
for i in range(len(s) // 2, len(s)):
	if s[i] != '?':
		r_sum += int(s[i])
	else:
		r_count += 1
if l_sum > r_sum:
	(l_sum, r_sum) = (r_sum, l_sum)
	(l_count, r_count) = (r_count, l_count)
if l_sum == r_sum and l_count == r_count:
	print('Bicarp')
elif l_sum == r_sum and l_count != r_count:
	print('Monocarp')
elif l_sum < r_sum and l_count < r_count:
	print('Monocarp')
elif l_sum < r_sum and l_count == r_count:
	print('Monocarp')
elif l_sum < r_sum and l_count > r_count:
	if l_sum + (l_count - r_count) * 9 // 2 == r_sum:
		print('Bicarp')
	else:
		print('Monocarp')


n = int(input())
lis = list(input())
fi = se = 0
c1 = c2 = 0
for i in range(n):
	if i < n // 2:
		if lis[i] == '?':
			c1 += 1
		else:
			fi += int(lis[i])
	elif lis[i] == '?':
		c2 += 1
	else:
		se += int(lis[i])
if fi == se and c1 == c2:
	print('Bicarp')
elif fi == se and c1 != c2:
	print('Monocarp')
elif fi > se:
	if c1 >= c2:
		print('Monocarp')
	elif (c2 - c1) // 2 * 9 == fi - se:
		print('Bicarp')
	else:
		print('Monocarp')
elif se > fi:
	if c2 >= c1:
		print('Monocarp')
	elif (c1 - c2) // 2 * 9 == se - fi:
		print('Bicarp')
	else:
		print('Monocarp')


import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

def lis():
	return [int(i) for i in input().split()]

def value():
	return int(input())
n = value()
a = input().strip('\n')
(l1, l2) = (a[:n // 2].count('?'), a[n // 2:].count('?'))
s1 = s2 = 0
for i in range(len(a)):
	if i < n // 2:
		s1 += int(a[i]) if a[i] != '?' else 0
	else:
		s2 += int(a[i]) if a[i] != '?' else 0
no = 1
for i in range(l1):
	if s1 > s2:
		if no:
			s1 += 9
		else:
			s1 += 0
	elif no:
		s1 += 0
	else:
		s1 += 9
	no = 1 - no
for i in range(l2):
	if s1 > s2:
		if no:
			s2 += 0
		else:
			s2 += 9
	elif no:
		s2 += 9
	else:
		s2 += 0
	no = 1 - no
if s1 != s2:
	print('Monocarp')
else:
	print('Bicarp')


n = int(input())
a = input()
sum1 = 0
for i in range(n // 2):
	if a[i] == '?':
		sum1 += 4.5
	else:
		sum1 += int(a[i])
for i in range(n // 2, n):
	if a[i] == '?':
		sum1 -= 4.5
	else:
		sum1 -= int(a[i])
if sum1 == 0:
	print('Bicarp')
else:
	print('Monocarp')


def winner(s, n):
	s1 = s[:n // 2]
	s2 = s[n // 2:]
	turns = s.count('?') // 2
	l1 = r1 = l2 = r2 = 0
	for c in s1:
		if c == '?':
			r1 += 9
		else:
			l1 += int(c)
			r1 += int(c)
	for c in s2:
		if c == '?':
			r2 += 9
		else:
			l2 += int(c)
			r2 += int(c)
	if r1 < l2 or r2 < l1:
		return 'True'
	minDif = min(r1 - l2, r2 - l1)
	return minDif < turns * 9
n = int(input())
s = input()
print('Monocarp' if winner(s, n) else 'Bicarp')


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
n = int(input())
s = input()
sum1 = 0
cnt1 = 0
cnt2 = 0
sum2 = 0
for i in range(n // 2):
	if s[i] == '?':
		cnt1 += 1
	else:
		sum1 += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		cnt2 += 1
	else:
		sum2 += int(s[i])
if sum1 == sum2:
	if cnt1 == cnt2:
		print('Bicarp')
	else:
		print('Monocarp')
elif sum1 > sum2 and cnt1 >= cnt2 or (sum1 < sum2 and cnt1 <= cnt2):
	print('Monocarp')
elif sum1 > sum2 and cnt1 <= cnt2:
	if sum2 + abs(cnt1 - cnt2) // 2 * 9 == sum1:
		print('Bicarp')
	else:
		print('Monocarp')
elif sum1 < sum2 and cnt1 >= cnt2:
	if sum1 + abs(cnt1 - cnt2) // 2 * 9 == sum2:
		print('Bicarp')
	else:
		print('Monocarp')
else:
	print('Monocarp')


n = int(input())
s = input()
(a, b) = (0, 0)
(q1, q2) = ([], [])
for i in range(n // 2):
	if s[i] != '?':
		a += int(s[i])
	else:
		q1.append(i)
	if s[n - i - 1] != '?':
		b += int(s[n - i - 1])
	else:
		q2.append(n - i - 1)
a += len(q1) // 2 * 9
b += len(q2) // 2 * 9
if a == b:
	print('Bicarp')
else:
	print('Monocarp')


A = 'Monocarp'
B = 'Bicarp'
n = int(input())
nums = input()
leftsum = sum((int(i) for i in nums[:len(nums) // 2] if i != '?'))
rightsum = sum((int(i) for i in nums[len(nums) // 2:] if i != '?'))
leftrem = len([i for i in nums[:len(nums) // 2] if i == '?'])
rightrem = len([i for i in nums[len(nums) // 2:] if i == '?'])
if (leftrem + rightrem) % 2 == 1:
	print(A)
else:
	diffrem = leftrem - rightrem
	if diffrem == 0:
		if leftsum == rightsum:
			print(B)
		else:
			print(A)
	else:
		diffsum = rightsum - leftsum
		if diffsum == 9 * diffrem // 2:
			print(B)
		else:
			print(A)


n = int(input())
l = list(input())
(first, last) = (0, 0)
(left, right) = (0, 0)
for i in range(n):
	if l[i] == '?':
		if i < n // 2:
			first += 9
		else:
			last += 9
	elif i < n // 2:
		left += 2 * int(l[i])
	else:
		right += 2 * int(l[i])
if first + left - right - last == 0:
	print('Bicarp')
else:
	print('Monocarp')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

def RLL():
	return list(RL())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)

def toord(c):
	return ord(c) - ord('a')

def lcm(a, b):
	return a * b // gcd(a, b)
mod = 998244353
INF = float('inf')
from math import factorial, sqrt, ceil, floor, gcd
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def main():
	n = N()
	s = input()
	(l, r) = (s[:n // 2], s[n // 2:])
	(ls, rs) = (0, 0)
	(ln, rn) = (0, 0)
	for i in l:
		if i == '?':
			ln += 1
			continue
		ls += int(i)
	for i in r:
		if i == '?':
			rn += 1
			continue
		rs += int(i)
	(a, b) = ('Monocarp', 'Bicarp')
	mi = min(ln, rn)
	ln -= mi
	rn -= mi
	if ln < rn:
		(ln, rn) = (rn, ln)
		(ls, rs) = (rs, ls)
	if ln == 0:
		print(b if rs == ls else a)
	else:
		b_hav = ln // 2
		if ls >= rs:
			print(a)
		else:
			dif = rs - ls
			if dif % 9 != 0:
				print(a)
			elif dif == 9 * ln / 2:
				print(b)
			else:
				print(a)
main()


n = int(input())
word = input()
tot = 0
for i in range(n):
	if word[i] == '?':
		inc = 9
	else:
		inc = 2 * int(word[i])
	tot += (2 * (i < n // 2) - 1) * inc
print(['Monocarp', 'Bicarp'][tot == 0])


n = int(input())
n //= 2
s = input()
c = 0
c1 = 0
su = 0
su1 = 0
for i in range(n):
	if s[i] == '?':
		c += 1
	else:
		su += int(s[i])
for i in range(n):
	if s[i + n] == '?':
		c1 += 1
	else:
		su1 += int(s[i + n])
c -= c1
su -= su1
if -su == c // 2 * 9:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
word = input()
print(['Monocarp', 'Bicarp'][0 == sum([9 * (2 * (i < n // 2) - 1) if word[i] == '?' else (4 * (i < n // 2) - 2) * int(word[i]) for i in range(n)])])


n = int(input())
s = input()
hatena = [0, 0]
total = [0, 0]
for i in range(n // 2):
	if s[i] == '?':
		hatena[0] += 1
	else:
		total[0] += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		hatena[1] += 1
	else:
		total[1] += int(s[i])
mono_turn = (sum(hatena) + 1) // 2
bi_turn = sum(hatena) // 2
x = min((hatena[0] + 1) // 2, mono_turn)
y = hatena[1] - x
if total[0] + 9 * hatena[0] > total[1] + 9 * bi_turn:
	print('Monocarp')
elif total[1] + 9 * hatena[1] > total[0] + 9 * bi_turn:
	print('Monocarp')
else:
	print('Bicarp')


n = int(input())
s = input()
p1 = 0
p2 = 0
s1 = 0
s2 = 0
for i in s[:n // 2]:
	if i == '?':
		p1 += 1
	else:
		s1 += int(i)
for i in s[n // 2:]:
	if i == '?':
		p2 += 1
	else:
		s2 += int(i)
if s1 < s2:
	buf = p1
	p1 = p2
	p2 = buf
	buf = s1
	s1 = s2
	s2 = buf
if p1 > p2:
	print('Monocarp')
else:
	p = abs(p1 - p2)
	ss = abs(s1 - s2)
	if ss == p // 2 * 9:
		print('Bicarp')
	else:
		print('Monocarp')


n = int(input())
s = input()

def val(c):
	return 9 if c == '?' else 2 * int(c)
lsum = sum(map(val, s[:n // 2]))
rsum = sum(map(val, s[n // 2:]))
print('Bicarp' if lsum == rsum else 'Monocarp')


n = int(input())
s = input()
sum1 = 0
kol1 = 0
sum2 = 0
kol2 = 0
for i in range(n // 2):
	if s[i] == '?':
		kol1 += 1
	else:
		sum1 += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		kol2 += 1
	else:
		sum2 += int(s[i])
if sum1 > sum2:
	(sum1, sum2, kol1, kol2) = (sum2, sum1, kol2, kol1)
if sum1 == sum2 and kol1 == kol2:
	print('Bicarp')
elif sum1 == sum2 and kol1 != kol2:
	print('Monocarp')
elif (sum2 - sum1) % 9 != 0:
	print('Monocarp')
elif kol1 == kol2 == 0:
	print('Monocarp')
elif (sum2 - sum1) // 9 == (kol1 - kol2) // 2:
	print('Bicarp')
else:
	print('Monocarp')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

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

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count

def main():
	n = int(input())
	S = input()
	s = []
	for i in S:
		if ord('0') <= ord(i) <= ord('9') or i == '?':
			s.append(i)
	l = 0
	r = 0
	lt = 0
	rt = 0
	for i in range(len(s)):
		if ord('0') <= ord(s[i]) <= ord('9'):
			if i < len(s) // 2:
				l += ord(s[i]) - ord('0')
			else:
				r += ord(s[i]) - ord('0')
		elif i < len(s) // 2:
			lt += 1
		else:
			rt += 1
	k = min(lt, rt)
	lt -= k
	rt -= k
	f = 1
	if lt == 0 and rt == 0 and (l != r):
		f = 0
	if lt:
		if not (lt // 2 * 9 + l <= r and -(lt // 2) * 9 - l + r <= 9 * (lt // 2)):
			f = 0
		if not (l <= r and -l + r <= 9 * (lt // 2)):
			f = 0
	if rt:
		lt = rt
		(r, l) = (l, r)
		if not (lt // 2 * 9 + l <= r and -(lt // 2) * 9 - l + r <= 9 * (lt // 2)):
			f = 0
		if not (l <= r and -l + r <= 9 * (lt // 2)):
			f = 0
	if f:
		print('Bicarp')
	else:
		print('Monocarp')
	return
main()


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
import statistics

def main():
	n = inin()
	s = sin()
	x = y = j = k = 0
	for i in range(n):
		if i < n // 2:
			if s[i] == '?':
				x += 1
			else:
				j += int(s[i])
		elif s[i] == '?':
			y += 1
		else:
			k += int(s[i])
	p = x + y
	if p % 2 == 1:
		print('Monocarp')
	elif j == k and x == y:
		print('Bicarp')
	elif (j - k) * (x - y) >= 0:
		print('Monocarp')
	else:
		f = abs(j - k)
		g = abs(x - y) // 2
		if f / g == 9:
			print('Bicarp')
		else:
			print('Monocarp')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


import os
import sys

def solve(s):
	half = len(s) // 2
	t1 = s[:half]
	t2 = s[half:]
	n1 = t1.count('?')
	n2 = t2.count('?')
	(s1, s2) = (sum(map(int, filter(lambda x: x != '?', t))) for t in (t1, t2))
	if n2 > n1:
		(n1, n2, s1, s2) = (n2, n1, s2, s1)
	k = (n1 - n2) // 2
	d = s2 - s1
	if d == 9 * k:
		return 'Bicarp'
	else:
		return 'Monocarp'

def pp(input):
	input()
	print(solve(input().strip()))
if 'pydev' in sys.argv[0]:
	from string_source import string_source, codeforces_parse
	x = 'inputCopy\n4\n0523\noutputCopy\nBicarp\ninputCopy\n2\n??\noutputCopy\nBicarp\ninputCopy\n8\n?054??0?\noutputCopy\nBicarp\ninputCopy\n6\n???00?\noutputCopy\nMonocarp'
	for (q, a) in codeforces_parse(x):
		pp(string_source(q))
		print(a)
		print('----')
else:
	pp(sys.stdin.readline)


n = int(input())
s = input()
left = 0
leftq = 0
for i in range(n // 2):
	if s[i] == '?':
		leftq += 1
	else:
		left += int(s[i])
right = 0
rightq = 0
for i in range(n // 2, n):
	if s[i] == '?':
		rightq += 1
	else:
		right += int(s[i])
if left > right and leftq > rightq or (right > left and rightq > leftq):
	print('Monocarp')
elif left > right and leftq < rightq or (right > left and rightq < leftq):
	if leftq < rightq:
		(left, right) = (right, left)
		(leftq, rightq) = (rightq, leftq)
	leftq -= rightq
	if right - left == leftq // 2 * 9:
		print('Bicarp')
	else:
		print('Monocarp')
elif (left > right or right > left) and rightq == leftq:
	print('Monocarp')
elif left == right and leftq != rightq:
	print('Monocarp')
else:
	print('Bicarp')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
vals = [k for k in input()]
first = 0
n1 = 0
second = 0
n2 = 0
for s in range(n):
	if s <= n // 2 - 1:
		if vals[s] != '?':
			first += int(vals[s])
		else:
			n1 += 1
	elif vals[s] != '?':
		second += int(vals[s])
	else:
		n2 += 1
if first == second:
	if n1 == n2:
		print('Bicarp')
	else:
		print('Monocarp')
elif first < second:
	diff = second - first
	if n1 <= n2:
		print('Monocarp')
	else:
		d1 = n1 - n2
		if d1 // 2 * 9 >= diff and (not (d1 - d1 // 2) * 9 > diff) and (d1 % 2 == 0):
			print('Bicarp')
		else:
			print('Monocarp')
else:
	diff = first - second
	if n2 <= n1:
		print('Monocarp')
	else:
		d1 = n2 - n1
		if d1 // 2 * 9 >= diff and (not (d1 - d1 // 2) * 9 > diff) and (d1 % 2 == 0):
			print('Bicarp')
		else:
			print('Monocarp')


n = int(input())
(a, b1, b2) = ([], [], [])
for (i, j) in enumerate(input()):
	if j == '?':
		if i < n // 2:
			b1.append(i)
		else:
			b2.append(i)
		a.append(0)
	else:
		a.append(int(j))
s1 = sum(a[:n // 2])
s2 = sum(a[n // 2:])
print('Bicarp' if s1 + 9 * (len(b1) + 1) // 2 == s2 + 9 * (len(b2) + 1) // 2 else 'Monocarp')


def main():
	import sys
	n = int(input())
	s = list(input())
	p = 0
	a = 0
	b = 0
	for i in range(n // 2):
		if s[i] == '?':
			a += 1
		else:
			p += int(s[i])
	for i in range(n // 2, n):
		if s[i] == '?':
			b += 1
		else:
			p -= int(s[i])
	if a == b:
		if p == 0:
			print('Bicarp')
		else:
			print('Monocarp')
	elif a > b:
		a -= b
		if -p == a * 9 // 2:
			print('Bicarp')
		else:
			print('Monocarp')
	else:
		b -= a
		if p == b * 9 // 2:
			print('Bicarp')
		else:
			print('Monocarp')
main()


n = int(input())
ln = list(input())
sm1 = 0
sm2 = 0
qs1 = 0
qs2 = 0
for i in range(0, n // 2):
	if ln[i] != '?':
		qs1 += 1
		sm1 += int(ln[i])
	if ln[n // 2 + i] != '?':
		qs2 += 1
		sm2 += int(ln[n // 2 + i])
qs1 = n // 2 - qs1
qs2 = n // 2 - qs2
qs = qs1 + qs2
m = False
if not qs:
	if sm1 != sm2:
		m = True
mx = sm1 + min(qs1, qs // 2) * 9
lft = min(qs2, qs2 - (qs // 2 - qs1))
if mx > lft * 9 + sm2:
	m = True
mx = sm2 + min(qs2, qs // 2) * 9
lft = min(qs1, qs1 - (qs // 2 - qs2))
if mx > lft * 9 + sm1:
	m = True
if m:
	print('Monocarp')
else:
	print('Bicarp')


n = int(input())
a = input()
maxi = sum(map(int, list(a[n // 2:].replace('?', '9')))) - sum(map(int, list(a[:n // 2].replace('?', '0'))))
mini = sum(map(int, list(a[n // 2:].replace('?', '0')))) - sum(map(int, list(a[:n // 2].replace('?', '9'))))
if mini + maxi == 0:
	print('Bicarp')
else:
	print('Monocarp')


def f(q1, q2, k1, k2):
	res1 = res2 = 0
	res1 += (q1 + 1) // 2 * k1
	res1 += q1 // 2 * k2
	res2 += q2 // 2 * k2
	res2 += (q2 + 1) // 2 * k1
	return [res1, res2]
n = int(input())
s = input()
sum_l = sum_r = 0
ql = qr = 0
for i in range(n // 2):
	if s[i] == '?':
		ql += 1
	else:
		sum_l += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		qr += 1
	else:
		sum_r += int(s[i])
mn = float('inf')
mx = float('inf')
kek = [f(ql, qr, 0, 9), f(ql, qr, 9, 0), f(qr, ql, 9, 0)[::-1], f(qr, ql, 0, 9)[::-1]]
lol = []
for x in kek:
	lol.append(x[0] + sum_l - x[1] - sum_r)
lol.sort()
if lol[0] <= 0 <= lol[-1]:
	print('Bicarp')
else:
	print('Monocarp')


N = int(input())
s = input()
leftSum = sum((int(c) for c in s[:N // 2] if c != '?'))
rightSum = sum((int(c) for c in s[N // 2:] if c != '?'))
leftOptions = 0
leftSum = 0
for c in s[:N // 2]:
	if c == '?':
		leftOptions += 1
	else:
		leftSum += int(c)
rightOptions = 0
rightSum = 0
for c in s[N // 2:]:
	if c == '?':
		rightOptions += 1
	else:
		rightSum += int(c)
remaining = abs(leftOptions - rightOptions)
if leftOptions > rightOptions:
	leftSum += remaining // 2 * 9
else:
	rightSum += remaining // 2 * 9
if leftSum == rightSum:
	print('Bicarp')
else:
	print('Monocarp')


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

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

def solve():
	n = ri()
	s = input()
	(s1, s2, b1, b2) = (0, 0, 0, 0)
	for i in range(n // 2):
		if s[i] == '?':
			b1 += 1
		else:
			s1 += int(s[i])
	for i in range(n // 2, n):
		if s[i] == '?':
			b2 += 1
		else:
			s2 += int(s[i])
	if b1 == b2:
		if s1 == s2:
			print('Bicarp')
		else:
			print('Monocarp')
		return
	elif b1 < b2:
		d = (b2 - b1) // 2
		if s2 + d * 9 == s1:
			print('Bicarp')
		else:
			print('Monocarp')
		return
	else:
		d = (b1 - b2) // 2
		if s1 + d * 9 == s2:
			print('Bicarp')
		else:
			print('Monocarp')
mode = 'r'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


a = int(input())
l1 = input()
s = 0
a1 = 0
a2 = 0
c1 = 0
for k in range(a):
	if l1[k] == '?':
		c1 += 1
	else:
		s += int(l1[k])
	if k == int(a / 2) - 1:
		a1 = c1
		a2 = s
if c1 % 2 == 0:
	if a1 <= c1 - a1:
		for i in range(int(c1 / 2) + 1):
			if a1 == i:
				if s - a2 - a2 <= 0:
					if a2 - (s - a2) == 9 * (int(c1 / 2) - i):
						print('Bicarp')
						break
					else:
						print('Monocarp')
						break
				else:
					print('Monocarp')
					break
	else:
		for i in range(int(c1 / 2) + 1):
			if a1 == i + int(c1 / 2):
				if s - a2 - a2 >= 0:
					if s - a2 - a2 == 9 * i:
						print('Bicarp')
						break
					else:
						print('Monocarp')
						break
				else:
					print('Monocarp')
					break
else:
	print('Monocarp')


n = int(input())
a = input()
(c1, s1, c2, s2) = (0, 0, 0, 0)
for i in range(n // 2):
	if a[i] == '?':
		c1 = c1 + 1
	else:
		s1 = s1 + int(a[i])
for i in range(n // 2, n):
	if a[i] == '?':
		c2 = c2 + 1
	else:
		s2 = s2 + int(a[i])
c = abs(c1 - c2)
s = abs(s1 - s2)
if c == 0 and s != 0:
	print('Monocarp')
elif c == 0 and s == 0:
	print('Bicarp')
elif c1 > c2 and s1 > s2:
	print('Monocarp')
elif c1 < c2 and s1 < s2:
	print('Monocarp')
elif c != 0 and s == 0:
	print('Monocarp')
elif c // 2 * 9 == s:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
lsu = 0
rsu = 0
for c in s[0:n // 2]:
	if c == '?':
		lsu += 9
	else:
		lsu += 2 * int(c)
for c in s[n // 2:]:
	if c == '?':
		rsu += 9
	else:
		rsu += 2 * int(c)
print('Bicarp' if lsu == rsu else 'Monocarp')


def main():
	n = int(input())
	a = list(input())
	ls = 0
	rs = 0
	lq = 0
	rq = 0
	for i in range(n // 2):
		if a[i] == '?':
			lq += 1
		else:
			ls += int(a[i])
	for i in range(n // 2, n):
		if a[i] == '?':
			rq += 1
		else:
			rs += int(a[i])
	if ls == rs:
		if lq == rq:
			print('Bicarp')
		else:
			print('Monocarp')
	elif ls > rs:
		if lq < rq and (rq - lq) // 2 * 9 == ls - rs:
			print('Bicarp')
		else:
			print('Monocarp')
	elif rq < lq and (lq - rq) // 2 * 9 == rs - ls:
		print('Bicarp')
	else:
		print('Monocarp')
	return
main()


n = int(input())
s = input()
l = 0
r = 0
for i in range(n // 2):
	if s[i] == '?':
		l += 4.5
	else:
		l += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		r += 4.5
	else:
		r += int(s[i])
if l == r:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
st = input()
wh1 = 0
su1 = 0
for i in range(n // 2):
	if st[i] == '?':
		wh1 += 1
	else:
		su1 += int(st[i])
wh2 = 0
su2 = 0
for i in range(n // 2, n):
	if st[i] == '?':
		wh2 += 1
	else:
		su2 += int(st[i])
if wh1 == 0 and wh2 == 0 and (su1 == su2):
	print('Bicarp')
elif abs(su1 - su2) % 9 != 0:
	print('Monocarp')
elif su1 >= su2:
	wh2 -= (su1 - su2) // 9 * 2
	if wh1 == wh2:
		print('Bicarp')
	else:
		print('Monocarp')
else:
	wh1 -= (su2 - su1) // 9 * 2
	if wh1 == wh2:
		print('Bicarp')
	else:
		print('Monocarp')


n = int(input())
s = input()
pyt = 0
for i in s:
	if i == '?':
		pyt += 1
if pyt % 2 == 1:
	print('Monocarp')
else:
	pyt1 = 0
	pyt2 = 0
	sum1 = 0
	sum2 = 0
	for i in range(n // 2):
		if s[i] == '?':
			pyt1 += 1
		if s[i] != '?':
			sum1 += int(s[i])
	for i in range(n // 2, n):
		if s[i] == '?':
			pyt2 += 1
		if s[i] != '?':
			sum2 += int(s[i])
	if sum1 == -4.5 * (pyt1 - pyt2) + sum2:
		print('Bicarp')
	else:
		print('Monocarp')


from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

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

def si():
	return input()

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

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def solve():
	n = ii()
	s = si()
	(lsum, rsum) = (0, 0)
	(lcnt, rcnt) = (0, 0)
	for i in range(n // 2):
		if s[i] == '?':
			lcnt += 1
		else:
			lsum += ord(s[i]) - 48
	for i in range(n // 2, n):
		if s[i] == '?':
			rcnt += 1
		else:
			rsum += ord(s[i]) - 48
	maxr1 = rsum + ceil(rcnt / 2) * 9
	maxr2 = lsum + ceil(lcnt / 2) * 9
	if maxr2 == maxr1:
		print('Bicarp')
	else:
		print('Monocarp')
solve()


import math as ma
n = int(input())
s = input()
sum_left = 0
sum_right = 0
q_left = 0
q_right = 0
s1 = s[:int(n / 2)]
s2 = s[int(n / 2):]
for i in s1:
	if i == '?':
		q_left += 1
	else:
		sum_left += int(i)
for i in s2:
	if i == '?':
		q_right += 1
	else:
		sum_right += int(i)
k = q_left - q_right
if k > 0:
	if sum_left > sum_right:
		sum_left += ma.ceil(k / 2) * 9
	else:
		sum_left += ma.floor(k / 2) * 9
elif sum_left > sum_right:
	sum_left += ma.floor(k / 2) * 9
else:
	sum_left += ma.ceil(k / 2) * 9
if sum_left == sum_right:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
inp = input()
(sl, sr, qr, ql) = (0, 0, 0, 0)
for i in range(len(inp) // 2):
	if inp[i] == '?':
		ql += 1
	else:
		sl += int(inp[i])
for i in range(n // 2, n):
	if inp[i] == '?':
		qr += 1
	else:
		sr += int(inp[i])
if sl - sr == 9 * (qr - ql) / 2:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
first = s[:n // 2]
second = s[n // 2:]
if first.count('?') > second.count('?'):
	(first, second) = (second, first)
f = first.count('?')
s = second.count('?')
cnt1 = 0
cnt2 = 0
for i in range(n // 2):
	if first[i].isdigit():
		cnt1 += int(first[i])
	if second[i].isdigit():
		cnt2 += int(second[i])
if (s - f) // 2 * 9 == cnt1 - cnt2:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
lsum = lcount = rsum = rcount = 0
for ch in s[:n // 2]:
	if ch == '?':
		lcount += 1
	else:
		lsum += int(ch)
for ch in s[n // 2:]:
	if ch == '?':
		rcount += 1
	else:
		rsum += int(ch)
if lcount > rcount:
	delta = rsum - lsum
	count = lcount - rcount
else:
	delta = lsum - rsum
	count = rcount - lcount
if delta == count // 2 * 9:
	print('Bicarp')
else:
	print('Monocarp')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
n = int(input())
s = input()
(a, b) = (0, 0)
(q1, q2) = ([], [])
for i in range(n // 2):
	if s[i] != '?':
		a += int(s[i])
	else:
		q1.append(i)
	if s[n - i - 1] != '?':
		b += int(s[n - i - 1])
	else:
		q2.append(n - i - 1)
a += len(q1) // 2 * 9
b += len(q2) // 2 * 9
if a == b:
	print('Bicarp')
else:
	print('Monocarp')


for t in range(1):
	n = int(input())
	s = input()
	(count, add) = (0, 0)
	(a, b) = (0, 0)
	for i in range(n // 2):
		if s[i] == '?':
			count += 1
		else:
			a += int(s[i])
	for i in range(n // 2, n):
		if s[i] == '?':
			add += 1
		else:
			b += int(s[i])
	(diff, d, e, c) = (0, 0, 0, 0)
	if count > add and a > b:
		print('Monocarp')
	elif add > count and b > a:
		print('Monocarp')
	elif count >= add and a <= b:
		c = count - add
		d = c // 2 + c % 2
		e = c // 2
		diff = b - a
		if diff >= 9 * e and diff <= 9 * d:
			print('Bicarp')
		else:
			print('Monocarp')
	elif add >= count and a >= b:
		c = add - count
		d = c // 2 + c % 2
		e = c // 2
		diff = a - b
		if diff >= 9 * e and diff <= 9 * d:
			print('Bicarp')
		else:
			print('Monocarp')


n = int(input())
s = input()
diff = 0
q_left = 0
q_right = 0
for i in range(0, n):
	if i < int(n / 2):
		if s[i] == '?':
			q_left += 1
		else:
			diff += int(s[i])
	elif s[i] == '?':
		q_right += 1
	else:
		diff -= int(s[i])
if diff < 0:
	diff = 0 - diff
	t = q_left
	q_left = q_right
	q_right = t
min_q = min(q_left, q_right)
q_left -= min_q
q_right -= min_q
if q_left != 0:
	print('Monocarp')
elif diff == int(q_right / 2) * 9:
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
s = input()
cur_diff = 0
for i in range(n // 2):
	if s[i] != '?':
		cur_diff += int(s[i])
	else:
		cur_diff += 4.5
for i in range(n // 2, n):
	if s[i] != '?':
		cur_diff -= int(s[i])
	else:
		cur_diff -= 4.5
if abs(cur_diff) < 0.5:
	print('Bicarp')
else:
	print('Monocarp')


def solve(cnt1, cnt2, balance):
	diff = 9 * (cnt1 - cnt2) // 2
	return balance + diff != 0
n = int(input())
s = input()
(cnt1, cnt2, balance) = (0, 0, 0)
for i in range(n // 2):
	if s[i] == '?':
		cnt1 += 1
	else:
		balance += ord(s[i]) - ord('0')
for i in range(n // 2, n):
	if s[i] == '?':
		cnt2 += 1
	else:
		balance -= ord(s[i]) - ord('0')
print('Monocarp' if solve(cnt1, cnt2, balance) else 'Bicarp')


def main():
	n = int(input())
	a = list(input())
	ls = 0
	rs = 0
	lq = 0
	rq = 0
	for i in range(n // 2):
		if a[i] == '?':
			lq += 1
		else:
			ls += int(a[i])
	for i in range(n // 2, n):
		if a[i] == '?':
			rq += 1
		else:
			rs += int(a[i])
	maxl = (lq + 1) // 2 * 9
	minl = lq // 2 * 9
	maxr = (rq + 1) // 2 * 9
	minr = rq // 2 * 9
	if maxl + ls == maxr + rs and minl + ls == minr + rs:
		print('Bicarp')
	else:
		print('Monocarp')
	return
main()


N = int(input())
L = 0
R = 0
lq = 0
rq = 0
TK = input()
for i in range(N // 2):
	if TK[i] == '?':
		lq += 1
	else:
		L += int(TK[i])
for i in range(N // 2, N):
	if TK[i] == '?':
		rq += 1
	else:
		R += int(TK[i])
if lq == rq:
	if L == R:
		print('Bicarp')
	else:
		print('Monocarp')
t = abs(lq - rq)
if lq > rq:
	R -= L
	if R < 0:
		print('Monocarp')
	elif t // 2 * 9 == R:
		print('Bicarp')
	else:
		print('Monocarp')
if lq < rq:
	L -= R
	if L < 0:
		print('Monocarp')
	elif t // 2 * 9 == L:
		print('Bicarp')
	else:
		print('Monocarp')


n = int(input())
ticket = input()
left = right = diff = 0
for i in range(n // 2):
	if ticket[i] == '?':
		left += 1
	else:
		diff += int(ticket[i])
for i in range(n // 2, n):
	if ticket[i] == '?':
		right += 1
	else:
		diff -= int(ticket[i])
if left > right:
	temp = left
	left = right
	right = temp
	diff = -diff
bad = (right - left) // 2 * 9
if diff == bad:
	print('Bicarp')
else:
	print('Monocarp')


import sys
from collections import defaultdict
input = lambda : sys.stdin.readline().rstrip()
n = int(input())
s = input()
sa = 0
sb = 0
a = 0
b = 0
for i in range(n):
	if s[i] == '?':
		if i < n // 2:
			a += 1
		else:
			b += 1
	elif i < n // 2:
		sa += int(s[i])
	else:
		sb += int(s[i])
M = 'Monocarp'
B = 'Bicarp'
if sa == sb:
	if a == b:
		print(B)
		exit()
	else:
		print(M)
		exit()
if sa <= sb:
	(sa, sb) = (sb, sa)
	(a, b) = (b, a)
if a == b:
	print(M)
	exit()
elif a > b:
	print(M)
	exit()
else:
	diff = sa - sb
	x = (b - a) // 2
	if diff == 9 * x:
		print(B)
		exit()
	else:
		print(M)
		exit()


n = int(input())
l = list(input())
q1 = q2 = 0
for i in range(n):
	if l[i] == '?':
		l[i] = 0
		if i < n / 2:
			q1 += 1
		else:
			q2 += 1
	else:
		l[i] = ord(l[i]) - ord('0')
s1 = sum(l[:n // 2])
s2 = sum(l[n // 2:])
if q1 == q2:
	if s1 == s2:
		print('Bicarp')
	else:
		print('Monocarp')
elif q1 > q2:
	if (q1 - q2) // 2 * 9 + s1 == s2:
		print('Bicarp')
	else:
		print('Monocarp')
elif (q2 - q1) // 2 * 9 + s2 == s1:
	print('Bicarp')
else:
	print('Monocarp')


I = lambda : int(input())
SI = lambda : input()
M = 'Monocarp'
B = 'Bicarp'

def solve(n, s):
	lsum = 0
	cl = 0
	rsum = 0
	cr = 0
	for i in range(n // 2):
		if s[i] == '?':
			cl += 1
		else:
			lsum += int(s[i])
	for i in range(n // 2, n):
		if s[i] == '?':
			cr += 1
		else:
			rsum += int(s[i])
	dif = lsum - rsum
	if dif == 0:
		if cl == cr:
			print(B)
		else:
			print(M)
		return
	if cl == cr:
		print(M)
		return
	if dif > 0 and cl > cr or (dif < 0 and cl < cr):
		print(M)
		return
	if dif > 0:
		dif = -dif
		(cl, cr) = (cr, cl)
	difc = cl - cr
	if dif + difc // 2 * 9 == 0:
		print(B)
	else:
		print(M)
n = I()
s = SI()
solve(n, s)


length = int(input())
string = list(input())
B = 'Bicarp'
M = 'Monocarp'
value = [0] * 2
blanks = [0] * 2
temp = '0'
for i in range(length // 2):
	temp = string[i]
	if temp == '?':
		blanks[0] += 1
	else:
		value[0] += int(temp)
for i in range(length // 2, length):
	temp = string[i]
	if temp == '?':
		blanks[1] += 1
	else:
		value[1] += int(temp)
if value[1] > value[0]:
	(value[0], value[1]) = (value[1], value[0])
	(blanks[0], blanks[1]) = (blanks[1], blanks[0])
if value[0] == value[1]:
	if blanks[0] == blanks[1]:
		ans = B
	else:
		ans = M
elif blanks[0] >= blanks[1]:
	ans = M
else:
	blankdif = blanks[1] - blanks[0]
	valuedif = value[0] - value[1]
	if valuedif == blankdif * 4.5:
		ans = B
	else:
		ans = M
print(ans)


n = int(input())
s = input()
sum1 = 0
sum2 = 0
blank1 = 0
blank2 = 0
for i in range(n // 2):
	if s[i] == '?':
		blank1 += 1
	else:
		sum1 += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		blank2 += 1
	else:
		sum2 += int(s[i])
if blank1 >= blank2:
	if sum2 - sum1 == 9 * (blank1 - (blank1 + blank2) // 2):
		print('Bicarp')
	else:
		print('Monocarp')
elif sum1 - sum2 == 9 * (blank2 - (blank1 + blank2) // 2):
	print('Bicarp')
else:
	print('Monocarp')


n = int(input())
ch = input()
a1 = 0
a2 = 0
s1 = 0
s2 = 0
for i in range(int(n / 2)):
	if ch[i] == '?':
		a1 += 1
	else:
		s1 += int(ch[i])
for i in range(int(n / 2), n):
	if ch[i] == '?':
		a2 += 1
	else:
		s2 += int(ch[i])
if s1 > s2 and a1 >= a2 or (s2 > s1 and a2 >= a1) or (s1 == s2 and a1 != a2):
	print('Monocarp')
elif s1 > s2:
	b = (a2 - a1) // 2
	if s1 - s2 == b * 9:
		print('Bicarp')
	else:
		print('Monocarp')
elif s2 > s1:
	b = (a1 - a2) // 2
	if s2 - s1 == b * 9:
		print('Bicarp')
	else:
		print('Monocarp')
else:
	print('Bicarp')


n = int(input())
s = input()
(r, delta) = (0, 0)
for i in range(n // 2):
	if s[i] == '?':
		r += 1
	else:
		delta += int(s[i])
for i in range(n // 2, n):
	if s[i] == '?':
		r -= 1
	else:
		delta -= int(s[i])
if r < 0:
	r = -r
	delta = -delta
if delta + 9 * r // 2 == 0:
	print('Bicarp')
else:
	print('Monocarp')


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = input().rstrip()
	b = list(map(int, a.replace('?', '0')))
	c = list(map(int, a.replace('?', '9')))
	if sum(b[:n // 2]) - sum(b[n // 2:]) + sum(c[:n // 2]) - sum(c[n // 2:]) == 0:
		print('Bicarp')
	else:
		print('Monocarp')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


l = int(input())
line = input()
left_side = line[:l // 2]
right_side = line[l // 2:]

def left():
	return line[:l // 2]

def right():
	return line[l // 2:]

def get_sum(side, replacement):
	return sum((int(x) if x != '?' else replacement for x in side))

def get_min_sum(side):
	return get_sum(side, 0)

def get_max_sum(side):
	return get_sum(side, 9)

def str_sub(_str, pos, char):
	return _str[:pos] + char + _str[pos + 1:]
stable = get_max_sum(left()) - get_max_sum(right()) == get_min_sum(right()) - get_min_sum(left())
if stable:
	print('Bicarp')
else:
	print('Monocarp')


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip()
l = 0
ls = 0
for i in range(n // 2):
	if s[i] == '?':
		l += 1
	else:
		ls += int(s[i])
r = 0
rs = 0
for i in range(n // 2, n):
	if s[i] == '?':
		r += 1
	else:
		rs += int(s[i])
if ls - (rs + r * 9) + (ls + 9 * l - rs) != 0:
	print('Monocarp')
else:
	print('Bicarp')


n = int(input())
a = [int(x) if x != '?' else -1 for x in input()]
(left, right) = (a[0:n // 2], a[n // 2:])
sumL = sum((x if x >= 0 else 0 for x in left))
sumR9 = sum((x if x >= 0 else 9 for x in right))
sumL9 = sum((x if x >= 0 else 9 for x in left))
sumR = sum((x if x >= 0 else 0 for x in right))
bigL = sumR9 - sumL < sumL9 - sumR
bw = sumR9 - sumL == sumL9 - sumR
print('Bicarp' if bw else 'Monocarp')

def forr(rr, val, swap, swap2=False):
	global sumL, sumR
	for i in rr:
		if a[i] == -1:
			a[i] = val
			if swap ^ swap2:
				sumR += val
			else:
				sumL += val
			return True
	return False

def it(swap, minVal=0, maxVal=9):
	(l, r) = (range(0, n // 2), range(n // 2, n))
	if swap:
		(l, r) = (r, l)
	if forr(l, maxVal, swap):
		return True
	if forr(r, minVal, swap, True):
		return True
	return False

def mc(swap):
	return it(not swap)

def bc(swap):
	diff = sumR - sumL
	diff = 9 if diff > 9 else diff
	diff = -9 if diff < 9 else diff
	(q, w) = (0, -diff) if diff < 0 else (diff, 9)
	return it(swap, q, w)


n = int(input())
s = input()
s1 = s[:n // 2]
s2 = s[n // 2:]
sum1 = sum(map(int, filter(str.isdigit, s1)))
sum2 = sum(map(int, filter(str.isdigit, s2)))
free1 = s1.count('?')
free2 = s2.count('?')
ans = ''
if free1 == free2:
	if sum1 == sum2:
		ans = 'Bicarp'
	else:
		ans = 'Monocarp'
else:
	if sum1 > sum2:
		(free1, free2) = (free2, free1)
		(sum1, sum2) = (sum2, sum1)
	if free1 <= free2:
		ans = 'Monocarp'
	elif (free1 - free2) // 2 * 9 == sum2 - sum1:
		ans = 'Bicarp'
	else:
		ans = 'Monocarp'
print(ans)


o = input()
inp = input()
count_1 = 0
sum_1 = 0
count_2 = 0
sum_2 = 0
for i in range(len(inp) // 2):
	if inp[i] == '?':
		count_1 += 1
	else:
		sum_1 += int(inp[i])
for j in range(len(inp) // 2):
	i = len(inp) // 2 + j
	if inp[i] == '?':
		count_2 += 1
	else:
		sum_2 += int(inp[i])
if sum_2 - sum_1 == 9 * (count_1 - count_2) // 2:
	print('Bicarp')
else:
	print('Monocarp')


def find(s):
	N = len(s) // 2
	left = 0
	right = 0
	left_v = 0
	right_v = 0
	for i in range(N):
		if s[i] == '?':
			left_v += 1
			continue
		left += int(s[i])
	for i in range(N, 2 * N):
		if s[i] == '?':
			right_v += 1
			continue
		right += int(s[i])
	L = left - (right + right_v * 9)
	R = left + left_v * 9 - right
	return L + R == 0
input()
s = input()
if find(s):
	print('Bicarp')
else:
	print('Monocarp')