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
#include <bits/stdc++.h>
using namespace std;
int a[25][3];
int b[26];
map<pair<int, int>, pair<int, int> > mp;
int main() {
  int n, ans = -1e9, c1, c2, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
  if (n == 1) {
    if (a[0][0] == 0 && a[0][1] == 0) {
      puts("LM");
    } else if (a[0][0] == 0 && a[0][2] == 0) {
      puts("LW");
    } else if (a[0][1] == 0 && a[0][2] == 0) {
      puts("MW");
    } else {
      puts("Impossible");
    }
    return 0;
  }
  b[0] = 1;
  for (i = 1; i <= n; i++) b[i] = b[i - 1] * 3;
  for (i = 0; i < b[(n + 1) / 2]; i++) {
    int x = 0, y = 0, z = 0, p = i;
    for (j = 0; j < (n + 1) / 2; j++) {
      if (p % 3 == 0) {
        y += a[j][1];
        z += a[j][2];
      } else if (p % 3 == 1) {
        x += a[j][0];
        z += a[j][2];
      } else {
        x += a[j][0];
        y += a[j][1];
      }
      p /= 3;
    }
    if (!mp.count(make_pair(y - x, z - x)) ||
        mp[make_pair(y - x, z - x)].first < x) {
      mp[make_pair(y - x, z - x)] = make_pair(x, i);
    }
  }
  for (i = 0; i < b[n / 2]; i++) {
    int x = 0, y = 0, z = 0, p = i;
    for (j = 0; j < n / 2; j++) {
      if (p % 3 == 0) {
        y += a[j + (n + 1) / 2][1];
        z += a[j + (n + 1) / 2][2];
      } else if (p % 3 == 1) {
        x += a[j + (n + 1) / 2][0];
        z += a[j + (n + 1) / 2][2];
      } else {
        x += a[j + (n + 1) / 2][0];
        y += a[j + (n + 1) / 2][1];
      }
      p /= 3;
    }
    if (mp.count(make_pair(x - y, x - z)) &&
        mp[make_pair(x - y, x - z)].first + x > ans) {
      ans = mp[make_pair(x - y, x - z)].first + x;
      c1 = mp[make_pair(x - y, x - z)].second;
      c2 = i;
    }
  }
  if (ans == -1e9) {
    puts("Impossible");
  } else {
    for (i = 0; i < (n + 1) / 2; i++) {
      if (c1 % 3 == 0) {
        puts("MW");
      } else if (c1 % 3 == 1) {
        puts("LW");
      } else {
        puts("LM");
      }
      c1 /= 3;
    }
    for (i = 0; i < n / 2; i++) {
      if (c2 % 3 == 0) {
        puts("MW");
      } else if (c2 % 3 == 1) {
        puts("LW");
      } else {
        puts("LM");
      }
      c2 /= 3;
    }
  }
  return 0;
}
