#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 5;
const int INF = 1e9;
int w[30][3], n;
struct Bucket {
  int mask;
  int a[3];
  int ref_a;
  Bucket() {
    memset(a, 0, sizeof(a));
    mask = 0;
  }
  Bucket(int _a, int _b, int _c, int A = -1) {
    a[0] = _a;
    a[1] = _b;
    a[2] = _c;
    ref_a = A;
  }
  bool operator<(const Bucket& b2) const {
    if (a[0] == b2.a[0]) {
      if (a[1] == b2.a[1]) {
        if (a[2] == b2.a[2]) return ref_a < b2.ref_a;
        return a[2] < b2.a[2];
      }
      return a[1] < b2.a[1];
    }
    return a[0] < b2.a[0];
  }
};
vector<Bucket> v[2];
void go(int idx, int e, Bucket buck, vector<Bucket>& v) {
  if (idx == e) {
    v.push_back(buck);
    return;
  }
  buck.mask *= 3;
  for (int i = 0; i < 3; i++) {
    Bucket tmp_buck = buck;
    for (int j = 0; j < 3; j++) {
      if (i != j) {
        tmp_buck.a[j] += w[idx][j];
      }
    }
    tmp_buck.mask += i;
    go(idx + 1, e, tmp_buck, v);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 3; j++) scanf("%d", &w[i][j]);
  go(0, n / 2, Bucket(), v[0]);
  go(n / 2, n, Bucket(), v[1]);
  for (int i = 0; i < v[1].size(); i++) {
    Bucket& b = v[1][i];
    b.ref_a = b.a[0];
    for (int k = 0; k < 3; k++) b.a[k] -= b.ref_a;
  }
  sort(v[1].begin(), v[1].end());
  int msk1 = -1, msk2 = -1;
  int mx_val = -INF;
  int itr = 0;
  for (Bucket b : v[0]) {
    int idx = upper_bound(v[1].begin(), v[1].end(),
                          Bucket(0, b.a[0] - b.a[1], b.a[0] - b.a[2], INF)) -
              v[1].begin();
    if (idx) {
      idx--;
      Bucket tmp = v[1][idx];
      if (tmp.a[1] == b.a[0] - b.a[1] && tmp.a[2] == b.a[0] - b.a[2]) {
        int cmn_val = b.a[0] + tmp.ref_a;
        if (cmn_val > mx_val) {
          mx_val = cmn_val;
          msk1 = b.mask;
          msk2 = tmp.mask;
        }
      }
    }
    itr++;
  }
  if (mx_val == -INF)
    printf("Impossible\n");
  else {
    vector<int> l1, l2;
    for (int i = 0; i < n / 2; i++) {
      l1.push_back(msk1 % 3);
      msk1 /= 3;
    }
    for (int i = n / 2; i < n; i++) {
      l2.push_back(msk2 % 3);
      msk2 /= 3;
    }
    reverse(l1.begin(), l1.end());
    reverse(l2.begin(), l2.end());
    for (int i = 0; i < l1.size(); i++) {
      if (l1[i] == 0)
        printf("MW\n");
      else if (l1[i] == 1)
        printf("LW\n");
      else
        printf("LM\n");
    }
    for (int i = 0; i < l2.size(); i++) {
      if (l2[i] == 0)
        printf("MW\n");
      else if (l2[i] == 1)
        printf("LW\n");
      else
        printf("LM\n");
    }
  }
  return 0;
}
