Rick and Morty are playing their own version of Berzerk (which has nothing in common with the famous Berzerk game). This game needs a huge space, so they play it with a computer.

In this game there are *n* objects numbered from 1 to *n* arranged in a circle (in clockwise order). Object number 1 is a black hole and the others are planets. There's a monster in one of the planet. Rick and Morty don't know on which one yet, only that he's not initially in the black hole, but Unity will inform them before the game starts. But for now, they want to be prepared for every possible scenario.

Each one of them has a set of numbers between 1 and *n* - 1 (inclusive). Rick's set is *s*<sub class="lower-index">1</sub> with *k*<sub class="lower-index">1</sub> elements and Morty's is *s*<sub class="lower-index">2</sub> with *k*<sub class="lower-index">2</sub> elements. One of them goes first and the player changes alternatively. In each player's turn, he should choose an arbitrary number like *x* from his set and the monster will move to his *x*-th next object from its current position (clockwise). If after his move the monster gets to the black hole he wins.

Your task is that for each of monster's initial positions and who plays first determine if the starter wins, loses, or the game will stuck in an infinite loop. In case when player can lose or make game infinity, it more profitable to choose infinity game.
The first line of input contains a single integer *n* (2 ≤ *n* ≤ 7000) — number of objects in game.

The second line contains integer *k*<sub class="lower-index">1</sub> followed by *k*<sub class="lower-index">1</sub> distinct integers *s*<sub class="lower-index">1, 1</sub>, *s*<sub class="lower-index">1, 2</sub>, ..., *s*<sub class="lower-index">1, *k*<sub class="lower-index">1</sub></sub> — Rick's set.

The third line contains integer *k*<sub class="lower-index">2</sub> followed by *k*<sub class="lower-index">2</sub> distinct integers *s*<sub class="lower-index">2, 1</sub>, *s*<sub class="lower-index">2, 2</sub>, ..., *s*<sub class="lower-index">2, *k*<sub class="lower-index">2</sub></sub> — Morty's set

1 ≤ *k*<sub class="lower-index">*i*</sub> ≤ *n* - 1 and 1 ≤ *s*<sub class="lower-index">*i*, 1</sub>, *s*<sub class="lower-index">*i*, 2</sub>, ..., *s*<sub class="lower-index">*i*, *k*<sub class="lower-index">*i*</sub></sub> ≤ *n* - 1 for 1 ≤ *i* ≤ 2.
none
5
2 3 2
3 1 2 3
Lose Win Win Loop
Loop Win Win Win
8
4 6 2 3 4
2 3 6
Win Win Win Win Win Win Win
Lose Win Lose Lose Win Lose Lose
10
3 4 7 5
2 8 5
Win Win Win Win Win Win Win Loop Win
Lose Win Loop Lose Win Lose Lose Lose Lose
17
1 10
1 12
Win Win Win Win Win Win Win Win Win Win Win Lose Win Win Win Win
Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose
23
1 20
3 9 2 12
Lose Lose Win Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose
Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win
85
12 76 7 75 51 43 41 66 13 59 48 81 73
3 65 60 25
Loop Loop Loop Win Loop Loop Loop Loop Win Win Loop Win Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Win Loop Loop Loop Loop Win Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loo...
100
84 80 73 28 76 21 44 97 63 59 6 77 41 2 8 71 57 19 33 46 92 5 61 88 53 68 94 56 14 35 4 47 17 79 84 10 67 58 45 38 13 12 87 3 91 30 15 11 24 55 62 39 83 43 89 1 81 75 50 86 72 18 52 78 7 29 64 42 70 49 37 25 66 74 95 36 85 48 99 60 51 98 27 40 93
47 52 76 9 4 25 8 63 29 74 97 61 93 35 49 62 5 10 57 73 42 3 19 23 71 70 43 67 48 2 34 31 41 90 18 6 40 83 98 72 14 51 38 46 21 99 65 37
Win Win Win Loop Win Win Win Win Win Loop Win Win Win Win Win Win Win Loop Win Win Win Win Win Win Win Win Win Win Win Win Loop Win Win Win Loop Win Win Win Win Win Win Win Win Win Win Loop Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Loop Win Loop Loop Win Win Win Win Loop Win Win Loop Loop Win Loop Win Win Win Loop Win Win Win Win Win Win Loop Win Win Win Win Win Win Win Win
Win Win Win Loop Loop Loop Win Loop Loop Win Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop ...
100
66 70 54 10 72 81 84 56 15 27 19 43 55 49 44 52 33 63 40 95 17 58 2 51 39 22 18 82 1 16 99 32 29 24 94 9 98 5 37 47 14 42 73 41 31 79 64 12 6 53 26 68 67 89 13 90 4 21 93 46 74 75 88 66 57 23 7
18 8 47 76 39 34 52 62 5 36 19 22 80 32 71 55 7 37 57
Win Win Loop Loop Win Win Win Loop Loop Win Win Win Loop Loop Loop Win Loop Win Win Loop Win Loop Loop Loop Win Win Win Win Loop Win Loop Win Win Win Loop Win Win Loop Loop Loop Loop Win Win Win Win Win Win Win Win Loop Win Loop Win Win Loop Win Win Win Win Win Win Loop Win Loop Loop Loop Win Win Win Loop Win Loop Win Win Loop Win Win Win Win Loop Win Win Win Win Win Win Win Win Loop Win Win Loop Win Win Win Win Loop Win Win
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
300
1 179
2 293 180
Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose L...
1000
14 77 649 670 988 469 453 445 885 101 58 728 474 488 230
8 83 453 371 86 834 277 847 958
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Lo...
2
1 1
1 1
Win
Win
2
1 1
1 1
Win
Win
3
1 1
1 2
Loop Win
Win Loop
20
1 1
1 11
Loop Loop Win Lose Loop Loop Win Lose Loop Loop Win Lose Loop Loop Win Lose Loop Loop Win
Win Loop Loop Lose Win Loop Loop Lose Win Loop Loop Lose Win Loop Loop Lose Win Loop Loop
309
30 197 38 142 159 163 169 263 70 151 288 264 41 285 225 216 306 128 242 221 94 39 43 292 54 157 78 272 257 97 57
3 97 172 165
Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Win Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Win Win Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Win Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loo...
1000
1 312
1 171
Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Win Lose Lose Lose Lose Lose Lose Lose Lose Los...
1000
1 481
2 468 9
Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose L...
1000
3 469 637 369
2 801 339
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
4096
6 3736 3640 553 2608 1219 1640
4 112 2233 3551 2248
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
6341
9 6045 2567 3242 5083 5429 1002 4547 1838 4829
5 5533 3084 6323 4015 2889
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
7000
1 5244
1 2980
Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop Loop Loop Win Loop Loop Loop Lose Loop...
7000
1 6694
1 2973
Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose Loop Loop Loop Loop Win Loop Lose L...
7000
1 3041
1 6128
Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Win Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Lose Win Win Win Win Win Win Win W...
7000
5 5080 4890 1201 4903 1360
5 2415 6678 5200 2282 4648
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
7000
3 6965 1271 5818
3 6331 5681 6636
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Lo...
7000
3 2706 2040 6698
10 4118 846 1075 1624 2342 766 6441 2361 4662 1574
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
7000
12 3489 6630 4582 292 5489 1456 5101 6920 632 2963 5136 5886
11 434 5878 3806 656 3047 6614 1073 5932 6537 704 5253
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Lo...
7000
7 419 1631 1925 3861 6940 379 493
29 5389 5925 2923 4696 972 6125 3779 6044 5477 1305 6488 5059 5515 3238 3863 248 6947 4023 6168 1915 6607 2991 2220 2023 200 4457 6398 1017 447
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Win Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Lo...
6999
2 3992 782
2 4903 6815
Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop L...
n = int(input())
r = list(map(int, input().split() ))
m = list(map(int, input().split() ))
r.remove(r[0])
m.remove(m[0])

ansr = [0]*(n)

ansm = [0]*(n)

k = 0

while k < 10**4:
    for i in range( n ):
        x1 = True
        x2 = False
        for rm in r:
            if rm+i == n:
                ansr[i] = 1
                x1 = False
            else:
                if ansm[ (rm+i) % n ] != 1:
                    x1 = False
                if ansm[ (rm+i) % n ] == -1:
                    x2 = True
        if x1:
            ansr[i] = -1
        if x2:
            ansr[i] = 1

        x1 = True
        x2 = False
        for mm in m:
            if mm + i == n:
                ansm[i] = 1
                x1 = False
            else:
                if ansr[ (mm+i) % n ] != 1:
                    x1 = False
                if ansr[ (mm+i) % n ] == -1:
                    x2 = True
        if x1:
            ansm[i] = -1
        if x2:
            ansm[i] = 1
            
    k += 1
ansm.remove(ansm[0])
ansr.remove(ansr[0])
for i in range(n-1):
    if ansm[i] == 1:
        ansm[i] = "Win"
    if ansm[i] == 0:
        ansm[i] = "Loop"
    if ansm[i] == -1:
        ansm[i] = "Lose"
    if ansr[i] == 1:
        ansr[i] = "Win"
    if ansr[i] == 0:
        ansr[i] = "Loop"
    if ansr[i] == -1:
        ansr[i] = "Lose"
print (" ".join(ansr))
print (" ".join(ansm))
    
