In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.

The attitude of each of the companions to the hero is an integer. Initially, the attitude of each of them to the hero of neutral and equal to 0. As the hero completes quests, he makes actions that change the attitude of the companions, whom he took to perform this task, in positive or negative direction.

Tell us what companions the hero needs to choose to make their attitude equal after completing all the quests. If this can be done in several ways, choose the one in which the value of resulting attitude is greatest possible.

Input

The first line contains positive integer n (1 ≤ n ≤ 25) — the number of important tasks. 

Next n lines contain the descriptions of the tasks — the i-th line contains three integers li, mi, wi — the values by which the attitude of Lynn, Meliana and Worrigan respectively will change towards the hero if the hero takes them on the i-th task. All the numbers in the input are integers and do not exceed 107 in absolute value.

Output

If there is no solution, print in the first line "Impossible".

Otherwise, print n lines, two characters is each line — in the i-th line print the first letters of the companions' names that hero should take to complete the i-th task ('L' for Lynn, 'M' for Meliana, 'W' for Worrigan). Print the letters in any order, if there are multiple solutions, print any of them.

Examples

Input

3
1 0 0
0 1 0
0 0 1


Output

LM
MW
MW


Input

7
0 8 9
5 9 -2
6 -8 -7
9 4 5
-4 -9 9
-4 5 2
-6 8 -7


Output

LM
MW
LM
LW
MW
LM
LW


Input

2
1 0 0
1 1 0


Output

Impossible
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    static StringTokenizer st;
    static BufferedReader in;
    static PrintWriter pw;
    static class Sort implements Comparable<Sort> {
        int sum_a, sum_b, sum_c, hash;
        public int compareTo(Sort other) {
            if (this.sum_b-this.sum_a > other.sum_b-other.sum_a)
                return 1;
            if (this.sum_b-this.sum_a < other.sum_b-other.sum_a)
                return -1;
            if (this.sum_c-this.sum_a > other.sum_c-other.sum_a)
                return 1;
            if (this.sum_c-this.sum_a < other.sum_c-other.sum_a)
                return -1;
            if (this.sum_a > other.sum_a)
                return 1;
            if (this.sum_a < other.sum_a)
                return -1;
            return 0;
        }
    }
    public static void main(String[] args) throws IOException{
        in = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int[]a = new int[n+1], b = new int[n+1], c = new int[n+1];
        for (int i = 1; i <= n; i++) {
            a[i] = nextInt();
            b[i] = nextInt();
            c[i] = nextInt();
        }
        if (n==1) {
            if (a[1]==0 && b[1]==0) {
                System.out.println("LM");
            }
            else if (a[1]==0 && c[1]==0)
                System.out.println("LW");
            else if (b[1]==0 && c[1]==0)
                System.out.println("MW");
            else
                System.out.println("Impossible");
            return;
        }
        int[]comb = new int[n+1];
        Sort[]s = new Sort[600000];
        int cnt = 0;
        int[]pow_3 = new int[100];
        pow_3[0] = 1;
        for (int i = 1; i < pow_3.length; i++) {
            pow_3[i] = pow_3[i-1] * 3;
        }
        while (true) {
            int sum_a = 0, sum_b = 0, sum_c = 0, hash = 0;
            for (int i = 1; i <= n/2; i++) {
                if (comb[i]==0) {
                    sum_a += a[i];
                    sum_b += b[i];
                }
                else if (comb[i]==1) {
                    sum_a += a[i];
                    sum_c += c[i];
                }
                else {
                    sum_b += b[i];
                    sum_c += c[i];
                }
                hash += comb[i] * pow_3[n/2-i];
            }
            cnt++;
            s[cnt] = new Sort();
            s[cnt].sum_a = sum_a;
            s[cnt].sum_b = sum_b;
            s[cnt].sum_c = sum_c;
            s[cnt].hash = hash;
            boolean last = true;
            for (int i = n/2; i >= 1; i--) {
                if (comb[i] != 2) {
                    comb[i]++;
                    last = false;
                    for (int j = i+1; j <= n / 2; j++) {
                        comb[j] = 0;
                    }
                    break;
                }
            }
            if (last)
                break;
        }
        Arrays.sort(s, 1, cnt+1);
        int[]sum_a = new int[cnt+1], sum_b = new int[cnt+1], sum_c = new int[cnt+1], hash = new int[cnt+1];
        for (int i = 1; i <= cnt; i++) {
            sum_a[i] = s[i].sum_a;
            sum_b[i] = s[i].sum_b;
            sum_c[i] = s[i].sum_c;
            hash[i] = s[i].hash;
        }
        int max = -1000000000, hash1 = 0, hash2 = 0;
        while (true) {
            int s_a = 0, s_b = 0, s_c = 0, h = 0;
            for (int i = n/2+1; i <= n; i++) {
                if (comb[i]==0) {
                    s_a += a[i];
                    s_b += b[i];
                }
                else if (comb[i]==1) {
                    s_a += a[i];
                    s_c += c[i];
                }
                else {
                    s_b += b[i];
                    s_c += c[i];
                }
                h += comb[i] * pow_3[n-i];
            }
            int left = 1, right = cnt+1;
            while (right-left > 1) {
                int midd = (left+right) >> 1;
                if (comp(s_a-s_b, s_a-s_c, sum_b[midd]-sum_a[midd], sum_c[midd]-sum_a[midd]))
                    right = midd;
                else
                    left = midd;
            }
            if (s_a-s_b==sum_b[left]-sum_a[left] && s_a-s_c==sum_c[left]-sum_a[left]) {
                if (s_a + sum_a[left] > max) {
                    max = s_a + sum_a[left];
                    hash1 = hash[left];
                    hash2 = h;
                }
            }
            boolean last = true;
            for (int i = n; i >= n/2+1; i--) {
                if (comb[i] != 2) {
                    comb[i]++;
                    last = false;
                    for (int j = i+1; j <= n; j++) {
                        comb[j] = 0;
                    }
                    break;
                }
            }
            if (last)
                break;
        }
        if (max==-1000000000)
            System.out.println("Impossible");
        else {
            String s1 = Integer.toString(hash1, 3);
            while (s1.length() != n/2)
                s1 = "0"+s1;
            String s2 = Integer.toString(hash2, 3);
            while (s1.length()+s2.length() != n)
                s2 = "0"+s2;
            s1 += s2;
            for (int i = 0; i < n; i++) {
                if (s1.charAt(i)=='0')
                    System.out.println("LM");
                else if (s1.charAt(i)=='1')
                    System.out.println("LW");
                else
                    System.out.println("MW");
            }
        }
        pw.close();
    }
    private static boolean comp(int x1, int y1, int x2, int y2) {
        return x1 < x2 || x1==x2 && y1 < y2;
    }
    private static int nextInt() throws IOException{
        return Integer.parseInt(next());
    }
    private static double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }
    private static long nextLong() throws IOException{
        return Long.parseLong(next());
    }
    private static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
}