#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30;
int pow3[MAXN];
int n, tasks[MAXN][3], maxa = -2000000000;
int ans[MAXN];
map<pair<int, int>, pair<int, int> > m;
int main() {
  ios_base::sync_with_stdio(false);
  if (fopen("test.in", "r")) {
    freopen("test.in", "r", stdin);
  }
  cin >> n;
  pow3[0] = 1;
  for (int i = 1; i <= n; i++) {
    pow3[i] = 3 * pow3[i - 1];
  }
  for (int i = 0; i < n; i++) {
    cin >> tasks[i][0] >> tasks[i][1] >> tasks[i][2];
  }
  for (int i = 0; i < pow3[n / 2]; i++) {
    int suma = 0, sumb = 0, sumc = 0;
    int tmpi = i;
    for (int j = 0; j < n / 2; j++) {
      if (tmpi % 3 == 0) {
        sumb += tasks[j][1];
        sumc += tasks[j][2];
      } else if (tmpi % 3 == 1) {
        suma += tasks[j][0];
        sumc += tasks[j][2];
      } else {
        suma += tasks[j][0];
        sumb += tasks[j][1];
      }
      tmpi /= 3;
    }
    pair<int, int> p(suma - sumb, sumb - sumc);
    if (m.find(p) == m.end() || m[p].first < suma) {
      m[p] = make_pair(suma, i);
    }
  }
  for (int i = 0; i < pow3[n - n / 2]; i++) {
    int suma = 0, sumb = 0, sumc = 0;
    int tmpi = i;
    for (int j = 0; j < (n - n / 2); j++) {
      if (tmpi % 3 == 0) {
        sumb += tasks[j + n / 2][1];
        sumc += tasks[j + n / 2][2];
      } else if (tmpi % 3 == 1) {
        suma += tasks[j + n / 2][0];
        sumc += tasks[j + n / 2][2];
      } else {
        suma += tasks[j + n / 2][0];
        sumb += tasks[j + n / 2][1];
      }
      tmpi /= 3;
    }
    pair<int, int> p(sumb - suma, sumc - sumb);
    if (m.find(p) != m.end()) {
      if (m[p].first + suma > maxa) {
        fill(ans, ans + n, 0);
        int tmpii = m[p].second;
        for (int j = 0; j < n / 2; j++) {
          ans[j] = tmpii % 3;
          tmpii /= 3;
        }
        tmpi = i;
        for (int j = 0; j < (n - n / 2); j++) {
          ans[j + n / 2] = tmpi % 3;
          tmpi /= 3;
        }
        maxa = m[p].first + suma;
      }
    }
  }
  if (maxa == -2000000000) {
    cout << "Impossible" << '\n';
  } else {
    for (int i = 0; i < n; i++) {
      if (ans[i] == 0) {
        cout << "MW" << '\n';
      } else if (ans[i] == 1) {
        cout << "LW" << '\n';
      } else {
        cout << "LM" << '\n';
      }
    }
  }
  return 0;
}
