Mike and Ann are sitting in the classroom. The lesson is boring, so they decided to play an interesting game. Fortunately, all they need to play this game is a string $s$ and a number $k$ ($0 \le k < |s|$).

At the beginning of the game, players are given a substring of $s$ with left border $l$ and right border $r$, both equal to $k$ (i.e. initially $l=r=k$). Then players start to make moves one by one, according to the following rules: A player chooses $l^{\prime}$ and $r^{\prime}$ so that $l^{\prime} \le l$, $r^{\prime} \ge r$ and $s[l^{\prime}, r^{\prime}]$ is lexicographically less than $s[l, r]$. Then the player changes $l$ and $r$ in this way: $l := l^{\prime}$, $r := r^{\prime}$. Ann moves first. The player, that can't make a move loses.

Recall that a substring $s[l, r]$ ($l \le r$) of a string $s$ is a continuous segment of letters from s that starts at position $l$ and ends at position $r$. For example, "ehn" is a substring ($s[3, 5]$) of "aaaehnsvz" and "ahz" is not.

Mike and Ann were playing so enthusiastically that they did not notice the teacher approached them. Surprisingly, the teacher didn't scold them, instead of that he said, that he can figure out the winner of the game before it starts, even if he knows only $s$ and $k$.

Unfortunately, Mike and Ann are not so keen in the game theory, so they ask you to write a program, that takes $s$ and determines the winner for all possible $k$.


-----Input-----

The first line of the input contains a single string $s$ ($1 \leq |s| \leq 5 \cdot 10^5$) consisting of lowercase English letters.


-----Output-----

Print $|s|$ lines.

In the line $i$ write the name of the winner (print Mike or Ann) in the game with string $s$ and $k = i$, if both play optimally


-----Examples-----
Input
abba

Output
Mike
Ann
Ann
Mike

Input
cba

Output
Mike
Mike
Mike

Difficulty: competition

Starter code:

Solutions:
s = input()
m = chr(ord('z') + 1)
ans = []
f = 0
for i in s:
    if i > m:
        ans.append('Ann')
    else:
        ans.append('Mike')
    m = min(m, i)
print('\n'.join(ans))

s = input()
chuj = [ord(s[i]) for i in range(len(s))]
n = len(chuj)
print("Mike")
mini = 100000
for i in range(1, n):
	mini = min(mini, chuj[i - 1])
	if mini < chuj[i]:
		print("Ann")
	else:
		print("Mike")


s = input()
min = s[0]
l = []
for i in s:
    if(min < i):
        l.append("Ann")
    else:
        l.append("Mike")
        min = i
for i in l:
    print(i)

s = input()
mi = 'z'
for x in s:
    if x > mi:
        print('Ann')
    else:
        print('Mike')
    mi = min(x, mi)


s = input()
min_letter = 'z'
for k in range(len(s)):
    if min_letter < s[k]:
        print("Ann")
    else:
        print("Mike")
    min_letter = min(min_letter, s[k])

s = input()
min_val = 9999
for c in s:
    if min_val < ord(c):
        print('Ann')
    else:
        print('Mike')
    min_val = min(min_val, ord(c))

s=input()
mi=s[0]
for i in s:
    if mi>=i:
        mi=i
        print("Mike")
    else:
        print("Ann")
        


s = input()
mn = 1000
for elem in s:
    if mn < ord(elem):
        print('Ann')
    else:
        print('Mike')
        mn = ord(elem)


s = input()
l = len(s)
d = [s[0] for i in range(l)]
print('Mike')
for i in range(1, l):
    d[i] = min(d[i - 1], s[i])
    if d[i] < s[i]:
        print('Ann')
    else:
        print('Mike')

s = input()
win1 = "Ann"
win2 = "Mike"
alth = "abcdefghijklmnopqrstuvwxyz"
num = alth.find(s[0])
for i in s:
    num2 = alth.find(i)
    if num < num2:
        print(win1)
    else:
        print(win2)
    num = min(num,num2)

s = input()
pref = [s[0]]
for i in range(1, len(s)):
    pref.append(min(pref[i - 1], s[i]))
for k in range(len(s)):
    if pref[k] >= s[k]:
        print('Mike')
    else:
        print('Ann')


a = input()
l = []
mi = 999999999999999
for i in a:
    k = ord(i) - 97
    if k > mi:
        l.append("1")
    else:
        l.append("0")
        mi = k
for i in l:
    print(i.replace("1", "Ann").replace("0", "Mike"))

s = input()
m = ord(s[0])
for i in range(0, len(s)):
	a = ord(s[i])
	f = False
	if a > m:
		f = True
	else:
		m = a
	print('Mike' if not f else 'Ann')

s=input()
n=len(s)
smallest=ord(s[0])
print ("Mike")
for i in range(1,n):
	if smallest<ord(s[i]):
		print ("Ann")
	else:
		print ("Mike")
		smallest=ord(s[i])


l = input()
mini = 1000000
for i in range(len(l)):
    if ord(l[i]) > mini:
        print("Ann")
    else:
        print("Mike")
    mini = min(mini, ord(l[i]))

S = input()

max_before = [] 
smallest_so_far = S[0]

print("Mike")

for s in S[1:]:
    if s > smallest_so_far:
        print("Ann")
    else:
        print("Mike")
    smallest_so_far = min(smallest_so_far, s)


a=list(input())
arr='z'
for item in a:
    if arr<item:
        print('Ann')
    else:
        print('Mike')
    if item<arr:
        arr=item


import sys


for line in sys.stdin:
    lexfirst = '{'
    for c in line[:-1]:
        if lexfirst >= c:
            print('Mike')
            lexfirst = c
        else:
            print('Ann')
    quit()


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


s=input().strip('\n')
c=Counter(s)
l=sorted(list(c))
ans=[]
# print(s)
mi=[1]*(len(s))
curr = s[0]
for i in range(1,len(s)):
    if curr<s[i]:mi[i]=0
    curr=min(curr,s[i])
    
    
for i in range(len(s)):
    # print(i)
    if i==0 or mi[i]:
        ans.append('Mike')
    else:
        ans.append('Ann')
for i in ans:print(i)


s = input().rstrip()
minimum = "z"
for ch in s:
    if ch > minimum:
        print("Ann")
    else:
        print("Mike")
        minimum = ch

A = input()

n = len(A)

m = A[0]

print("Mike")

for i in range(1, n):
	if m < A[i]:
		print("Ann")
	else:
		print("Mike")

	m = min(m, A[i])


s = input()
a = [ord(c) - ord('a') + 1 for c in s]
#print(a)

res = [0] * len(s)
mi = a[0]
print("Mike")
for i in range(1, len(s)):
	#print(a[i], i, mi)
	if a[i] > mi:
		print("Ann")
	else:
		mi = a[i]
		print("Mike")


import math
from decimal import Decimal
import heapq
def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return n,b
 
 
def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return n,b,c
 
 
def dv():
	n, m = list(map(int, input().split()))
	return n,m
 
 
def dva():
	n, m = list(map(int, input().split()))
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return n,m,b
 
 
def eratosthenes(n): 
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))
 
 
def lol(lst,k):
	k=k%len(lst)
	ret=[0]*len(lst)
	for i in range(len(lst)):
		if i+k<len(lst) and i+k>=0:
			ret[i]=lst[i+k]
		if i+k>=len(lst):
			ret[i]=lst[i+k-len(lst)]
		if i+k<0:
			ret[i]=lst[i+k+len(lst)]
	return(ret)
def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return n,b,m,c
 
 
def dvs():
	n = int(input())
	m = int(input())
	return n, m 
def Factor(n):
	Ans = []
	d = 2
	while d * d <= n:
		if n % d == 0:
			Ans.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		Ans.append(n)
	return Ans


s = input()
a1 = 'Mike'
a2 = 'Ann'
if len(s) == 1:
	print(a1)
	return
print(a1)
tc = s[0]
pre = []
n = len(s)
for i in range(1, n):
	d = min(s[i], tc)
	pre.append(d)
	tc = d
for i in range(1, n):
	if pre[i - 1] < s[i]:
		print(a2)
	else:
		print(a1)


s = input()
minc = s[0]
for c in s:
    print('Ann' if minc < c else 'Mike')
    minc = min(c, minc)

"""
NTC here
"""
from sys import setcheckinterval, stdin, setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10**7)
 
# print("Case #{}: {} {}".format(i, n + m, n * m))
 
 
def iin(): return int(stdin.readline())
 
 
def lin(): return list(map(int, stdin.readline().split()))

s=input()
a=[]
i=0
l=len(s)
least='z'
while i<l:
    x=s[i]
    least=min(x,least)
    while i<l and s[i]==x:
        if least<x:
            a.append('Ann')
        else:
            a.append('Mike')
        i+=1
print(*a,sep='\n')