import sys

sys.setrecursionlimit(20000)

games = {}
# 0 - пусто, 1 - боковая, 2 - центральная, 4 - другая боковая
def turns(upper):
    return \
        { 0 : [1, 2]
        , 1 : [3, 5]
        , 2 : [3]
        , 3 : [7]
        , 5 : [7]
        , 7 : []
        } [upper]

stables = [2, 3, 5, 7]

def stable(upper):
    return upper in stables 

def turnsFromFull(now):
    full, centerBorder, upper = now
    res = []
    # Хапаем одну из полного слоя и перекладываем
    if full > 0:
        # Докладываем в верхний слой, новый верхний не образуется
        for to in turns(upper):
            # Достали из центра
            res.append((full - 1, centerBorder, to))
            # Достали сбоку
            res.append((full - 1, centerBorder + 1, to))
        # Образуем новый верхний слой, если можно
        if stable(upper):
            # Наверху две боковых
            if upper == 5:
                for to in turns(0):
                    # Достали из центра и положили наверх to
                    res.append((full - 1, centerBorder, to))
                    # Достали сбоку и положили наверх to
                    res.append((full - 1, centerBorder + 1, to))
            # Наверху только центральная
            elif upper == 2:
                for to in turns(0):
                    res.append((full - 1, centerBorder, to))
                    res.append((full - 1, centerBorder + 1, to))
            # Наверху боковая и центральная 
            elif upper == 3:
                for to in turns(0):
                    res.append((full - 1, centerBorder + 1, to))
                    res.append((full - 1, centerBorder + 2, to))
            # Наверху всё
            elif upper == 7:
                for to in turns(0):
                    res.append((full, centerBorder, to))
                    res.append((full, centerBorder + 1, to))
    return res

def turnsFromCB(now):
    full, centerBorder, upper = now
    res = []
    # Теперь забираем из слоя вида <боковая, центральная>
    if centerBorder > 0:
        for to in turns(upper):
            res.append((full, centerBorder - 1, to))
        if stable(upper):
            if upper == 5:
                for to in turns(0):
                    res.append((full, centerBorder - 1, to))
            elif upper == 2:
                for to in turns(0):
                    res.append((full, centerBorder - 1, to))
            elif upper == 3:
                for to in turns(0):
                    res.append((full, centerBorder, to))
            elif upper == 7:
                for to in turns(0):
                    res.append((full + 1, centerBorder - 1, to))
    return res

def turnsLiftUpper(now):
    full, centerBorder, upper = now
    res = []
    for to in stables:
        if not upper in turns(to):
            continue
        newUpper = upper - to
        if newUpper == 4:
            newUpper = 1
        newCenterBorder = centerBorder
        if to == 3:
            newCenterBorder += 1
        res.append((full, newCenterBorder, newUpper))
    return res

def play(now):
    full, centerBorder, upper = now
    if now in games:
        return games[now]
    turns = turnsFromFull(now) + turnsFromCB(now) + turnsLiftUpper(now)
    win = not all(map(play, turns)) 
    games[(full, centerBorder, upper)] = win
    #print (now, " ", win)
    return win

IN = open('jenga.in')
n = int(IN.readline())
full, centerBound = 0, 0
for i in range(n):
    last = (a, b, c) = tuple(map(int, IN.readline().split()))
    if i == n - 1:
        continue
    if (a, b, c) == (1, 1, 1):
        full += 1
    elif (a == 1 and b == 1) or (b == 1 and c == 1):
        centerBound += 1

if last == (1, 1, 1):
    last = 7
elif last == (1, 0, 1):
    last = 5
elif last == (1, 1, 0) or last == (0, 1, 1):
    last = 3
elif last == (1, 0, 0) or last == (0, 0, 1):
    last = 1
elif last == (0, 1, 0):
    last = 2
else:
    assert False

out = open('jenga.out', 'w')
if play((full, centerBound, last)):
    print ("Alex", file=out)
else:
    print ("Igor", file=out)

