#include <bits/stdc++.h>
using namespace std;
int N, a[30], b[30], c[30];
map<pair<int, int>, int> h;
map<pair<int, int>, int> val;
int x1, x2;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%d%d%d", &a[i], &b[i], &c[i]);
  }
  int nr = N / 2;
  int pw = 1;
  for (int i = 1; i <= nr; ++i) {
    pw *= 3;
  }
  for (int i = 0; i < pw; ++i) {
    int x = i, A = 0, B = 0, C = 0;
    for (int j = 1; j <= nr; ++j) {
      if (x % 3 != 0) {
        A += a[j];
      }
      if (x % 3 != 1) {
        B += b[j];
      }
      if (x % 3 != 2) {
        C += c[j];
      }
      x /= 3;
    }
    pair<int, int> p = make_pair(A - B, B - C);
    if (h.find(p) == h.end()) {
      h[p] = A;
      val[p] = i;
    } else {
      if (A > h[p]) {
        h[p] = A;
        val[p] = i;
      }
    }
  }
  if (N % 2) {
    pw *= 3;
  }
  int rez = -1000000000;
  for (int i = 0; i < pw; ++i) {
    int x = i, A = 0, B = 0, C = 0;
    for (int j = 1; j <= N - nr; ++j) {
      if (x % 3 != 0) {
        A += a[nr + j];
      }
      if (x % 3 != 1) {
        B += b[nr + j];
      }
      if (x % 3 != 2) {
        C += c[nr + j];
      }
      x /= 3;
    }
    pair<int, int> p = make_pair(B - A, C - B);
    if (h.find(p) != h.end()) {
      if (A + h[p] > rez) {
        rez = A + h[p];
        x1 = val[p];
        x2 = i;
      }
    }
  }
  if (rez == -1000000000) {
    cout << "Impossible";
    return 0;
  }
  for (int j = 1; j <= nr; ++j) {
    if (x1 % 3 == 0) {
      cout << "MW\n";
    }
    if (x1 % 3 == 1) {
      cout << "LW\n";
    }
    if (x1 % 3 == 2) {
      cout << "LM\n";
    }
    x1 /= 3;
  }
  for (int j = 1; j <= N - nr; ++j) {
    if (x2 % 3 == 0) {
      cout << "MW\n";
    }
    if (x2 % 3 == 1) {
      cout << "LW\n";
    }
    if (x2 % 3 == 2) {
      cout << "LM\n";
    }
    x2 /= 3;
  }
  return 0;
}
