import java.io.*;
import java.util.*;

public class jenga_pk {

	PrintWriter out;
	BufferedReader br;
	StringTokenizer st;

	String nextToken() throws IOException {
		while ((st == null) || (!st.hasMoreTokens()))
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	class State {
		int countDouble, countTriple, last;

		public State(int countDouble, int countTriple, int last) {
			super();
			this.countDouble = countDouble;
			this.countTriple = countTriple;
			this.last = last;
		}

		@Override
		public String toString() {
			return "State [countDouble=" + countDouble + ", countTriple="
					+ countTriple + ", last=" + last + "]";
		}
		
		
	}
	
	public void solve() throws IOException {
		int n = nextInt();
		int countDouble = 0;
		int countTriple = 0;
		for (int i = 0; i < n - 1; i++) {
			int a = nextInt();
			int b = nextInt();
			int c = nextInt();
			
			if ((a + b + c == 3)) {
				countTriple++;
				continue;
			}
			
			if ((a + b == 2) || (b + c == 2)) {
				countDouble++;
				continue;
			}
		}
		
		int last = 0;
		last = nextInt() + nextInt() * 2 + nextInt() * 4;
		
		byte[][][] game = new byte[n + n][n + n][8];
		boolean[][][] was = new boolean[n + n][n + n][8];
		ArrayList<State> q = new ArrayList<jenga_pk.State>();
		q.add(new State(countDouble, countTriple, last));
		set(was, q.get(0));
		for (int i = 0; i < q.size(); i++) {
			State cur = q.get(i);
			genAllTurns(cur, was, q);
		}
		//System.err.println(q.toString());
		Collections.reverse(q);
		for (int i = 0; i < q.size(); i++) {
			setResult(game, q.get(i));
		}
		Collections.reverse(q);
		out(game, q.get(0));
		
	}

	private void out(byte[][][] game, State x) {
		int t = game[x.countDouble][x.countTriple][x.last];
		if (t == 1) {
			out.println("Alex");
		} else {
			out.println("Igor");
		}
	}

	private void setResult(byte[][][] game, State state) {
		if (game[state.countDouble][state.countTriple][state.last] != 0)
			return;
		ArrayList<State> turns = allTurns(state);
		for (State x : turns) {
			setResult(game, x);
		}
		if (turns.size() == 0) {
			game[state.countDouble][state.countTriple][state.last] = -1;
			return;
		}
		
		for (State x : turns) {
			int t = game[x.countDouble][x.countTriple][x.last];
			if (t == -1) {
				game[state.countDouble][state.countTriple][state.last] = 1;
				return;
			}
			//System.err.println(":)");
			if (t == 0) {
				//System.err.println(x);
				throw new AssertionError();
			}
		}
		game[state.countDouble][state.countTriple][state.last] = -1;
		
	}

	private void genAllTurns(State cur, boolean[][][] was, ArrayList<State> q) {
		ArrayList<State> turns = allTurns(cur);
		//System.err.println(turns.toString());
		for (State x : turns) {
			if (!check(was, x)) {
				set(was, x);
				q.add(x);
			}
		}
	}

	private void set(boolean[][][] was, State state) {
		was[state.countDouble][state.countTriple][state.last] = true;
	}
	
	private boolean check(boolean[][][] was, State state) {
		return was[state.countDouble][state.countTriple][state.last];
	}
	
	private boolean isStable(int mask) {
		int a = (mask & 4) / 4;
		int b = (mask & 2) / 2;
		int c = (mask & 1);
		if (a + b + c > 1)
			return true;
		if (b == 1)
			return true;
		return false;
	}
	
	private ArrayList<State> allTurns(State x) {
		ArrayList<State> res = new ArrayList<jenga_pk.State>();
		
		if (x.countDouble > 0) {
			for (int i = 0; i < 3; i++) {
				if ((x.last & (1 << i)) == 0) {
					res.add(new State(x.countDouble - 1, x.countTriple, x.last | (1 << i)));
				}
			}
			if (isStable(x.last)) {
				int newCountDouble = x.countDouble - 1;
				newCountDouble += isGoodDouble(x.last);
				int newCountTriple = x.countTriple;
				newCountTriple += isGoodTriple(x.last);
				for (int i = 0; i < 3; i++) {
						res.add(new State(newCountDouble, newCountTriple, 1 << i));
				}
			}
		}
		
		if (x.countTriple > 0) {
			for (int i = 0; i < 3; i++) {
				if ((x.last & (1 << i)) == 0) {
					res.add(new State(x.countDouble, x.countTriple - 1, x.last | (1 << i)));
				}
				if ((x.last & (1 << i)) == 0) {
					res.add(new State(x.countDouble + 1, x.countTriple - 1, x.last | (1 << i)));
				}
			}
			if (isStable(x.last)) {
				int newCountDouble = x.countDouble + 1;
				newCountDouble += isGoodDouble(x.last);
				int newCountTriple = x.countTriple - 1;
				newCountTriple += isGoodTriple(x.last);
				for (int i = 0; i < 3; i++) {
						res.add(new State(newCountDouble, newCountTriple, 1 << i));
				}
			}
			
			if (isStable(x.last)) {
				int newCountDouble = x.countDouble;
				newCountDouble += isGoodDouble(x.last);
				int newCountTriple = x.countTriple - 1;
				newCountTriple += isGoodTriple(x.last);
				for (int i = 0; i < 3; i++) {
						res.add(new State(newCountDouble, newCountTriple, 1 << i));
				}
			}
		}
		
		if ((isGoodDouble(x.last) == 1) || ((isGoodTriple(x.last)) == 1)) {
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j < 3; j++) {
					if ((x.last & (1 << i)) == 0)
						continue;
					int newLast = x.last ^ (1 << i);
					if (!isStable(newLast))
						continue;
					int newCountDouble = x.countDouble + isGoodDouble(newLast);
					res.add(new State(newCountDouble, x.countTriple, 1 << i));
				}
			}
		}
		
		return res;
		
	}

	private int isGoodDouble(int mask) {
		int a = (mask & 4) / 4;
		int b = (mask & 2) / 2;
		int c = mask & 1;
		if (a + b + c == 3)
			return 0;
		if (a + b == 2)
			return 1;
		if (b + c == 2)
			return 1;
		return 0;
	}
	
	private int isGoodTriple(int mask) {
		int a = (mask & 4) / 4;
		int b = (mask & 2) / 2;
		int c = mask & 1;
		if (a + b + c == 3)
			return 1;
		return 0;
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			br = new BufferedReader(new FileReader("jenga.in"));
			out = new PrintWriter("jenga.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new jenga_pk().run();
	}
}
