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
3
7089544 9134148 -5332724
368810 1638695 7889905
-3866235 -4257263 5802154
 16
-3253484 -6513322 5617669
-8870526 9976385 -7313669
5682511 -1202928 -7057533
4747064 475782 7416790
-4387656 3965849 9530503
-8224426 4339650 181725
1012598 -8651198 -222828
-1012251 -9099337 719019
-903577 -1340167 -8701346
-4502739 736866 -5741036
-6125650 9410041 948124
-8344882 3820318 3738053
5202105 524964 2938536
752123 2136713 -3095341
545090 -6807501 -5000825
5921735 5822186 4106753
 11
-368 775 -959
-281 483 -979
685 902 211
-336 63 458
116 -957 -802
-856 751 -608
956 -636 -17
561 186 228
-301 -807 304
-103 -476 18
-579 116 850
 15
-3682462 -194732 9446852
-4405738 6933459 -9496709
9422280 7851074 -9960800
1002721 -4735302 -6724485
-9025771 7592049 106547
2508567 -9291847 8728657
-558387 1839538 -8263150
9066346 1788798 -111846
3033903 -7178126 -2777630
9282416 2652252 -8446308
-7520805 -9819190 -9526851
6504744 3375811 8450106
-9694972 5307787 622433
1364366 -7259170 5463805
8696617 5410821 5813911
 1
0 0 1
 14
167 -30 -195
-8 604 701
592 -402 168
-982 12 592
929 999 -200
-37 645 615
512 -553 515
-830 743 -574
436 -815 180
-787 420 906
733 226 -650
295 -571 7
-879 739 369
-124 801 -253
 17
5145283 -2753062 -2936514
-2127587 9440797 -4470168
4109762 -1351398 1013844
-5272277 -916706 -402190
-7510148 -8867866 -2714993
2254647 7293040 7375284
-3027010 -8436598 -585941
9910514 4179567 -7552626
4295472 -8584445 -5072169
6661724 9675368 7315049
-3327283 -7829466 -4900987
-6243053 -2828295 -6456626
7489319 -7983760 -3082241
-8134992 -6899104 -2317283
9790680 -3222471 2050981
-8211631 2874090 544657
-4219486 848554 -287544
 17
881 984 -560
-272 527 537
944 135 782
265 652 73
340 995 -116
-625 -197 -859
-515 584 416
709 -144 -5
-187 -95 228
646 -711 -647
892 -824 -177
442 -258 622
-527 -715 155
-110 -417 857
-72 -547 531
86 597 454
-332 57 -731
 9
-477 504 222
30 698 346
-142 168 -322
162 371 219
-470 417 -102
-104 -236 785
131 -686 870
420 -289 -333
743 -611 111
 16
6742718 -9848759 -3874332
-8128485 -6617274 1575011
-1740148 623444 9963227
3629451 -2414107 -9704466
7753671 7021614 7248025
-5420494 6909667 5118838
4090028 3512092 -6413023
282544 8907950 5863326
-9977956 -7405023 8905548
-7480107 6149899 3468303
-5494025 2101036 8801937
-5351537 7051449 69239
137681 -9994993 -2053076
-4251695 8203962 -4620459
8897087 -7891039 5515252
916961 2371338 -6986487
 1
0 0 0
 16
4642484 -2788746 9992951
5803062 8109045 72477
6993256 5860518 -5298508
2983494 5924807 9075779
9616987 -7580870 -2342882
2620968 -2619488 2599421
1318060 -7292211 3454517
-7018501 -2464950 9497459
2254377 -2500546 -1888489
-20354 -7510645 173023
619811 -861516 -6346093
38813 3848272 -8558276
6409071 4528454 -9768150
-9344900 3107745 4779111
5984141 2896281 2888362
-9097994 -8937736 -419949
 8
697 78 -270
17 240 64
615 6 967
565 486 -862
517 -17 -852
958 949 505
199 -866 711
251 -177 549
 17
-9095076 8052666 -1032018
2681359 -9998418 -3163796
5865270 -1926467 -6480441
-2780849 5921425 -7844112
2813688 -9288645 -8474670
8145658 -5741326 9011572
9364418 -8442485 -8888763
3473152 -1301704 -2502205
4201907 8497194 9692725
8874792 537379 8954057
2083242 -3975356 -62337
-3654609 2243771 8422585
7822816 9702585 -3007717
-6801114 -3025102 -6129158
7033485 7157201 -6012950
-7895796 -6052792 9119000
-932955 4934837 -873726
 17
8003952 1945229 -824287
-2548751 860618 589233
4195712 -3840408 7878690
-3178201 -1509129 6136806
-1406078 3402700 -3298516
-2639343 -7312210 -7052356
5744330 -228480 5806356
-7992147 -9663118 6294695
-4197990 8982179 4355332
-406724 -362338 -3609437
-6459171 -4710527 6551785
4054102 -9505148 2215175
-2286309 728140 -2206363
7183109 -8393962 -5369491
-7303376 328150 5437901
8549874 8031324 -4716139
-5998559 -3896390 2664375
 7
-925 88 -550
205 406 -957
-596 259 -448
857 635 719
-149 -487 -85
245 -59 78
-870 -959 -733
 10
-134 5 -71
-615 -591 -548
626 -787 -682
-392 -689 900
-93 789 194
-657 438 806
308 219 129
-247 -220 -358
-720 -841 -974
833 -845 -268
 16
-885 -621 -319
500 705 -709
-376 -884 -102
346 176 448
611 954 -23
-372 -993 177
-288 -977 -777
-966 -644 867
834 -561 984
-868 545 789
340 0 782
754 -263 518
112 -747 -944
-760 -624 383
353 -654 -341
-451 477 -819
 1
0 1 0
 1
1 0 0
 16
2033906 6164819 -3535254
-7271523 -1386302 -5832930
7664268 -7927384 -8316758
-5929014 6352246 8535844
-5992054 -3159960 5973202
8477561 5763594 7527604
-1611804 3925028 -9320743
-3732863 -7513881 7445368
7044279 6186756 -87415
6810089 -9828741 -8531792
2105994 -4192310 -1962547
4522049 5717418 -2009682
-5638994 7361890 -2071446
-6518199 -670199 3519089
-5881880 3506792 -7813715
3774507 -5501152 2112631
 25
26668 10412 12658
25216 11939 10247
28514 22515 5833
4955 19029 22405
12552 6903 19634
12315 1671 505
20848 9175 6060
12990 5827 16433
9184 30621 25596
31818 7826 11221
18090 4476 30078
30915 11014 16950
3119 29529 21390
775 4290 11723
29679 14840 3566
4491 29480 2079
24129 5496 6381
20849 25772 9299
10825 30424 11842
18290 14728 30342
24893 27064 11604
26248 7490 18116
17182 32158 12518
23145 4288 7754
18544 25694 18784
 15
74 716 -568
-958 -441 167
-716 -554 -403
-364 934 395
-673 36 945
-102 -227 69
979 -721 -132
790 -494 292
-781 -478 -545
-591 -274 965
-46 -983 -835
37 -540 -375
-417 139 -761
772 969 -197
-74 -975 -662
 6
1 0 1
1 1 0
0 1 1
0 1 1
1 1 0
1 0 1
 17
3461788 -7190737 790707
-3979181 -7527409 1464659
3368847 -7475254 -7377314
-2469024 9316013 6583991
8223943 9596309 7549117
1525938 3840013 -9805857
2489326 7215738 -5874041
-6183012 596945 5059562
3412087 6788437 939017
9690067 -2007875 -1424714
834164 5247338 -6872328
3860491 8096731 -2390366
8174160 7465170 4040376
-5138898 -2348036 -9154464
1527659 -4375219 -2725794
-5350381 -8411693 214736
-5832848 -6704847 4997762
 3
1 0 0
0 1 0
0 0 1
 13
-495 262 21
148 188 374
935 67 567
-853 -862 -164
-878 990 -80
824 536 934
254 -436 -310
355 803 -627
30 409 -624
-212 -950 182
582 96 738
316 221 -341
-178 691 3
 12
-749 66 -780
293 440 891
-404 -787 -159
454 68 -675
105 116 -121
516 849 470
603 208 -583
333 110 17
-591 818 252
-313 -131 -370
-865 61 309
583 306 536
 18
59 502 341
-464 -595 655
161 617 569
179 284 -667
418 430 239
803 105 385
770 -807 -223
-154 47 560
-886 -907 -533
-723 -728 -584
676 715 460
779 26 -894
26 989 -364
-390 738 241
246 683 220
-716 -752 722
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
using namespace std;
const string x[] = {"LM", "LW", "MW"};
int cost[30][3], up;
map<pair<int, int>, pair<int, int> > dp[30];
void dfs(int pos, int A, int B, int C, int path) {
  if (pos == up + 1) {
    pair<int, int> cur = make_pair(B - A, C - A);
    pair<int, int> val = make_pair(A, path);
    auto it = dp[up].find(cur);
    if (it == dp[up].end() || (it->second) < val) {
      dp[up][cur] = val;
    }
    return;
  }
  dfs(pos + 1, A + cost[pos][0], B + cost[pos][1], C, (path << 2) | 0);
  dfs(pos + 1, A + cost[pos][0], B, C + cost[pos][2], (path << 2) | 1);
  dfs(pos + 1, A, B + cost[pos][1], C + cost[pos][2], (path << 2) | 2);
}
int main() {
  int n, L, M, W, p1, p2;
  scanf("%d", &n);
  for (int i = 0; i < (int)n; ++i) {
    scanf("%d %d %d", &L, &M, &W);
    cost[i][0] = L;
    cost[i][1] = M;
    cost[i][2] = W;
  }
  if (n == 1) {
    if (L == 0 && M == 0 && W == 0) {
      printf("LM\n");
    } else
      printf("Impossible\n");
    return 0;
  }
  up = n / 2 - 1;
  dfs(0, 0, 0, 0, 0);
  up = n - 1;
  dfs(n / 2, 0, 0, 0, 0);
  int mx = INT_MIN;
  for (auto it = dp[n / 2 - 1].begin(); it != dp[n / 2 - 1].end(); ++it) {
    pair<int, int> cur = it->first;
    cur.first = -cur.first;
    cur.second = -cur.second;
    auto ptr = dp[n - 1].find(cur);
    if (ptr != dp[n - 1].end()) {
      int vv = (ptr->second).first + (it->second).first;
      if (vv > mx) {
        mx = vv;
        p1 = (it->second).second;
        p2 = (ptr->second).second;
      }
    }
  }
  if (mx == INT_MIN)
    printf("Impossible\n");
  else {
    vector<int> res(n);
    for (int i = n / 2 - 1; i >= 0; --i) {
      res[i] = (p1 & 3);
      p1 >>= 2;
    }
    for (int i = n - 1; i >= n / 2; --i) {
      res[i] = (p2 & 3);
      p2 >>= 2;
    }
    for (int i = 0; i < n; ++i) {
      printf("%s\n", x[res[i]].c_str());
    }
  }
  return 0;
}
