#include <bits/stdc++.h>
using namespace std;
pair<int, int> res, k;
map<pair<int, int>, pair<int, int> > Mp;
int n, L[26], M[26], W[26], l, mx = -(1LL << 30);
long long ans = -1, bas = 1;
void fDFS(int now, int v, int a, int b, int c) {
  if (now == 0) {
    res = make_pair(b - a, c - a);
    k = make_pair(v, a);
    if (Mp.find(res) == Mp.end())
      Mp[res] = k;
    else if (Mp[res].second < a)
      Mp[res] = k;
    return;
  }
  fDFS(now - 1, v * 3 + 0, a, b + M[now], c + W[now]);
  fDFS(now - 1, v * 3 + 1, a + L[now], b, c + W[now]);
  fDFS(now - 1, v * 3 + 2, a + L[now], b + M[now], c);
  return;
}
void sDFS(int now, int v, int a, int b, int c) {
  if (now == l) {
    res = make_pair(a - b, a - c);
    if (Mp.find(res) == Mp.end()) return;
    long long t = 1ll * (Mp[res].first) + 1ll * v * bas;
    if (a + Mp[res].second > mx) ans = t, mx = a + Mp[res].second;
    return;
  }
  sDFS(now - 1, v * 3 + 0, a, b + M[now], c + W[now]);
  sDFS(now - 1, v * 3 + 1, a + L[now], b, c + W[now]);
  sDFS(now - 1, v * 3 + 2, a + L[now], b + M[now], c);
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d %d %d", &L[i], &M[i], &W[i]);
  l = n / 2;
  fDFS(l, 0, 0, 0, 0);
  for (int i = 1; i <= l; i++) bas *= 3;
  sDFS(n, 0, 0, 0, 0);
  if (ans == -1) {
    puts("Impossible");
    return 0;
  }
  for (int i = 1, p; i <= n; i++) {
    p = ans % 3;
    if (p == 0) puts("MW");
    if (p == 1) puts("LW");
    if (p == 2) puts("LM");
    ans /= 3;
  }
  return 0;
}
