//Mitesh Agrawal
#include <bits/stdc++.h>
using namespace std;

#define MAXN 7005
#define ii pair<int,int>
#define ff first
#define ss second
#define ll long long

int dp[2][MAXN];
int ways[2][MAXN];
vector<int> v[2];
int n,a[2];

void ans(){
	int i,j;
	for(i=0;i<2;i++){
		for(j=1;j<n;j++){
			if(dp[i][j]==0) printf("Lose ");
			else if(dp[i][j]==1) printf("Win ");
			else printf("Loop ");
		}
		printf("\n");
	}
}

int main ()
{
	int i,j,r;

	scanf("%d",&n);
	scanf("%d",&a[0]);

	for(i=0;i<a[0];i++){
		scanf("%d",&r);
		v[0].push_back(r);
	}
	scanf("%d",&a[1]);
	for(i=0;i<a[1];i++){
		scanf("%d",&r);
		v[1].push_back(r);
	}

	for(i=0;i<n;i++){
		ways[0][i] = v[0].size();
		ways[1][i] = v[1].size();
	}

	memset(dp,-1,sizeof(dp));
	deque<ii> dq;
	dq.push_back(ii(0,0));
	dq.push_back(ii(1,0));
	dp[0][0] = 0;
	dp[1][0] = 0;

	while(!dq.empty()){
		ii it = dq.front(),it1;
		// cout<<it.ff<<" "<<it.ss<<endl;
		dq.pop_front();
		if(dp[it.ff][it.ss] == 0)
			for(i=0;i<v[1-it.ff].size();i++){
				it1.ff = 1-it.ff;
				it1.ss = (it.ss-v[1-it.ff][i]+n)%n;
				if(dp[it1.ff][it1.ss]==-1){
					dp[it1.ff][it1.ss] = 1;
					dq.push_back(it1);
				}
			}
		else
			for(i=0;i<v[1-it.ff].size();i++){
				it1.ff = 1-it.ff;
				it1.ss = (it.ss-v[1-it.ff][i]+n)%n;
				if(dp[it1.ff][it1.ss]==-1){
					ways[it1.ff][it1.ss]--;
					if(ways[it1.ff][it1.ss]==0){
						dp[it1.ff][it1.ss] = 0;
						dq.push_back(it1);
					}
				}
			}
	}
	ans();

    return 0;
}


//Mitesh Agrawal
#include <bits/stdc++.h>
using namespace std;

#define MAXN 7005
#define ii pair<int,int>
#define ff first
#define ss second
#define ll long long

int dp[2][MAXN];
int ways[2][MAXN];
vector<int> v[2];
int n,a[2];

void ans(){
	int i,j;
	for(i=0;i<2;i++){
		for(j=1;j<n;j++){
			if(dp[i][j]==0) printf("Lose ");
			else if(dp[i][j]==1) printf("Win ");
			else printf("Loop ");
		}
		printf("\n");
	}
}

int main ()
{
	int i,j,r;

	scanf("%d",&n);
	scanf("%d",&a[0]);

	for(i=0;i<a[0];i++){
		scanf("%d",&r);
		v[0].push_back(r);
	}
	scanf("%d",&a[1]);
	for(i=0;i<a[1];i++){
		scanf("%d",&r);
		v[1].push_back(r);
	}

	for(i=0;i<n;i++){
		ways[0][i] = v[0].size();
		ways[1][i] = v[1].size();
	}

	memset(dp,-1,sizeof(dp));
	deque<ii> dq;
	dq.push_back(ii(0,0));
	dq.push_back(ii(1,0));
	dp[0][0] = 0;
	dp[1][0] = 0;
	while(!dq.empty()){
		ii it = dq.front(),it1;
		dq.pop_front();
		for(i=0;i<v[1-it.ff].size();i++){
			it1.ff = 1-it.ff;
			it1.ss = (it.ss-v[1-it.ff][i]+n)%n;
			if(dp[it1.ff][it1.ss]!=-1) continue;
			if(!dp[it.ff][it.ss]){
				dp[it1.ff][it1.ss] = 1;
				dq.push_back(it1);
			}
			else{
				ways[it1.ff][it1.ss]--;
				if(ways[it1.ff][it1.ss]==0){
					dp[it1.ff][it1.ss] = 0;
					dq.push_back(it1);
				}
			}
		}
	}
	ans();
    return 0;
}


//Mitesh Agrawal
#include <bits/stdc++.h>
using namespace std;

#define MAXN 7005
#define infi 10000
#define itr 3
#define ii pair<int,int>
#define ff first
#define ss second
#define ll long long

int dp[2][MAXN];
vector<int> v[2];
int n,a[2];

//lose 0
//win 1
bool improve(){
	int i,j,k;
	bool flag = false;
	for(i=0;i<2;i++)
		for(j=0;j<n;j++)
			if(dp[i][j]==-1){
				int it = 0;
				for(k=0;k<v[i].size();k++){
					if(dp[1-i][(j+v[i][k])%n]==0){
						dp[i][j] = 1;
						flag = true;
						break;
					}
					if(dp[1-i][(j+v[i][k])%n]!=1){
						it = 1;
					}
				}
				if(dp[i][j]==-1 && it==0){
					dp[i][j] = 0;
					flag = true;
				}
			}
	return flag;
}

int main ()
{
	int i,j,r;

	scanf("%d",&n);
	scanf("%d",&a[0]);

	for(i=0;i<a[0];i++){
		scanf("%d",&r);
		v[0].push_back(r);
	}
	scanf("%d",&a[1]);
	for(i=0;i<a[1];i++){
		scanf("%d",&r);
		v[1].push_back(r);
	}

	memset(dp,-1,sizeof(dp));
	dp[0][0] = 0;
	dp[1][0] = 0;

	while(improve());

	for(i=0;i<2;i++){
		for(j=1;j<n;j++){
			if(dp[i][j]==0) printf("Lose ");
			else if(dp[i][j]==1) printf("Win ");
			else printf("Loop ");
		}
		printf("\n");
	}

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; cin >> n;

    auto moves = array<vector<int>, 2>{};
    for (auto i = 0; i < 2; i++)
    {
        int k; cin >> k;
        moves[i] = vector<int>(k);
        for (auto& x : moves[i]) cin >> x;
    }

    auto outcomes = vector<int>(2*n);
    outcomes[0] = outcomes[n] = -1;

    auto moves_left = vector<int>(2*n);
    for (auto i = 0; i < 2*n; i++)
        moves_left[i] = int(i < n ? moves[0].size() : moves[1].size());

    auto queue = std::queue<int>({0, n});
    while (!queue.empty())
    {
        const auto state = queue.front(); queue.pop();
        const auto i = state%n, player = state/n, other = 1-player;

        for (const auto x : moves[other])
        {
            const auto j = (i-x+n) % n;
            const auto target = other*n + j;
            if (outcomes[target] != 0) continue;
            if (outcomes[state] == 1)
            {
                moves_left[target]--;
                if (moves_left[target] == 0)
                {
                    outcomes[target] = -1;
                    queue.push(target);
                }
            }
            else
            {
                outcomes[target] = 1;
                queue.push(target);
            }
        }
    }

    const auto interpret = [](const int x)
    {
        if (x == 1) return "Win";
        else if (x == -1) return "Lose";
        else return "Loop";
    };

    for (auto state = 1; state < n; state++)
        cout << interpret(outcomes[state]) << " ";
    cout << endl;

    for (auto state = n+1; state < 2*n; state++)
        cout << interpret(outcomes[state]) << " ";
    cout << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; cin >> n;

    auto moves = array<vector<int>, 2>{};
    for (auto i = 0; i < 2; i++)
    {
        int k; cin >> k;
        moves[i] = vector<int>(k);
        for (auto& x : moves[i]) cin >> x;
    }

    auto outcomes = vector<int>(2*n);
    outcomes[0] = outcomes[n] = -1;

    auto moves_left = vector<int>(2*n);
    for (auto i = 0; i < 2*n; i++)
        moves_left[i] = int(i < n ? moves[0].size() : moves[1].size());

    auto queue = std::queue<int>({0, n});
    while (!queue.empty())
    {
        const auto state = queue.front(); queue.pop();
        const auto i = state%n, player = state/n, other = 1-player;

        for (const auto x : moves[other])
        {
            const auto j = (i-x+n) % n;
            const auto target = other*n + j;
            if (outcomes[target] != 0) continue;

            if (outcomes[state] == 1)
            {
                moves_left[target]--;
                if (moves_left[target] == 0)
                {
                    outcomes[target] = -1;
                    queue.push(target);
                }
            }
            else
            {
                outcomes[target] = 1;
                queue.push(target);
            }
        }
    }

    const auto interpret = map<int, string>{{1, "Win"}, {0, "Loop"}, {-1, "Lose"}};
    for (auto p = 0; p < 2; p++)
    {
        for (auto i = 1; i < n; i++)
            cout << interpret.at(outcomes[p*n + i]) << " ";
        cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; cin >> n;

    auto moves = array<vector<int>, 2>{};
    for (auto i = 0; i < 2; i++)
    {
        int k; cin >> k;
        moves[i] = vector<int>(k);
        for (auto& x : moves[i]) cin >> x;
    }

    auto outcomes = vector<string>(2*n, "Loop");
    outcomes[0] = outcomes[n] = "Lose";

    auto moves_left = vector<int>(2*n);
    for (auto i = 0; i < 2*n; i++)
        moves_left[i] = int(i < n ? moves[0].size() : moves[1].size());

    auto queue = std::queue<int>({0, n});
    while (!queue.empty())
    {
        const auto state = queue.front(); queue.pop();
        const auto i = state%n, player = state/n, other = 1-player;

        for (const auto x : moves[other])
        {
            const auto j = (i-x+n) % n;
            const auto target = other*n + j;
            if (outcomes[target] != "Loop") continue;
            if (outcomes[state] == "Win")
            {
                moves_left[target]--;
                if (moves_left[target] == 0)
                {
                    outcomes[target] = "Lose";
                    queue.push(target);
                }
            }
            else
            {
                outcomes[target] = "Win";
                queue.push(target);
            }
        }
    }

    for (auto state = 1; state < n; state++)
        cout << outcomes[state] << " ";
    cout << endl;

    for (auto state = n+1; state < 2*n; state++)
        cout << outcomes[state] << " ";
    cout << endl;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;

int n,m[2];
int a[2][7002];
int out[2][7002];
bool v[2][7002];
int res[2][7002];

pii pro[1001000];

int main()  {
    ios::sync_with_stdio(0);
    cin>>n;
    cin>>m[0];
    for(int i=0 ;i <m[0] ; i++){
        cin>>a[0][i];
    }
    cin>>m[1];
    for(int i=0 ;i <m[1] ; i++){
        cin>>a[1][i];
    }

    for(int i=1 ; i<n ;i ++){
        for(int tu =0  ;tu<2 ; tu++){
            for(int j=0 ;j <m[tu] ; j++){
                int go = i + a[tu][j];
                go %= n;
                out[tu][i]++;
            }
        }
    }
    int sz = 0;
    queue<pii>q;
    q.push({0,0});
    q.push({1,0});
    while(!q.empty()){
        pii t = q.front();
        q.pop();
        v[t.fr][t.sc] = 1;
        if(res[t.fr][t.sc]){
            for(int i=0 ;i <m[!t.fr] ; i++){
                pii x = {!t.fr,(t.sc - a[!t.fr][i] +n)%n};
                if(v[x.fr][x.sc])continue;

                out[x.fr][x.sc]--;
                if(!out[x.fr][x.sc]){
                    q.push(x);
                }
            }
        }
        else{
            for(int i=0 ;i <m[!t.fr] ; i++){
                pii x = {!t.fr,(t.sc - a[!t.fr][i]+n)%n};
                if(v[x.fr][x.sc])continue;
                out[x.fr][x.sc] = 0;
                v[x.fr][x.sc] = 1;
                res[x.fr][x.sc] = 1;
                q.push(x);
            }
        }
    }

    for(int i=1 ;i <n ;i ++){
        if(!v[0][i])res[0][i] =2;
        if(res[0][i] == 1){
            cout<<"Win ";
        }
        else if(res[0][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    for(int i=1 ;i <n ;i ++){
        if(!v[1][i])res[1][i] =2;

        if(res[1][i] == 1){
            cout<<"Win ";
        }
        else if(res[1][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;

int n,m[2];
int a[2][7002];
vector<pii>p[2][7002];
int out[2][7002];
bool v[2][7002];
int res[2][7002];

int main()  {
    ios::sync_with_stdio(0);
    cin>>n;
    cin>>m[0];
    for(int i=0 ;i <m[0] ; i++){
        cin>>a[0][i];
    }
    cin>>m[1];
    for(int i=0 ;i <m[1] ; i++){
        cin>>a[1][i];
    }
    set<pair<int,pii> >st;

    st.insert({0,{0,0}});
    st.insert({0,{1,0}});

    for(int i=1 ; i<n ;i ++){
        for(int tu =0  ;tu<2 ; tu++){
            for(int j=0 ;j <m[tu] ; j++){
                int go = i + a[tu][j];
                go %= n;
                out[tu][i]++;
                p[!tu][go].push_back({tu,i});
            }
            st.insert({out[tu][i],{tu,i}});
        }
    }

    while(!st.empty()){
        pii t = (st.begin())->sc;
        st.erase(st.begin());
        v[t.fr][t.sc] = 1;

        if(out[t.fr][t.sc] != 0 && res[t.fr][t.sc] == 0){
            res[t.fr][t.sc] = 2;
            continue;
        }
        if(res[t.fr][t.sc]){
            for(int i=0 ;i <p[t.fr][t.sc].size() ; i++){
                pii x = p[t.fr][t.sc][i];
                if(v[x.fr][x.sc])continue;
                st.erase({out[x.fr][x.sc],x});
                out[x.fr][x.sc]--;
                st.insert({out[x.fr][x.sc],x});
            }
        }
        else{
            for(int i=0 ;i <p[t.fr][t.sc].size() ; i++){
                pii x = p[t.fr][t.sc][i];
                if(v[x.fr][x.sc])continue;
                st.erase({out[x.fr][x.sc],x});
                out[x.fr][x.sc] = 0;
                v[x.fr][x.sc] = 1;
                res[x.fr][x.sc] = 1;
                st.insert({out[x.fr][x.sc],x});
            }
        }
    }

    for(int i=1 ;i <n ;i ++){
        if(res[0][i] == 1){
            cout<<"Win ";
        }
        else if(res[0][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    for(int i=1 ;i <n ;i ++){
        if(res[1][i] == 1){
            cout<<"Win ";
        }
        else if(res[1][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;

int n,m[2];
int a[2][7002];
int out[2][7002];
bool v[2][7002];
int res[2][7002];

int main()  {
    ios::sync_with_stdio(0);
    cin>>n;
    cin>>m[0];
    for(int i=0 ;i <m[0] ; i++){
        cin>>a[0][i];
    }
    cin>>m[1];
    for(int i=0 ;i <m[1] ; i++){
        cin>>a[1][i];
    }
    set<pair<int,pii> >st;

    st.insert({0,{0,0}});
    st.insert({0,{1,0}});

    for(int i=1 ; i<n ;i ++){
        for(int tu =0  ;tu<2 ; tu++){
            for(int j=0 ;j <m[tu] ; j++){
                int go = i + a[tu][j];
                go %= n;
                out[tu][i]++;
            }
            st.insert({out[tu][i],{tu,i}});
        }
    }

    while(!st.empty()){
        pii t = (st.begin())->sc;
        st.erase(st.begin());
        v[t.fr][t.sc] = 1;

        if(out[t.fr][t.sc] != 0 && res[t.fr][t.sc] == 0){
            res[t.fr][t.sc] = 2;
            continue;
        }
        if(res[t.fr][t.sc]){
            for(int i=0 ;i <m[!t.fr] ; i++){
                pii x = {!t.fr,(t.sc - a[!t.fr][i] +n)%n};
                if(v[x.fr][x.sc])continue;
                st.erase({out[x.fr][x.sc],x});
                out[x.fr][x.sc]--;
                st.insert({out[x.fr][x.sc],x});
            }
        }
        else{
            for(int i=0 ;i <m[!t.fr] ; i++){
                pii x = {!t.fr,(t.sc - a[!t.fr][i]+n)%n};
                if(v[x.fr][x.sc])continue;
                st.erase({out[x.fr][x.sc],x});
                out[x.fr][x.sc] = 0;
                v[x.fr][x.sc] = 1;
                res[x.fr][x.sc] = 1;
                st.insert({out[x.fr][x.sc],x});
            }
        }
    }

    for(int i=1 ;i <n ;i ++){
        if(res[0][i] == 1){
            cout<<"Win ";
        }
        else if(res[0][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    for(int i=1 ;i <n ;i ++){
        if(res[1][i] == 1){
            cout<<"Win ";
        }
        else if(res[1][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;

int n,m[2];
int a[2][100100];
vector<pii>p[2][7070];
int out[2][100100];
bool v[2][7070];
int res[2][7070];

int main()  {
    ios::sync_with_stdio(0);
    cin>>n;
    cin>>m[0];
    for(int i=0 ;i <m[0] ; i++){
        cin>>a[0][i];
    }
    cin>>m[1];
    for(int i=0 ;i <m[1] ; i++){
        cin>>a[1][i];
    }
    set<pair<int,pii> >st;

    st.insert({0,{0,0}});
    st.insert({0,{1,0}});

    for(int i=1 ; i<n ;i ++){
        for(int tu =0  ;tu<2 ; tu++){
            for(int j=0 ;j <m[tu] ; j++){
                int go = i + a[tu][j];
                go %= n;
                out[tu][i]++;
                p[!tu][go].push_back({tu,i});
            }
            st.insert({out[tu][i],{tu,i}});
        }
    }

    while(!st.empty()){
        pii t = (st.begin())->sc;
        st.erase(st.begin());

        if(out[t.fr][t.sc] != 0 && res[t.fr][t.sc] == 0){
            res[t.fr][t.sc] = 2;
            continue;
        }
        v[t.fr][t.sc] = 1;
        if(res[t.fr][t.sc]){
            for(int i=0 ;i <p[t.fr][t.sc].size() ; i++){
                pii x = p[t.fr][t.sc][i];
                if(v[x.fr][x.sc])continue;
                st.erase({out[x.fr][x.sc],x});
                out[x.fr][x.sc]--;
                st.insert({out[x.fr][x.sc],x});
            }
        }
        else{
            for(int i=0 ;i <p[t.fr][t.sc].size() ; i++){
                pii x = p[t.fr][t.sc][i];
                if(v[x.fr][x.sc])continue;
                st.erase({out[x.fr][x.sc],x});
                out[x.fr][x.sc] = 0;
                v[x.fr][x.sc] = 1;
                res[x.fr][x.sc] = 1;
                st.insert({out[x.fr][x.sc],x});
            }
        }
    }

    for(int i=1 ;i <n ;i ++){
        if(res[0][i] == 1){
            cout<<"Win ";
        }
        else if(res[0][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    for(int i=1 ;i <n ;i ++){
        if(res[1][i] == 1){
            cout<<"Win ";
        }
        else if(res[1][i] == 0){
            cout<<("Lose ");
        }
        else{
            cout<<("Loop ");
        }
    }
    cout<<endl;
    return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose,3=loop
bool seen[7070][2];

int solve(int n,int p){
  if(dp[n][p]) return dp[n][p];
  // cout<<n<<' '<<p<<'\n';
  // for(int x:s[p]){
  //   if(dp[(n+x)%N][!p]==2) return dp[n][p]=1;
  // }

  seen[n][p]=1;
  bool hasloop=0;
  for(int x:s[p]){
    int y=(n+x)%N;
    if(!seen[y][!p]){
      int r=solve(y,!p);
      if(r==2){
	dp[n][p]=1;
	break;
      }else if(r!=1) hasloop=1;
    }else hasloop=1;
  }
  if(dp[n][p]!=1 && !hasloop) dp[n][p]=2;
  return dp[n][p];
}

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  for(int n=1;n<N;n++) for(int p=0;p<2;p++) memset(seen,0,sizeof seen),solve(n,p);
  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose,3=loop
bool seen[7070][2];

int solve(int n,int p){
  if(dp[n][p]) return dp[n][p];
  // cout<<n<<' '<<p<<'\n';
  for(int x:s[p]){
    if(dp[(n+x)%N][!p]==2) return dp[n][p]=1;
  }

  seen[n][p]=1;
  bool hasloop=0;
  for(int x:s[p]){
    int y=(n+x)%N;
    if(!seen[y][!p]){
      int r=solve(y,!p);
      if(r==2){
	dp[n][p]=1;
	break;
      }else if(r!=1) hasloop=1;
    }else hasloop=1;
  }
  if(!(dp[n][p]==1) && !hasloop) dp[n][p]=2;
  seen[n][p]=0;
  return dp[n][p];
}

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  for(int n=1;n<N;n++) for(int p=0;p<2;p++) solve(n,p);
  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose,3=loop
bool seen[7070][2];

int solve(int n,int p){
  if(dp[n][p]) return dp[n][p];
  // cout<<n<<' '<<p<<'\n';
  // for(int x:s[p]){
  //   if(dp[(n+x)%N][!p]==2) return dp[n][p]=1;
  // }

  seen[n][p]=1;
  bool hasloop=0;
  for(int x:s[p]){
    int y=(n+x)%N;
    if(!seen[y][!p]){
      int r=solve(y,!p);
      if(r==2){
	dp[n][p]=1;
	break;
      }else if(r==1){
	seen[y][!p]=0;
      }else hasloop=1;
    }else hasloop=1;
  }
  if(dp[n][p]!=1 && !hasloop) dp[n][p]=2;
  seen[n][p]=0;
  return dp[n][p];
}

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  for(int n=1;n<N;n++) for(int p=0;p<2;p++) solve(n,p);
  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose,3=loop
bool seen[7070][2];

int solve(int n,int p){
  if(dp[n][p]) return dp[n][p];
  // cout<<n<<' '<<p<<'\n';
  for(int x:s[p]){
    if(dp[(n+x)%N][!p]==2) return dp[n][p]=1;
  }

  seen[n][p]=1;
  int winners=0;
  for(int x:s[p]){
    int y=(n+x)%N;
    if(!seen[y][!p]){
      int r=solve(y,!p);
      if(r==2){
	dp[n][p]=1;
	break;
      }else if(r==1) winners++;
    }
  }
  if(winners==s[p].size()) dp[n][p]=2;
  // seen[n][p]=0;
  return dp[n][p];
}

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  for(int n=1;n<N;n++) for(int p=0;p<2;p++) memset(seen,0,sizeof seen),
					      solve(n,p);
  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose,3=loop
bool seen[7070][2];

int solve(int n,int p){
  if(dp[n][p]) return dp[n][p];
  // cout<<n<<' '<<p<<'\n';
  // for(int x:s[p]){
  //   if(dp[(n+x)%N][!p]==2) return dp[n][p]=1;
  // }

  seen[n][p]=1;
  bool hasloop=0;
  for(int x:s[p]){
    int y=(n+x)%N;
    if(!seen[y][!p]){
      int r=solve(y,!p);
      if(r==2){
	dp[n][p]=1;
	break;
      }else if(r!=1) hasloop=1;
    }else hasloop=1;
  }
  if(dp[n][p]!=1 && !hasloop) dp[n][p]=2;
  seen[n][p]=0;
  return dp[n][p];
}

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  for(int n=1;n<N;n++) for(int p=0;p<2;p++) solve(n,p);
  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose,3=loop
bool seen[7070][2];

int solve(int n,int p){
  if(dp[n][p]) return dp[n][p];
  // cout<<n<<' '<<p<<'\n';
  for(int x:s[p]){
    if(dp[(n+x)%N][!p]==2) return dp[n][p]=1;
  }

  seen[n][p]=1;
  bool hasloop=0;
  for(int x:s[p]){
    int y=(n+x)%N;
    if(!seen[y][!p]){
      int r=solve(y,!p);
      if(r==2){
	dp[n][p]=1;
	break;
      }else if(r!=1) hasloop=1;
    }else hasloop=1;
  }
  if(dp[n][p]!=1 && !hasloop) dp[n][p]=2;
  return dp[n][p];
}

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  for(int n=1;n<N;n++) for(int p=0;p<2;p++) memset(seen,0,sizeof seen),solve(n,p);
  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
using namespace std;

#define pb push_back
#define fst first
#define snd second

typedef long long ll;
typedef pair<int,int> pii;
template<typename T> using min_queue=priority_queue<T,vector<T>,greater<T> >;

const ll MOD=1e9+7;

int N;
vector<int> s[2];
int dp[7070][2];//1=win,2=lose
int cnt[7070][2];

int main(){
  ios::sync_with_stdio(0);cin.tie(0);

  cin>>N;
  for(int i=0;i<2;i++){
    int k;cin>>k;
    while(k--){
      int x;cin>>x;
      s[i].pb(x);
    }
  }

  dp[0][0]=dp[0][1]=2;
  queue<pii> q;
  q.push({0,0});q.push({0,1});

  while(!q.empty()){
    int n=q.front().fst,p=q.front().snd;
    q.pop();
    for(int x:s[!p]){
      int m=(n-x+N)%N;
      if(dp[m][!p]) continue;
      if(dp[n][p]==2){
	dp[m][!p]=1;
	q.push({m,!p});
      }else if(dp[n][p]==1){
	cnt[m][!p]++;
	if(cnt[m][!p]==s[!p].size()){
	  dp[m][!p]=2;
	  q.push({m,!p});
	}
      }
    }
  }

  for(int p=0;p<2;p++){
    for(int i=1;i<N;i++){
      int r=dp[i][p];
      if(r==1) cout<<"Win";
      else if(r==2) cout<<"Lose";
      else cout<<"Loop";
      cout<<" \n"[i==N-1];
      // cout<<'\n';
    }
  }

  return 0;
}


#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<cstring>
#include<map>
using namespace std;

#define mod 1000000007
#define mx (1<<18)

int dp[2][7001];

bool vis[2][7001];
vector<int> V[2];
int n;
int lim[2][6001];
int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	int k1;
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[0].push_back(x);
	}
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[1].push_back(x);
	}
	for (int i = 0;i <=n;++i) {
		lim[0][i] = V[0].size();
		lim[1][i] = V[1].size();
	}

	queue<pair<bool, int>> Q;
	Q.push({ 0,1 });
	Q.push({ 1,1 });
	vis[1][1] = vis[0][1] = 1;
	dp[1][1] = dp[0][1] = 0;
	while (!Q.empty()) {
		int cx = Q.front().second;
		bool p = Q.front().first;
		int state = dp[p][cx];
		Q.pop();

		for (auto u : V[!p]) {
			int nxt = cx - u;
			if (nxt <= 0) nxt +=n;
			if (dp[!p][nxt] == -1) {
				if (state == 0) {
					dp[!p][nxt] = 1;
					Q.push({ !p, nxt });
				}
				else
				{
					lim[!p][nxt]--;
					if (lim[!p][nxt] == 0) {
						dp[!p][nxt] = 0;
						Q.push({ !p, nxt });
					}
				}
			}
		}

	}
	for (int i = 0;i < 2;++i)
	{
		for (int j = 2;j <=n;++j) {
			int ret = dp[i][j];
			if (ret == 0) printf("Lose ");
			if (ret == -1) printf("Loop ");
			if (ret == 1) printf("Win ");
		}
		puts("");
	}
}


#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<string>
#include<map>
using namespace std;

#define mod 1000000007
#define mx (1<<18)

int dp[2][6001];

bool vis[2][6001];
vector<int> V[2];
int n;
int F(bool player, int x) {
	if (x == 0) return 0;
	if (dp[player][x] != -1) return dp[player][x];

	vis[player][x] = 1;
	bool seen[3] = { 0 };

	for (auto u : V[player]) {
		if(dp[!player][(u + x) % n]!=-1 || !vis[!player][(u + x) % n])
		seen[2 - F(!player, (u + x) % n)] = 1;
	}

/*	for (auto u : V[player]) {

		seen[2 - F(!player, (u + x) % n)] = 1;
	}*/
	if (seen[2]) {

		return dp[player][x] = 2;
	}

	if (!seen[1])
		dp[player][x] = 0;

	return dp[player][x] = 1;
}
int lim[2][6001];
int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	int k1;
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[0].push_back(x);
	}
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[1].push_back(x);
	}
	for (int i = 0;i < n;++i) {
		lim[0][i] = V[0].size();
		lim[1][i] = V[1].size();
	}

	queue<pair<bool, int>> Q;
	Q.push({ 0,0 });
	Q.push({ 1,0 });
	vis[1][0] = vis[0][0] = 1;
	dp[1][0] = dp[0][0] = 0;
	while (!Q.empty()) {
		int cx = Q.front().second;
		bool p = Q.front().first;
		int state = dp[p][cx];
		Q.pop();

		for (auto u : V[!p]) {
			int nxt = cx - u;
			if (nxt < 0) nxt +=n;
			if (dp[!p][nxt] == -1) {
				if (state == 0) {
					dp[!p][nxt] = 1;
					Q.push({ !p, nxt });
				}
				else
				{
					lim[!p][nxt]--;
					if (lim[!p][nxt] == 0) {
						dp[!p][nxt] = 0;
						Q.push({ !p, nxt });
					}
				}
			}
		}

	}
	for (int i = 0;i < 2;++i)
	{
		for (int j = 1;j < n;++j) {
			int ret = dp[i][j];
			if (ret == 0) printf("Lose ");
			if (ret == -1) printf("Loop ");
			if (ret == 1) printf("Win ");
		}
		puts("");
	}
}


#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<string>
#include<map>
using namespace std;

#define mod 1000000007
#define mx (1<<18)

int dp[2][6001];

bool vis[2][6001];
vector<int> V[2];
int n;
int lim[2][6001];
int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	int k1;
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[0].push_back(x);
	}
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[1].push_back(x);
	}
	for (int i = 0;i <=n;++i) {
		lim[0][i] = V[0].size();
		lim[1][i] = V[1].size();
	}

	queue<pair<bool, int>> Q;
	Q.push({ 0,1 });
	Q.push({ 1,1 });
	vis[1][1] = vis[0][1] = 1;
	dp[1][1] = dp[0][1] = 0;
	while (!Q.empty()) {
		int cx = Q.front().second;
		bool p = Q.front().first;
		int state = dp[p][cx];
		Q.pop();

		for (auto u : V[!p]) {
			int nxt = cx - u;
			if (nxt <= 0) nxt +=n;
			if (dp[!p][nxt] == -1) {
				if (state == 0) {
					dp[!p][nxt] = 1;
					Q.push({ !p, nxt });
				}
				else
				{
					lim[!p][nxt]--;
					if (lim[!p][nxt] == 0) {
						dp[!p][nxt] = 0;
						Q.push({ !p, nxt });
					}
				}
			}
		}

	}
	for (int i = 0;i < 2;++i)
	{
		for (int j = 2;j <=n;++j) {
			int ret = dp[i][j];
			if (ret == 0) printf("Lose ");
			if (ret == -1) printf("Loop ");
			if (ret == 1) printf("Win ");
		}
		puts("");
	}
}


#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<cstring>
#include<map>
using namespace std;

#define mod 1000000007
#define mx (1<<18)

int dp[2][7001];

bool vis[2][7001];
vector<int> V[2];
int n;
int lim[2][7001];
int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	int k1;
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[0].push_back(x);
	}
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[1].push_back(x);
	}
	for (int i = 0;i <=n;++i) {
		lim[0][i] = V[0].size();
		lim[1][i] = V[1].size();
	}

	queue<pair<bool, int>> Q;
	Q.push({ 0,1 });
	Q.push({ 1,1 });
	vis[1][1] = vis[0][1] = 1;
	dp[1][1] = dp[0][1] = 0;
	while (!Q.empty()) {
		int cx = Q.front().second;
		bool p = Q.front().first;
		int state = dp[p][cx];
		Q.pop();

		for (auto u : V[!p]) {
			int nxt = cx - u;
			if (nxt <= 0) nxt +=n;
			if (dp[!p][nxt] == -1) {
				if (state == 0) {
					dp[!p][nxt] = 1;
					Q.push({ !p, nxt });
				}
				else
				{
					lim[!p][nxt]--;
					if (lim[!p][nxt] == 0) {
						dp[!p][nxt] = 0;
						Q.push({ !p, nxt });
					}
				}
			}
		}

	}
	for (int i = 0;i < 2;++i)
	{
		for (int j = 2;j <=n;++j) {
			int ret = dp[i][j];
			if (ret == 0) printf("Lose ");
			if (ret == -1) printf("Loop ");
			if (ret == 1) printf("Win ");
		}
		puts("");
	}
}


#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<cstring>
#include<map>
using namespace std;

#define mod 1000000007
#define mx (1<<18)

int dp[2][6001];

bool vis[2][6001];
vector<int> V[2];
int n;
int lim[2][6001];
int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	int k1;
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[0].push_back(x);
	}
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[1].push_back(x);
	}
	for (int i = 0;i <=n;++i) {
		lim[0][i] = V[0].size();
		lim[1][i] = V[1].size();
	}

	queue<pair<bool, int>> Q;
	Q.push({ 0,1 });
	Q.push({ 1,1 });
	vis[1][1] = vis[0][1] = 1;
	dp[1][1] = dp[0][1] = 0;
	while (!Q.empty()) {
		int cx = Q.front().second;
		bool p = Q.front().first;
		int state = dp[p][cx];
		Q.pop();

		for (auto u : V[!p]) {
			int nxt = cx - u;
			if (nxt <= 0) nxt +=n;
			if (dp[!p][nxt] == -1) {
				if (state == 0) {
					dp[!p][nxt] = 1;
					Q.push({ !p, nxt });
				}
				else
				{
					lim[!p][nxt]--;
					if (lim[!p][nxt] == 0) {
						dp[!p][nxt] = 0;
						Q.push({ !p, nxt });
					}
				}
			}
		}

	}
	for (int i = 0;i < 2;++i)
	{
		for (int j = 2;j <=n;++j) {
			int ret = dp[i][j];
			if (ret == 0) printf("Lose ");
			if (ret == -1) printf("Loop ");
			if (ret == 1) printf("Win ");
		}
		puts("");
	}
}


#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<cstring>
#include<map>

using namespace std;

#define mod 1000000007
#define mx (1<<18)

int dp[2][6001];

bool vis[2][6001];
vector<int> V[2];
int n;
int F(bool player, int x) {
	if (x == 0) return 0;
	if (dp[player][x] != -1) return dp[player][x];

	vis[player][x] = 1;
	bool seen[3] = { 0 };

	for (auto u : V[player]) {
		if(dp[!player][(u + x) % n]!=-1 || !vis[!player][(u + x) % n])
		seen[2 - F(!player, (u + x) % n)] = 1;
	}

/*	for (auto u : V[player]) {

		seen[2 - F(!player, (u + x) % n)] = 1;
	}*/
	if (seen[2]) {

		return dp[player][x] = 2;
	}

	if (!seen[1])
		dp[player][x] = 0;

	return dp[player][x] = 1;
}
int lim[2][6001];
int main() {
	memset(dp, -1, sizeof(dp));

	scanf("%d", &n);
	int k1;
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[0].push_back(x);
	}
	scanf("%d", &k1);
	while (k1--) {
		int x;
		scanf("%d", &x);
		V[1].push_back(x);
	}
	for (int i = 0;i < n;++i) {
		lim[0][i] = V[0].size();
		lim[1][i] = V[1].size();
	}

	queue<pair<bool, int>> Q;
	Q.push({ 0,0 });
	Q.push({ 1,0 });
	vis[1][0] = vis[0][0] = 1;
	dp[1][0] = dp[0][0] = 0;
	while (!Q.empty()) {
		int cx = Q.front().second;
		bool p = Q.front().first;
		int state = dp[p][cx];
		Q.pop();

		for (auto u : V[!p]) {
			int nxt = cx - u;
			if (nxt < 0) nxt +=n;
			if (dp[!p][nxt] == -1) {
				if (state == 0) {
					dp[!p][nxt] = 1;
					Q.push({ !p, nxt });
				}
				else
				{
					lim[!p][nxt]--;
					if (lim[!p][nxt] == 0) {
						dp[!p][nxt] = 0;
						Q.push({ !p, nxt });
					}
				}
			}
		}

	}
	for (int i = 0;i < 2;++i)
	{
		for (int j = 1;j < n;++j) {
			int ret = dp[i][j];
			if (ret == 0) printf("Lose ");
			if (ret == -1) printf("Loop ");
			if (ret == 1) printf("Win ");
		}
		puts("");
	}
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 7011

int n, k, i, x;
vector<int> s[2];
int dp[2][maxN];

int solve(int id, int node) {
    bool any = false;
    int to, ans;

    if (dp[id][node] == -1) {
        dp[id][node] = 1;

        for (auto bonus : s[id]) {
            to = (node + bonus);
            if (to >= n) to -= n;

            ans = solve(id ^ 1, to);
            if (ans == 0) {
                dp[id][node] = 2;
                return 2;
            }

            if (ans == 1)
                any = true;
        }

        if (!any) dp[id][node] = 0;
    }

    return dp[id][node];
}

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    /* 0 - lose
     * 1 - loop
     * 2 - win
     */
    for (i = 0; i < n; i++)
        dp[0][i] = dp[1][i] = -1;
    dp[0][0] = dp[1][0] = 0;
    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

for (int times = 1; time <= 3; times++) {
    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }
}

    for (i = 1; i < n; i++) {
        int ans = solve(0, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }
    printf("\n");

    for (i = 1; i < n; i++) {
        int ans = solve(1, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 15011

int n, k, i, x;
vector<int> s[maxN];
vector<short> list[maxN];
int gr[maxN];
int ans[maxN];
queue<int> Q;

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    for (i = 1; i < n; i++) {
        for (auto e : s[0]) {
            int to = (i + e) % n;
            list[to + n].pb(i);
            gr[i]++;
        }
    }

    for (i = 1; i < n; i++) {
        for (auto e : s[1]) {
            int to = (i + e) % n;
            list[to].pb(i + n);
            gr[i + n]++;
        }
    }

    for (i = 0; i <= 2 * n; i++)
        ans[i] = -1;

    ans[0] = ans[n] = 0;
    Q.push(0);
    Q.push(n);

    while (!Q.empty()) {
        int node = Q.front(); Q.pop();

        if (ans[node] == 0) {
            for (auto to : list[node]) {
                if (ans[to] != -1) continue;
                ans[to] = 1;
                Q.push(to);
            }
        } else {
            for (auto to : list[node]) {
                if (ans[to] != -1) continue;
                if (--gr[to] == 0) {
                    ans[to] = 0;
                    Q.push(to);
                }
            }
        }
    }

    for (i = 1; i < n; i++) {
        if (ans[i] == 1)
            printf("Win ");
        if (ans[i] == 0)
            printf("Lose ");
        if (ans[i] == -1)
            printf("Loop ");
    }
    printf("\n");

    for (i = 1 + n; i < 2 * n; i++) {
        if (ans[i] == 1)
            printf("Win ");
        if (ans[i] == 0)
            printf("Lose ");
        if (ans[i] == -1)
            printf("Loop ");
    }
    printf("\n");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 15011

int n, k, i, x;
vector<int> s[maxN];
vector<int> list[maxN];
int gr[maxN];
int ans[maxN];
queue<int> Q;

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    for (i = 1; i < n; i++) {
        for (auto e : s[0]) {
            int to = (i + e) % n;
            list[to + n].pb(i);
            gr[i]++;
        }
    }

    for (i = 1; i < n; i++) {
        for (auto e : s[1]) {
            int to = (i + e) % n;
            list[to].pb(i + n);
            gr[i + n]++;
        }
    }

    for (i = 0; i <= 2 * n; i++)
        ans[i] = -1;

    ans[0] = ans[n] = 0;
    Q.push(0);
    Q.push(n);

    while (!Q.empty()) {
        int node = Q.front(); Q.pop();

        if (ans[node] == 0) {
            for (auto to : list[node]) {
                if (ans[to] != -1) continue;
                ans[to] = 1;
                Q.push(to);
            }
        } else {
            for (auto to : list[node]) {
                if (ans[to] != -1) continue;
                if (--gr[to] == 0) {
                    ans[to] = 0;
                    Q.push(to);
                }
            }
        }
    }

    for (i = 1; i < n; i++) {
        if (ans[i] == 1)
            printf("Win ");
        if (ans[i] == 0)
            printf("Lose ");
        if (ans[i] == -1)
            printf("Loop ");
    }
    printf("\n");

    for (i = 1 + n; i < 2 * n; i++) {
        if (ans[i] == 1)
            printf("Win ");
        if (ans[i] == 0)
            printf("Lose ");
        if (ans[i] == -1)
            printf("Loop ");
    }
    printf("\n");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 15011

int n, k, i, x;
vector<int> s[maxN];
int gr[maxN];
int ans[maxN];
queue<int> Q;

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    for (i = 1; i < n; i++) {
        for (auto e : s[0]) {
            int to = (i + e) % n;
            //list[to + n].pb(i);
            gr[i]++;
        }
    }

    for (i = 1; i < n; i++) {
        for (auto e : s[1]) {
            int to = (i + e) % n;
            //list[to].pb(i + n);
            gr[i + n]++;
        }
    }

    for (i = 0; i <= 2 * n; i++)
        ans[i] = -1;

    ans[0] = ans[n] = 0;
    Q.push(0);
    Q.push(n);

    while (!Q.empty()) {
        int node = Q.front(); Q.pop();

        if (ans[node] == 0) {
            for (auto e : s[(node < n ? 1 : 0)]) {
                int to = (node + n - e) % n;
                if (node < n) to += n;

                if (ans[to] != -1) continue;
                ans[to] = 1;
                Q.push(to);
            }
        } else {
            for (auto e : s[(node < n ? 1 : 0)]) {
                int to = (node + n - e) % n;
                if (node < n) to += n;

                if (ans[to] != -1) continue;
                if (--gr[to] == 0) {
                    ans[to] = 0;
                    Q.push(to);
                }
            }
        }
    }

    for (i = 1; i < n; i++) {
        if (ans[i] == 1)
            printf("Win ");
        if (ans[i] == 0)
            printf("Lose ");
        if (ans[i] == -1)
            printf("Loop ");
    }
    printf("\n");

    for (i = 1 + n; i < 2 * n; i++) {
        if (ans[i] == 1)
            printf("Win ");
        if (ans[i] == 0)
            printf("Lose ");
        if (ans[i] == -1)
            printf("Loop ");
    }
    printf("\n");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 7011

int n, k, i, x;
vector<int> s[2];
int dp[2][maxN];

int solve(int id, int node) {
    bool any = false;
    int to, ans;

    if (dp[id][node] == -1) {
        dp[id][node] = 1;

        for (auto bonus : s[id]) {
            to = (node + bonus);
            if (to >= n) to -= n;

            ans = solve(id ^ 1, to);
            if (ans == 0) {
                dp[id][node] = 2;
                return 2;
            }

            if (ans == 1)
                any = true;
        }

        if (!any) dp[id][node] = 0;
    }

    return dp[id][node];
}

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    /* 0 - lose
     * 1 - loop
     * 2 - win
     */
    for (i = 0; i < n; i++)
        dp[0][i] = dp[1][i] = -1;
    dp[0][0] = dp[1][0] = 0;
    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 1; i < n; i++) {
        int ans = solve(0, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }
    printf("\n");

    for (i = 1; i < n; i++) {
        int ans = solve(1, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 7011

int n, k, i, x;
vector<int> s[2];
int dp[2][maxN];

int solve(int id, int node) {
    bool any = false;
    int to, ans;

    if (dp[id][node] == -1) {
        dp[id][node] = 1;

        for (auto bonus : s[id]) {
            to = (node + bonus);
            if (to >= n) to -= n;

            ans = solve(id ^ 1, to);
            if (ans == 0) {
                dp[id][node] = 2;
                return 2;
            }

            if (ans == 1)
                any = true;
        }

        if (!any) dp[id][node] = 0;
    }

    return dp[id][node];
}

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    /* 0 - lose
     * 1 - loop
     * 2 - win
     */
    for (i = 0; i < n; i++)
        dp[0][i] = dp[1][i] = -1;
    dp[0][0] = dp[1][0] = 0;
    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

for (int times = 1; times <= 3; times++) {
    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }
}

    for (i = 1; i < n; i++) {
        int ans = solve(0, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }
    printf("\n");

    for (i = 1; i < n; i++) {
        int ans = solve(1, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 7011

int n, k, i, x;
vector<int> s[2];
int dp[2][maxN];

int solve(int id, int node) {
    bool any = false;
    int to, ans;

    if (dp[id][node] == -1) {
        dp[id][node] = 1;

        for (auto bonus : s[id]) {
            to = (node + bonus);
            if (to >= n) to -= n;

            ans = solve(id ^ 1, to);
            if (ans == 0) {
                dp[id][node] = 2;
                return 2;
            }

            if (ans == 1)
                any = true;
        }

        if (!any) dp[id][node] = 0;
    }

    return dp[id][node];
}

int main()
{
    //freopen("test.in","r",stdin);

    scanf("%d", &n);

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[0].pb(x);
    }

    scanf("%d", &k);
    for (i = 1; i <= k; i++) {
        scanf("%d", &x);
        s[1].pb(x);
    }

    /* 0 - lose
     * 1 - loop
     * 2 - win
     */
    for (i = 0; i < n; i++)
        dp[0][i] = dp[1][i] = -1;
    dp[0][0] = dp[1][0] = 0;
    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 0; i < n; i++) {
        if (dp[0][i] == 1) dp[0][i] = -1;
        if (dp[1][i] == 1) dp[1][i] = -1;
    }

    for (i = 0; i < n; i++) {
        solve(0, i);
        solve(1, i);
    }

    for (i = 1; i < n; i++) {
        int ans = solve(0, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }
    printf("\n");

    for (i = 1; i < n; i++) {
        int ans = solve(1, i);
        if (ans == 0)
            printf("Lose ");
        if (ans == 1)
            printf("Loop ");
        if (ans == 2)
            printf("Win ");
    }

    return 0;
}


#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>

using namespace std;
typedef long long LL;

class Solution {
    int n,k1,k2;
    vector<int> k;
    vector<set<int>> s;
    set<int> s1,s2;
    bool in(int v,set<int> s){
        return s.find(v)!=s.end();
    }

public:
    void sol(){
        cin>>n;
        k=vector<int> (3);
        s=vector<set<int>>(3);
        cin>>k[1];
        for (int i=0;i<k[1];i++){
            int v;
            cin>>v;
            s[1].insert(v);
        }
        cin>>k[2];
        for (int i=0;i<k[2];i++){
            int v;
            cin>>v;
            s[2].insert(v);
        }
        vector<vector<int>> dp=vector<vector<int>>(3,vector<int>(n,-1));// index start with 1
        for (int p=1;p<=2;p++){
            for (int i=1;i<=n-1;i++){

                if (in(n-i,s[p])) dp[p][i]=1;

            }
        }
        int cnt;
        do{
             cnt=0;
            for (int p=1;p<=2;p++){
                for (int i=1;i<=n-1;i++){
                    if (dp[p][i]!=-1) continue;
                    bool b=false;
                    for (int v:s[p])
                    {
                        int ni=(i+v)%n; //!=0
                        if (dp[3-p][ni]==0) {
                            dp[p][i]=1;
                            cnt++;
                            b=true;
                            break;
                        }
                        if (dp[3-p][ni]==-1) {b=true;}

                    }
                    if (!b) {
                        dp[p][i]=0;
                        cnt++;
                    }
                }
            }

        }while(cnt!=0);
        for (int p=1;p<=2;p++){
            for (int i=1;i<=n-1;i++){
                switch( dp[p][i])
                {
                case 1:
                {
                    cout<<"Win ";
                    break;
                }
                case 0:
                {
                    cout<<"Lose ";
                    break;
                }
                case -1:
                {
                    cout<<"Loop ";
                    break;
                }
                }
            }
            cout<<endl;
        }
    }
};

int main(int argc, char *argv[])
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    Solution s;
    s.sol();
    return 0;
}


#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>

using namespace std;
typedef long long LL;

class Solution {
    int n;//k1,k2;
    vector<int> k;
    vector<set<int>> s;
    vector<vector<int>> dp,need;
    //set<int> s1,s2;
    bool in(int v,set<int> s){
        return s.find(v)!=s.end();
    }
    void dfs(int p,int i){
        if (dp[p][i]!=-1) return;
        dp[p][i]=0;
        int vp=3-p;
        for (int v:s[vp]){
            int ni=(i-v+n)%n;
            if (ni!=0 && dp[vp][ni]!=1){
                dp[vp][ni]=1;
                for (int u:s[p]){
                    int y=(ni-u+n)%n;
                    need[p][y]--;
                    if (need[p][y]==0) dfs(p,y);
                }
            }
        }
    }

public:
    void sol(){
        cin>>n;
        k=vector<int> (3);
        s=vector<set<int>>(3);
        cin>>k[1];
        for (int i=0;i<k[1];i++){
            int v;
            cin>>v;
            s[1].insert(v);
        }
        cin>>k[2];
        for (int i=0;i<k[2];i++){
            int v;
            cin>>v;
            s[2].insert(v);
        }
        /*vector<vector<int>> */dp=vector<vector<int>>(3,vector<int>(n,-1));// index start with 1
        /*vector<vector<int>> */need=vector<vector<int>>(3);
        need[1]=vector<int>(n,k[1]);
        need[2]=vector<int>(n,k[2]);
        dfs(1,0);
        dfs(2,0);
 /*
        for (int p=1;p<=2;p++){
            for (int i=1;i<=n-1;i++){

                if (in(n-i,s[p])) dp[p][i]=1;

            }
        }
        int cnt;
        do{
             cnt=0;
            for (int p=1;p<=2;p++){
                for (int i=1;i<=n-1;i++){
                    if (dp[p][i]!=-1) continue;
                    bool b=false;
                    for (int v:s[p])
                    {
                        int ni=(i+v)%n; //!=0
                        if (dp[3-p][ni]==0) {
                            dp[p][i]=1;
                            cnt++;
                            b=true;
                            break;
                        }
                        if (dp[3-p][ni]==-1) {b=true;}

                    }
                    if (!b) {
                        dp[p][i]=0;
                        cnt++;
                    }
                }
            }

        }while(cnt!=0);
*/
        for (int p=1;p<=2;p++){
            for (int i=1;i<=n-1;i++){
                switch( dp[p][i])
                {
                case 1:
                {
                    cout<<"Win ";
                    break;
                }
                case 0:
                {
                    cout<<"Lose ";
                    break;
                }
                case -1:
                {
                    cout<<"Loop ";
                    break;
                }
                }
            }
            cout<<endl;
        }
    }
};

int main(int argc, char *argv[])
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    Solution s;
    s.sol();
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define pb push_back
typedef long long ll;
ll n,m,k,a[7777],b[7777],cnt[7777];
vector<ll>g[15555];
bool win[15555],loose[15555],used[15555];
ll degree[15555];
void dfs(ll v) {
	used[v] = true;
	for (ll to:g[v])
		if (!used[to]) {
			if (loose[v])
				win[to] = true;
			else if (--degree[to] == 0)
				loose[to] = true;
			else
				continue;
			dfs (to);
		}
}
void read(ll &x)
{
	scanf("%lld",&x);
}
int main()
{
	cin>>n>>m;
	for(ll i=1;i<=m;i++)
		read(a[i]);
	cin>>k;
	for(ll i=1;i<=k;i++)
		read(b[i]);
	for(ll i=1;i<n;i++)
	{
		for(ll j=1;j<=m;j++)
			g[((i+a[j])%n)*2+1].pb(i*2),degree[i*2]++;
		for(ll j=1;j<=k;j++)
			g[((i+b[j])%n)*2].pb(i*2+1),degree[i*2+1]++;
	}
	loose[0]=loose[1]=1;
	dfs(0);
	dfs(1);
	for(ll i=1;i<n;i++)
		if(win[i*2])
			printf("Win ");
		else if(loose[i*2])
			printf("Lose ");
		else
			printf("Loop ");
	cout<<endl;
	for(ll i=1;i<n;i++)
		if(win[i*2+1])
			printf("Win ");
		else if(loose[i*2+1])
			printf("Lose ");
		else
			printf("Loop ");
}


#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define pb push_back
typedef long long ll;
ll n,m,k,a[7777],b[7777],cnt[7777];
vector<ll>g[15555];
bool win[15555],loose[15555],used[15555];
ll degree[15555];
void dfs (ll v) {
	used[v] = true;
	for (ll to:g[v])
		if (!used[to]) {
			if (loose[v])
				win[to] = true;
			else if (--degree[to] == 0)
				loose[to] = true;
			else
				continue;
			dfs (to);
		}
}
void read(ll &x)
{
	scanf("%lld",&x);
}
int main()
{
	cin>>n>>m;
	for(ll i=1;i<=m;i++)
		read(a[i]);
	cin>>k;
	for(ll i=1;i<=k;i++)
		read(b[i]);
	for(ll i=1;i<n;i++)
	{
		for(ll j=1;j<=m;j++)
			g[(i+a[j])%n*2+1].pb(i*2),degree[i*2]++;
		for(ll j=1;j<=k;j++)
			g[(i+b[j])%n*2].pb(i*2+1),degree[i*2+1]++;
	}
	loose[0]=loose[1]=1;
	for(ll i=0;i<2*n;i++)
		if(!used[i])
			dfs(i);
	for(ll i=1;i<n;i++)
		if(win[i*2])
			printf("Win ");
		else if(loose[i*2])
			printf("Loose ");
		else
			printf("Loop ");
	cout<<endl;
	for(ll i=1;i<n;i++)
		if(win[i*2+1])
			printf("Win ");
		else if(loose[i*2+1])
			printf("Loose ");
		else
			printf("Loop ");
}


#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define pb push_back
typedef int ll;
ll n,m,k,a[7777],b[7777];
vector<ll>g[15555];
bool win[15555],loose[15555],used[15555];
ll degree[15555];
void dfs(ll v) {
	used[v] = true;
	for (ll to:g[v])
		if (!used[to]) {
			if (loose[v])
				win[to] = true;
			else if (--degree[to] == 0)
				loose[to] = true;
			else
				continue;
			dfs (to);
		}
}
void read(ll &x)
{
	scanf("%d",&x);
}
int main()
{
	cin>>n>>m;
	for(ll i=1;i<=m;i++)
		read(a[i]);
	cin>>k;
	for(ll i=1;i<=k;i++)
		read(b[i]);
	for(ll i=1;i<n;i++)
	{
		for(ll j=1;j<=m;j++)
			g[((i+a[j])%n)*2+1].pb(i*2),degree[i*2]++;
		for(ll j=1;j<=k;j++)
			g[((i+b[j])%n)*2].pb(i*2+1),degree[i*2+1]++;
	}
	loose[0]=loose[1]=1;
	dfs(0);
	dfs(1);
	for(ll i=1;i<n;i++)
		if(win[i*2])
			printf("Win ");
		else if(loose[i*2])
			printf("Lose ");
		else
			printf("Loop ");
	cout<<endl;
	for(ll i=1;i<n;i++)
		if(win[i*2+1])
			printf("Win ");
		else if(loose[i*2+1])
			printf("Lose ");
		else
			printf("Loop ");
}


#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define pb push_back
typedef int ll;
ll n,m,k,a[7777],b[7777];
vector<ll>g[15555];
bool win[15555],loose[15555],used[15555];
ll degree[15555];
void dfs(ll v) {
	used[v] = true;
	vector<ll>child;
	if(v&1)
	{
		ll ver=(v-1)/2;
		for(ll i=1;i<=m;i++)
			child.pb((ver-a[i]+n)%n*2);
	}
	else
	{
		ll ver=v/2;
		for(ll i=1;i<=k;i++)
			child.pb((ver-b[i]+n)%n*2+1);
	}
	for(ll to:child)
		if (!used[to]) {
			if (loose[v])
				win[to] = true;
			else if (--degree[to] == 0)
				loose[to] = true;
			else
				continue;
			dfs (to);
		}
	child.resize(0);
	child.shrink_to_fit();
}
void read(ll &x)
{
	scanf("%d",&x);
}
int main()
{
	cin>>n>>m;
	for(ll i=1;i<=m;i++)
		read(a[i]);
	cin>>k;
	for(ll i=1;i<=k;i++)
		read(b[i]);
	for(ll i=1;i<n;i++)
	{
		for(ll j=1;j<=m;j++)
			degree[i*2]++;
		for(ll j=1;j<=k;j++)
			degree[i*2+1]++;
	}
	loose[0]=loose[1]=1;
	dfs(0);
	dfs(1);
	for(ll i=1;i<n;i++)
		if(win[i*2])
			printf("Win ");
		else if(loose[i*2])
			printf("Lose ");
		else
			printf("Loop ");
	cout<<endl;
	for(ll i=1;i<n;i++)
		if(win[i*2+1])
			printf("Win ");
		else if(loose[i*2+1])
			printf("Lose ");
		else
			printf("Loop ");
}


#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
ll n,m,k,a[7777],b[7777],win[15555],lose[15555],w[15555],deg[15555];
void dfs(ll x)
{
	w[x]=1;
	vector<ll>v;
	if(x&1)
	{
		ll ver=(x-1)/2;
		for(ll i=1;i<=m;i++)
			v.push_back((ver-a[i]+n)%n*2);
	}
	else
	{
		ll ver=x/2;
		for(ll i=1;i<=k;i++)
			v.push_back((ver-b[i]+n)%n*2+1);
	}
	for(ll to:v)
	{
		if(w[to])
			continue;
		if(lose[x])
			win[to]=1;
		else if(--deg[to]==0)
			lose[to]=1;
		else
			continue;
		dfs(to);
	}
	v.clear();
}
int main()
{
	cin>>n>>m;
	for(ll i=1;i<=m;i++)
		cin>>a[i];
	cin>>k;
	for(ll i=1;i<=k;i++)
		cin>>b[i];
	for(ll i=1;i<n;i++)
		deg[i*2]+=m,deg[i*2+1]+=k;
	lose[0]=lose[1]=1;
	dfs(0);
	dfs(1);
	for(ll i=1;i<n;i++)
		if(win[i*2])
			printf("Win ");
		else if(lose[i*2])
			printf("Lose ");
		else
			printf("Loop ");
	cout<<endl;
	for(ll i=1;i<n;i++)
		if(win[i*2+1])
			printf("Win ");
		else if(lose[i*2+1])
			printf("Lose ");
		else
			printf("Loop ");
}


#include <bits/stdc++.h>
using namespace std;

int n;
int dp[7005][2]={};
int deg[7005][2]={};
vector< int> turns[2];
int res[7005][2]={};

queue<pair<int, int>>q;

int main()
{
  cin>>n;
  int i,j,k,t;
  int s1_size,s2_size;
  cin>>s1_size;
  for(i=0;i<s1_size;i++) {
    int val;
    cin >> val;
    turns[0].push_back(val);

  }
  cin>>s2_size;
  for(i=0;i<s2_size;i++) {
    int val;
    cin >> val;
    turns[1].push_back(val);
  }
  memset(dp,-1,sizeof(dp));
  dp[0][0]=0;
  dp[0][1]=0;
  q.push({0,0});
  q.push({0,1});
  while(!q.empty()){
    pair<int,int> top=q.front();
    int ply=top.second;
    int pos=top.first;
    q.pop();
    int prev_ply=(ply^1);
    for(int i=0;i<turns[prev_ply].size();i++){
      int prev_pos=(((pos-turns[prev_ply][i])+n)%n);
      if(dp[prev_pos][prev_ply]!=-1)
        continue;
      if(!dp[pos][ply]){
        dp[prev_pos][prev_ply]=2;
        q.push({prev_pos,prev_ply});
      }
      else{
        deg[prev_pos][prev_ply]++;
        if(deg[prev_pos][prev_ply]==turns[prev_ply].size()){
          dp[prev_pos][prev_ply]=0;
          q.push({prev_pos,prev_ply});
        }
      }
    }
  }

  for(j=0;j<2;j++)
  {
    for(i=1;i<n;i++)
    {
      if(dp[i][j]==0)
        cout<<"Lose"<<" ";
      else if(dp[i][j]==-1)
        cout<<"Loop"<<" ";
      else
        cout<<"Win"<<" ";
    }
    cout<<endl;
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n;
vector <int> vs[2];
int visit[7005][2];
int dp[7000+5][2];
int dfs(int index, int ply)
{
//cout<<"the current index  and the player"<<index<<"  "<<ply<<endl;
if(dp[index][ply]==0 || dp[index][ply]==2)
{
		//cout<<" the value here is "<<dp[index][ply]<<endl;
int vv=dp[index][ply];
if(vv==1)
{
return 1;
}
else
{
	return (vv^2);
}
}
if(visit[index][ply]==1)
	return 1;
visit[index][ply]=1;
 int val=0;
  int i,j;
  for(i=0;i<vs[ply].size();i++)
  {
  	//cout<<" the value is "<<ply<<endl;
  	int prev_tt=(index+vs[ply][i]);
  	int tt=prev_tt%(n+1);
  	if(prev_tt>n)
  		tt=tt+1;
  	//cout<<"the value of the tt"<<tt<<endl;
  	 int ret= dfs(tt,(ply^1));

  	 //cout<<" my final value is "<<index<<"  "<<ply<<"  "<<ret<<endl;
  	 val= max(val,ret);
  	 //cout<<"end of iteration "<<endl;
  }
dp[index][ply]=val;
visit[index][ply]=0;
if(val==1)
	return val;
return (val^2);
}

int main()
{
cin>>n;
int temp;
cin>>temp;
int i,j;
memset(visit,0,sizeof(visit));
for(i=0;i<7005;i++)
{
	for(j=0;j<2;j++)
		dp[i][j]=-1;
}
for(i=0;i<temp;i++)
{ int temp1;
     cin>>temp1;
    dp[n-(temp1-1)][0]=2;
	vs[0].push_back(temp1);
}
cin>>temp;
for(i=0;i<temp;i++)
{ int temp1;
     cin>>temp1;
    dp[n-(temp1-1)][1]=2;
	vs[1].push_back(temp1);
}

for(i=2;i<=n;i++)
{
	//if(i==8)
 // cout<<"my iteration number is "<<i<<"******************"<<endl;
    dfs(i,0);
   // cout<<"the value at last set is "<<dp[i][0]<<endl;
}

for(i=2;i<=n;i++)
    dfs(i,1);
for(i=2;i<=n;i++)
{
		if(dp[i][0]==0)
		 cout<<"Lose"<<" ";
		else if(dp[i][0]==1)
			cout<<"Loop"<<" ";
		else
			cout<<"Win"<<" ";
}
cout<<endl;
for(i=2;i<=n;i++)
{
		if(dp[i][1]==0)
		 cout<<"Lose"<<" ";
		else if(dp[i][1]==1)
			cout<<"Loop"<<" ";
		else
			cout<<"Win"<<" ";
}
cout<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n;
int dp[7005][2];
int visit[7005][2];
int seen[7005][2];
vector< int> turns[2];
int res[7005][2];
int Dfs( int position  , int player )
{
    if(visit[position][player]==1) {
     return dp[position][player];
    }
    else if( seen [position][player]==1)
    {
        return 1;
    }
    else{
        seen[position][player]=1;
        int cur_max= 0;
        for(int i=0;i<turns[player].size();i++) {
            int temp= Dfs( ((position+turns[player][i])%n), player^1);
            int temp_max=temp;
            if(temp_max==2)
                temp=0;
            if(temp_max==0)
                temp=2;
            cur_max=max(cur_max,temp);
             if(cur_max==2)
                 break;
        }
        visit[position][player]=1;
        dp[position][player]=cur_max;
        return cur_max;
    }
}

int main()
{
    cin>>n;
    int i,j,k,t;
    int s1_size,s2_size;
    cin>>s1_size;
    for(i=0;i<s1_size;i++) {
        int val;
        cin >> val;
        turns[0].push_back(val);

    }
    cin>>s2_size;
    for(i=0;i<s2_size;i++) {
        int val;
        cin >> val;
        turns[1].push_back(val);
    }
    dp[0][0]=0, dp[0][0]=0, visit[0][0]=1, visit[0][1]=1;
    for(i=1;i<n;i++)
    {
        for(j=1;j<2;j++)
        {
            dp[i][j]=0;
            visit[i][j]=0;
            seen[i][j]=0;
        }
    }
    for(i=0;i<s1_size;i++) {
     visit[n-turns[0][i]][0]=1;
        dp[n-turns[0][i]][0]=2;
    }
    for(i=0;i<s2_size;i++) {
        visit[n-turns[1][i]][1]=1;
        dp[n-turns[1][i]][1]=2;
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<2;j++)
        {
           res[i][j]=Dfs(i,j);
            for(k=0;k<n;k++)
            {
                for(t=0;t<2;t++)
                 seen[k][t]=0;
            }
        }
    }
    for(j=0;j<2;j++)
    {
      for(i=1;i<n;i++)
         {
            if(res[i][j]==0)
            cout<<"Lose"<<" ";
            else if(res[i][j]==1)
                cout<<"Loop"<<" ";
            else
                cout<<"Win"<<" ";
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n;
int dp[7005][2];
int visit[7005][2];
int seen[7005][2];
vector< int> turns[2];
int res[7005][2];
int Dfs( int position  , int player )
{
  if(visit[position][player]==1) {
    return dp[position][player];
  }
  else if( seen [position][player]==1)
  {
    return 1;
  }
  else{
    seen[position][player]=1;
    int cur_max= 0;
    for(int i=0;i<turns[player].size();i++) {
      int temp= Dfs( ((position+turns[player][i])%n), player^1);
      int temp_max=temp;
      if(temp_max==2)
        temp=0;
      if(temp_max==0)
        temp=2;
      cur_max=max(cur_max,temp);
      if(cur_max==2)
        break;
    }
    visit[position][player]=1;
    dp[position][player]=cur_max;
    return cur_max;
  }
}

int main()
{
  cin>>n;
  int i,j,k,t;
  int s1_size,s2_size;
  cin>>s1_size;
  for(i=0;i<s1_size;i++) {
    int val;
    cin >> val;
    turns[0].push_back(val);

  }
  cin>>s2_size;
  for(i=0;i<s2_size;i++) {
    int val;
    cin >> val;
    turns[1].push_back(val);
  }
  dp[0][0]=0, dp[0][0]=0, visit[0][0]=1, visit[0][1]=1;
  for(i=1;i<n;i++)
  {
    for(j=1;j<2;j++)
    {
      dp[i][j]=0;
      visit[i][j]=0;
      seen[i][j]=0;
    }
  }
  for(i=0;i<s1_size;i++) {
    visit[n-turns[0][i]][0]=1;
    dp[n-turns[0][i]][0]=2;
  }
  for(i=0;i<s2_size;i++) {
    visit[n-turns[1][i]][1]=1;
    dp[n-turns[1][i]][1]=2;
  }
  for(i=0;i<n;i++)
  {
    for(j=0;j<2;j++)
    {
      res[i][j]=Dfs(i,j);
    }
  }
  for(j=0;j<2;j++)
  {
    for(i=1;i<n;i++)
    {
      if(res[i][j]==0)
        cout<<"Lose"<<" ";
      else if(res[i][j]==1)
        cout<<"Loop"<<" ";
      else
        cout<<"Win"<<" ";
    }
    cout<<endl;
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n;
int dp[7005][2];
int visit[7005][2];
int seen[7005][2];
vector< int> turns[2];
int res[7005][2];
int Dfs( int position  , int player )
{
    if(visit[position][player]==1) {
     return dp[position][player];
    }
    else if( seen [position][player]==1)
    {
        return 1;
    }
    else{
        seen[position][player]=1;
        int cur_max= 0;
        for(int i=0;i<turns[player].size();i++) {
            int temp= Dfs( ((position+turns[player][i])%n), player^1);
            int temp_max=temp;
            if(temp_max==2)
                temp=0;
            if(temp_max==0)
                temp=2;
            cur_max=max(cur_max,temp);
             if(cur_max==2)
                 break;
        }
        seen[position][player]=0;
        visit[position][player]=1;
        dp[position][player]=cur_max;
        return cur_max;
    }
}

int main()
{
    cin>>n;
    int i,j,k,t;
    int s1_size,s2_size;
    cin>>s1_size;
    for(i=0;i<s1_size;i++) {
        int val;
        cin >> val;
        turns[0].push_back(val);

    }
    cin>>s2_size;
    for(i=0;i<s2_size;i++) {
        int val;
        cin >> val;
        turns[1].push_back(val);
    }
    dp[0][0]=0, dp[0][0]=0, visit[0][0]=1, visit[0][1]=1;
    for(i=1;i<n;i++)
    {
        for(j=1;j<2;j++)
        {
            dp[i][j]=0;
            visit[i][j]=0;
            seen[i][j]=0;
        }
    }
    for(i=0;i<s1_size;i++) {
     visit[n-turns[0][i]][0]=1;
        dp[n-turns[0][i]][0]=2;
    }
    for(i=0;i<s2_size;i++) {
        visit[n-turns[1][i]][1]=1;
        dp[n-turns[1][i]][1]=2;
    }
    for(i=0;i<n;i++)
    {
        for(j=0;j<2;j++)
        {
           res[i][j]=Dfs(i,j);
            for(k=0;k<n;k++)
            {
                for(t=0;t<2;t++)
                 seen[k][t]=0;
            }
        }
    }
    for(j=0;j<2;j++)
    {
      for(i=1;i<n;i++)
         {
            if(res[i][j]==0)
            cout<<"Lose"<<" ";
            else if(res[i][j]==1)
                cout<<"Loop"<<" ";
            else
                cout<<"Win"<<" ";
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n;
int dp[7005][2]={};
int deg[7005][2]={};
vector< int> turns[2];

queue<pair<int, int>>q;

int main()
{
  cin>>n;
  int i,j,k,t;
  int s1_size,s2_size;
  cin>>s1_size;
  for(i=0;i<s1_size;i++) {
    int val;
    cin >> val;
    turns[0].push_back(val);

  }
  cin>>s2_size;
  for(i=0;i<s2_size;i++) {
    int val;
    cin >> val;
    turns[1].push_back(val);
  }
  memset(dp,-1,sizeof(dp));
  dp[0][0]=0;
  dp[0][1]=0;
  q.push({0,0});
  q.push({0,1});
  while(!q.empty()){
    pair<int,int> top=q.front();
    int ply=top.second;
    int pos=top.first;
    q.pop();
    int prev_ply=(ply^1);
    for(int i=0;i<turns[prev_ply].size();i++){
      int prev_pos=(((pos-turns[prev_ply][i])+n)%n);
      if(dp[prev_pos][prev_ply]!=-1)
        continue;
      if(!dp[pos][ply]){
        dp[prev_pos][prev_ply]=2;
        q.push({prev_pos,prev_ply});
      }
      else{
        deg[prev_pos][prev_ply]++;
        if(deg[prev_pos][prev_ply]==turns[prev_ply].size()){
          dp[prev_pos][prev_ply]=0;
          q.push({prev_pos,prev_ply});
        }
      }
    }
  }

  for(j=0;j<2;j++)
  {
    for(i=1;i<n;i++)
    {
      if(dp[i][j]==0)
        cout<<"Lose"<<" ";
      else if(deg[i][j]<turns[j].size() && dp[i][j]!=2)
        cout<<"Loop"<<" ";
      else
        cout<<"Win"<<" ";
    }
    cout<<endl;
  }
  return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <exception>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <deque>
using namespace std;

typedef long long lo;
typedef vector< vector<lo> > vvl;
typedef vector< lo > vl;
typedef pair<lo, lo> ll;
typedef vector< pair<lo, lo> > vll;
typedef vector< vll > vvll;
typedef pair<lo, pair<lo, lo> > lll;
typedef pair<lo, lll > llll;
typedef vector<lll> vlll;
typedef vector<vvl> vvvl;
typedef vector<set<lo> > vs;
typedef map<lo, map<lo, lo> > mm;

#define N 10100
#define M 1001000
#define LOGN 20

lo state[N][2]; // 1 win, 2 lose
lo dst[N][2], k[2], reachGood[N][2];

int main() {
	// ios_base::sync_with_stdio(false);
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	lo n;
	cin >> n;
	for (lo j=0;j<2;j++) {
		cin >> k[j];
		for (lo i=0;i<k[j];i++)
			cin >> dst[i][j];
	}

	// for (lo i=0;i<k[1];i++)
		// cout << dst[1][i] << " " ;
	deque< ll > q;
	q.push_back({0,0});
	q.push_back({0, 1});
	state[0][0]=state[0][1] = 2;
	while (!q.empty()){
		ll v = q.front();
		q.pop_front();
		// cout << v.first << " " << v.second << " " << state[v.first][v.second] << "\n";
		lo other = 1-v.second;
		if (state[v.first][v.second]==2) {
			for (lo i=0;i<k[other];i++) {
				lo pos = (v.first - dst[i][other] + n) %n;
				// cout << "try to add winning to the queue" << pos << " " << other << " " << state[pos][other] << " " << (dst[i][other] )  << "\n";
				if (state[pos][other]!= 0) continue;
				state[pos][other] = 1;
				q.push_back({pos, other});
			}
		} else {
			for (lo i=0;i<k[other];i++) {
				lo pos = (v.first - dst[i][other] + n) %n;
				if (state[pos][other]!=0) continue;
				reachGood[pos][other]++;
				if (reachGood[pos][other]==k[other]) {
					state[pos][other]=2;
					q.push_back({pos, other});
				}
			}
		}
	}
	for (lo j=0;j<2;j++, cout <<"\n")
		for (lo i =1;i<n;i++)
			cout << (state[i][j] == 0 ? "Loop" : state[i][j]==1 ? "Win": "Lose") <<" ";
	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <exception>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <deque>
using namespace std;

typedef long long lo;
typedef vector< vector<lo> > vvl;
typedef vector< lo > vl;
typedef pair<lo, lo> ll;
typedef vector< pair<lo, lo> > vll;
typedef vector< vll > vvll;
typedef pair<lo, pair<lo, lo> > lll;
typedef pair<lo, lll > llll;
typedef vector<lll> vlll;
typedef vector<vvl> vvvl;
typedef vector<set<lo> > vs;
typedef map<lo, map<lo, lo> > mm;

#define N 5100
#define M 1001000
#define LOGN 20

lo state[N][2]; // 1 win, 2 lose
lo dst[N][2], k[2], reachGood[N][2];

int main() {
	// ios_base::sync_with_stdio(false);
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	lo n;
	cin >> n;
	for (lo j=0;j<2;j++) {
		cin >> k[j];
		for (lo i=0;i<k[j];i++)
			cin >> dst[i][j];
	}

	// for (lo i=0;i<k[1];i++)
		// cout << dst[1][i] << " " ;
	deque< ll > q;
	q.push_back({0,0});
	q.push_back({0, 1});
	state[0][0]=state[0][1] = 2;
	while (!q.empty()){
		ll v = q.front();
		q.pop_front();
		// cout << v.first << " " << v.second << " " << state[v.first][v.second] << "\n";
		lo other = 1-v.second;
		if (state[v.first][v.second]==2) {
			for (lo i=0;i<k[other];i++) {
				lo pos = (v.first - dst[i][other] + n) %n;
				// cout << "try to add winning to the queue" << pos << " " << other << " " << state[pos][other] << " " << (dst[i][other] )  << "\n";
				if (state[pos][other]!= 0) continue;
				state[pos][other] = 1;
				q.push_back({pos, other});
			}
		} else {
			for (lo i=0;i<k[other];i++) {
				lo pos = (v.first - dst[i][other] + n) %n;
				if (state[pos][other]!=0) continue;
				reachGood[pos][other]++;
				if (reachGood[pos][other]==k[other]) {
					state[pos][other]=2;
					q.push_back({pos, other});
				}
			}
		}
	}
	for (lo j=0;j<2;j++, cout <<"\n")
		for (lo i =1;i<n;i++)
			cout << (state[i][j] == 0 ? "Loop" : state[i][j]==1 ? "Win": "Lose") <<" ";
	return 0;
}


#include<cstdio>
#include<queue>
#include<algorithm>
#include<vector>
using namespace std;

int ans[2][7000];
int lcnt[2][7000];

int M[2];
vector<int> cands[2];

int main(){
    int N; scanf("%d",&N);
    for(int i=0;i<2;i++){
        scanf("%d",M+i);
        for(int j=0;j<M[i];j++){
            int x; scanf("%d",&x);
            cands[i].push_back(x);
        }
    }

    typedef pair<int,int> pii;
    queue<pii> q;
    const int WIN = 1, LOSE = -1;
    ans[0][0] = ans[1][0] = LOSE;
    q.push({0,0}); q.push({1,0});

    while(!q.empty()){
        auto here = q.front(); q.pop();
        int who = here.first, idx = here.second;
        int other = who^1;
        if(ans[who][idx]==LOSE){
            for(int d:cands[other]){
                int there = (idx - d + N)%N;
                if(!ans[other][there]){
                    ans[other][there] = WIN;
                    q.push({other, there});
                }
            }
        }
        else{
            for(int d:cands[other]){
                int there = (idx - d + N)%N;
                lcnt[other][there]++;
                if(lcnt[other][there] == cands[other].size()){
                    ans[other][there] = LOSE;
                    q.push({other, there});
                }
            }
        }
    }

    for(int i=0;i<2;i++){
        for(int j=1;j<N;j++)
            printf(ans[i][j]==WIN ? "Win " : (ans[i][j]==LOSE ? "Lose " : "Loop "));
        printf("\n");
    }
}


#include<cstdio>
#include<queue>
#include<algorithm>
#include<vector>
using namespace std;

int ans[2][7000];
int lcnt[2][7000];

int M[2];
vector<int> cands[2];

int main(){
    int N; scanf("%d",&N);
    for(int i=0;i<2;i++){
        scanf("%d",M+i);
        for(int j=0;j<M[i];j++){
            int x; scanf("%d",&x);
            cands[i].push_back(x);
        }
    }

    typedef pair<int,int> pii;
    queue<pii> q;
    const int WIN = 1, LOSE = -1;
    ans[0][0] = ans[1][0] = LOSE;
    q.push({0,0}); q.push({1,0});

    while(!q.empty()){
        auto here = q.front(); q.pop();
        int who = here.first, idx = here.second;
        int other = who^1;
        if(ans[who][idx]==LOSE){
            for(int d:cands[other]){
                int there = (idx - d + N)%N;
                if(!ans[other][there]){
                    ans[other][there] = WIN;
                    q.push({other, there});
                }
            }
        }
        else{
            for(int d:cands[other]){
                int there = (idx - d + N)%N;
                lcnt[other][there]++;
                if(lcnt[other][there] == cands[other].size()){
                    ans[other][there] = LOSE;
                    q.push({other, there});
                }
            }
        }
    }

    for(int i=0;i<2;i++){
        for(int j=1;j<N;j++)
            printf(ans[i][j]==WIN ? "Win " : "Lose ");
        printf("\n");
    }
}


#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int const N = 7654;

int ans[N][2];
int k1, k2, n;

vector<int> m[2];

int sub(int a, int b){
	return (a - b + n) % n;
}

void solve(int id){
	int f[N][2];
	int d[N][2];
	int w[N][2];
	memset(f, 0, sizeof(f));
	memset(d, 0, sizeof(d));
	memset(w, 0, sizeof(w));
	vector<pair<int, int> > q;

	q.push_back(make_pair(0, id));
	w[0][id] = w[0][id ^ 1] = 1;
	while(q.size()){
		int s = q.back().first;
		int p = q.back().second;
		int p1 = p ^ 1;
		q.pop_back();
		for(int i=0;i<m[p1].size();++i){
			int ns = sub(s, m[p1][i]);
			f[ns][p1] = max(f[ns][p1], 2 - f[s][p]);
			if(!w[ns][p1]){
				++d[ns][p1];
				if(f[ns][p1]){
					w[ns][p1] = 1;
					q.push_back(make_pair(ns, p1));
				}else{
					if(d[ns][p1] == m[p1].size()){
						w[ns][p1] = 1;
						q.push_back(make_pair(ns, p1));
					}
				}
			}
		}
	}

	for(int j=0;j<2;++j){
		for(int i=0;i<n;++i){
			if(w[i][j]){
				if(f[i][j] == 2){
					ans[i][j] = 2;
				}else{
					ans[i][j] = 1;
				}
			}
		}
	}
}

void solve(){
	scanf("%d",&n);
	scanf("%d",&k1);
	for(int i=0;i<k1;++i){
		int v;
		scanf("%d",&v);
		m[0].push_back(v);
	}
	scanf("%d",&k2);
	for(int i=0;i<k2;++i){
		int v;
		scanf("%d",&v);
		m[1].push_back(v);
	}

	solve(0);
	solve(1);

	for(int j=0;j<2;++j){
		for(int i=1;i<n;++i){
			if(ans[i][j] == 2){
				printf("Win ");
			}else if(ans[i][j] == 0){
				printf("Loop ");
			}else{
				printf("Lose ");
			}
		}
		printf("\n");
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<memory.h>

using namespace std;

int const N = 7654;

int ans[N][2];
int k1, k2, n;

vector<int> m[2];

int sub(int a, int b){
	return (a - b + n) % n;
}

void solve(int id){
	int f[N][2];
	int d[N][2];
	int w[N][2];
	memset(f, 0, sizeof(f));
	memset(d, 0, sizeof(d));
	memset(w, 0, sizeof(w));
	vector<pair<int, int> > q;

	q.push_back(make_pair(0, id));
	q.push_back(make_pair(0, id ^ 1));
	w[0][id] = w[0][id ^ 1] = 1;

	while(q.size()){
		int s = q.back().first;
		int p = q.back().second;
		int p1 = p ^ 1;
		q.pop_back();
		for(int i=0;i<m[p1].size();++i){
			int ns = sub(s, m[p1][i]);
			if(!w[ns][p1]){
				f[ns][p1] = max(f[ns][p1], 2 - f[s][p]);
				if(f[ns][p1]){
					w[ns][p1] = 1;
					q.push_back(make_pair(ns, p1));
				}else{
					++d[ns][p1];
					if(d[ns][p1] == m[p1].size()){
						w[ns][p1] = 1;
						q.push_back(make_pair(ns, p1));
					}
				}
			}
		}
	}

	for(int j=0;j<2;++j){
		for(int i=0;i<n;++i){
			if(w[i][j]){
				if(f[i][j] == 2){
					ans[i][j] = 2;
				}else{
					ans[i][j] = 1;
				}
			}
		}
	}
}

void solve(){
	scanf("%d",&n);
	scanf("%d",&k1);
	for(int i=0;i<k1;++i){
		int v;
		scanf("%d",&v);
		m[0].push_back(v);
	}
	scanf("%d",&k2);
	for(int i=0;i<k2;++i){
		int v;
		scanf("%d",&v);
		m[1].push_back(v);
	}

	solve(0);

	for(int j=0;j<2;++j){
		for(int i=1;i<n;++i){
			if(ans[i][j] == 2){
				printf("Win ");
			}else if(ans[i][j] == 0){
				printf("Loop ");
			}else{
				printf("Lose ");
			}
		}
		printf("\n");
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<memory.h>

using namespace std;

int const N = 7654;

int ans[N][2];
int k1, k2, n;

vector<int> m[2];

int sub(int a, int b){
	return (a - b + n) % n;
}

void solve(int id){
	int f[N][2];
	int d[N][2];
	int w[N][2];
	memset(f, 0, sizeof(f));
	memset(d, 0, sizeof(d));
	memset(w, 0, sizeof(w));
	vector<pair<int, int> > q;

	q.push_back(make_pair(0, id));
	w[0][id] = w[0][id ^ 1] = 1;
	while(q.size()){
		int s = q.back().first;
		int p = q.back().second;
		int p1 = p ^ 1;
		q.pop_back();
		for(int i=0;i<m[p1].size();++i){
			int ns = sub(s, m[p1][i]);
			f[ns][p1] = max(f[ns][p1], 2 - f[s][p]);
			if(!w[ns][p1]){
				++d[ns][p1];
				if(f[ns][p1]){
					w[ns][p1] = 1;
					q.push_back(make_pair(ns, p1));
				}else{
					if(d[ns][p1] == m[p1].size()){
						w[ns][p1] = 1;
						q.push_back(make_pair(ns, p1));
					}
				}
			}
		}
	}

	for(int j=0;j<2;++j){
		for(int i=0;i<n;++i){
			if(w[i][j]){
				if(f[i][j] == 2){
					ans[i][j] = 2;
				}else{
					ans[i][j] = 1;
				}
			}
		}
	}
}

void solve(){
	scanf("%d",&n);
	scanf("%d",&k1);
	for(int i=0;i<k1;++i){
		int v;
		scanf("%d",&v);
		m[0].push_back(v);
	}
	scanf("%d",&k2);
	for(int i=0;i<k2;++i){
		int v;
		scanf("%d",&v);
		m[1].push_back(v);
	}

	solve(0);
	solve(1);

	for(int j=0;j<2;++j){
		for(int i=1;i<n;++i){
			if(ans[i][j] == 2){
				printf("Win ");
			}else if(ans[i][j] == 0){
				printf("Loop ");
			}else{
				printf("Lose ");
			}
		}
		printf("\n");
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int const N = 7654;

int ans[N][2];
int k1, k2, n;

vector<int> m[2];

int sub(int a, int b){
	return (a - b + n) % n;
}

void solve(int id){
	int f[N][2];
	int d[N][2];
	int w[N][2];
	memset(f, 0, sizeof(f));
	memset(d, 0, sizeof(d));
	memset(w, 0, sizeof(w));
	vector<pair<int, int> > q;

	q.push_back(make_pair(0, id));
	q.push_back(make_pair(0, id ^ 1));
	w[0][id] = w[0][id ^ 1] = 1;

	while(q.size()){
		int s = q.back().first;
		int p = q.back().second;
		int p1 = p ^ 1;
		q.pop_back();
		for(int i=0;i<m[p1].size();++i){
			int ns = sub(s, m[p1][i]);
			if(!w[ns][p1]){
				f[ns][p1] = max(f[ns][p1], 2 - f[s][p]);
				if(f[ns][p1]){
					w[ns][p1] = 1;
					q.push_back(make_pair(ns, p1));
				}else{
					++d[ns][p1];
					if(d[ns][p1] == m[p1].size()){
						w[ns][p1] = 1;
						q.push_back(make_pair(ns, p1));
					}
				}
			}
		}
	}

	for(int j=0;j<2;++j){
		for(int i=0;i<n;++i){
			if(w[i][j]){
				if(f[i][j] == 2){
					ans[i][j] = 2;
				}else{
					ans[i][j] = 1;
				}
			}
		}
	}
}

void solve(){
	scanf("%d",&n);
	scanf("%d",&k1);
	for(int i=0;i<k1;++i){
		int v;
		scanf("%d",&v);
		m[0].push_back(v);
	}
	scanf("%d",&k2);
	for(int i=0;i<k2;++i){
		int v;
		scanf("%d",&v);
		m[1].push_back(v);
	}

	solve(0);

	for(int j=0;j<2;++j){
		for(int i=1;i<n;++i){
			if(ans[i][j] == 2){
				printf("Win ");
			}else if(ans[i][j] == 0){
				printf("Loop ");
			}else{
				printf("Lose ");
			}
		}
		printf("\n");
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define F first
#define S second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int INF = 1e9;
const int MAXN = 7005;
int n, iR, iM;
vi moves[2];
int ANS[MAXN][2];
int position[MAXN][2];
bool visited[MAXN][2];
queue<pair<pii, bool> > Q;
// 0 - Lose, 1 - Win, 2 - Loop, 3 - ?????
// 0 - Ricky, 1 - Morty

void input() {
	int x;
	cin >> n >> iR;
	for (int i = 0; i < iR; i++) {
		cin >> x;
		moves[0].PB(x);
	}
	cin >> iM;
	for (int i = 0; i < iM; i++) {
		cin >> x;
		moves[1].PB(x);
	}
	ANS[0][1] = ANS[1][1] = 0;
	position[0][1] = position[1][1] = MAXN;
}

int p(int x) {
	if (1 <= x && x <= n) return x;
	if (x > n) return x % n;
	return n + x;
}

// 1 - vert, 2 - R/M, 3 - 0/1
void count() {
	while (!Q.empty()) {
		pair<pii, bool> k = Q.front();
		Q.pop();
		if (visited[k.F.F][k.F.S]) continue;
		visited[k.F.F][k.F.S] = true;
		for (int i = 0; i < (int)moves[!k.F.S].size(); i++) {
			int m = moves[!k.F.S][i];
			int pos = p(k.F.F - m);
			if (k.S == 0) {
				ANS[pos][!k.F.S] = 1;
				Q.push(MP(MP(pos, !k.F.S), 1));
			}
			else {
				position[pos][!k.F.S]++;
				if (position[pos][!k.F.S] == moves[!k.F.S].size()) {
					ANS[pos][!k.F.S] = 0;
					Q.push(MP(MP(pos, !k.F.S), 0));
				}
			}
		}
	}
}

void solve() {
	for (int i = 2; i <= n; i++) {
		ANS[i][0] = ANS[i][1] = 3;
		position[i][0] = position[i][1] = 0;
	}
	Q.push(MP(MP(1, 0), 0));
	Q.push(MP(MP(1, 1), 0));
	count();
}

void output() {
	for (int j = 0; j <= 1; j++) {
		for (int i = 2; i <= n; i++) {
			if (ANS[i][j] == 0)
				cout << "Lose ";
			else if (ANS[i][j] == 1)
				cout << "Win ";
			else
				cout << "Loop ";
		}
		cout << "\n";
	}
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);

	input();
	solve();
	output();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define F first
#define S second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int INF = 1e9;
const int MAXN = 7005;
int n, iR, iM;
vi moves[2];
int ANS[2][MAXN];
bool visited[2][MAXN];
// 0 - Lose, 1 - Win, 2 - Loop, 3 - ?????
// 0 - Ricky, 1 - Morty

void input() {
	int x;
	cin >> n >> iR;
	for (int i = 0; i < iR; i++) {
		cin >> x;
		moves[0].PB(x);
	}
	cin >> iM;
	for (int i = 0; i < iM; i++) {
		cin >> x;
		moves[1].PB(x);
	}
	ANS[0][1] = ANS[1][1] = 0;
	visited[0][1] = visited[1][1] = true;
}

int p(int x) {
	if (1 <= x && x <= n) return x;
	if (x > n) return x % n;
	return n + x;
}

void count(int per, int index) {
	if (visited[per][index]) return;
	visited[per][index] = true;
	int ile = 0;
	for (int i = 0; i < moves[per].size(); i++) {
		int m = moves[per][i];
		count(!per, p(index + m));
		if (ANS[!per][p(index + m)] == 0) {
			ile++;
			ANS[per][index] = 1;
			return;
		}
		else if (ANS[!per][p(index + m)] == 1) {
			ile++;
		}
	}
	ANS[per][index] = 2;
	if (ile == moves[per].size())
		ANS[per][index] = 0;
}

void solve() {
	for (int i = 2; i <= n; i++) {
		ANS[0][i] = ANS[1][i] = 3;
		visited[0][i] = visited[1][i] = false;
	}
	for (int i = 0; i < iR; i++) {
		ANS[0][p(1 - moves[0][i])] = 1;
		visited[0][p(1 - moves[0][i])] = true;
	}
	for (int i = 0; i < iM; i++) {
		ANS[1][p(1 - moves[1][i])] = 1;
		visited[1][p(1 - moves[1][i])] = true;
	}
	for (int i = 2; i <= n; i++)
		count(0, i);
	for (int i = 2; i <= n; i++)
		count(1, i);
}

void output() {
	for (int j = 0; j <= 1; j++) {
		for (int i = 2; i <= n; i++) {
			if (ANS[j][i] == 0)
				cout << "Lose ";
			else if (ANS[j][i] == 1)
				cout << "Win ";
			else
				cout << "Loop ";
		}
		cout << "\n";
	}
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);

	input();
	solve();
	output();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007

#define mp make_pair
#define pb push_back
#define pii pair<int,int>

typedef long long ll;
typedef long double ld;

int arr[2][7010];
int s[2][7010];
int cnt[2][7010];
int k[2];
int n;
queue<pii > q;

int md(int i)
{
    int ans=i%n;
    while(ans<0)ans+=n;
    return ans;
}

void func(int pos, int ply)
{
    int idx;
    for(int i=0; i<k[ply^1]; i++)
    {
        idx=md(pos-s[ply^1][i]);
        if(arr[ply^1][idx]==-1)
        {
            if(arr[ply][pos]==0)
            {
                arr[ply^1][idx]=1;
                q.push(mp(ply^1,idx));
            }
            else if(arr[ply][pos]==1)
            {
                cnt[ply^1][idx]++;
                if(cnt[ply^1][idx]==k[ply^1])
                {
                    arr[ply^1][idx]=0;
                    q.push(mp(ply^1,idx));
                }
            }
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    memset(arr,-1,sizeof(arr));
	cin>>n;
	cin>>k[0];
	for(int i=0; i<k[0]; i++)
	{
	    cin>>s[0][i];
	}
	cin>>k[1];
	for(int i=0; i<k[1]; i++)
	{
	    cin>>s[1][i];
	}
	arr[0][0]=0;
	q.push(mp(0,0));
	arr[1][0]=0;
	q.push(mp(1,0));
	while(!q.empty())
	{
	    //cout<<q.front().second<<" "<<q.front().first<<endl;
	    func(q.front().second, q.front().first);
	    q.pop();
	}
	string arrs[3]={"Loop ","Lose ","Win "};
	for(int j=0; j<2; j++)
	{
    	for(int i=1; i<n; i++)
    	{
    	    cout<<arrs[arr[j][i]+1];
    	}
    	cout<<endl;
	}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define M 1000000007

#define mp make_pair
#define pb push_back

typedef long long ll;
typedef long double ld;

int arr[14010];
bool visited[14010];
vector<int> adj[14010];

void dfs(int n)
{
    visited[n]=true;
    int flag1=0, flag2=0;
    for(int i=0; i<adj[n].size(); i++)
    {
        if(!visited[adj[n][i]])dfs(adj[n][i]);
        if(arr[adj[n][i]]==1)flag1=1;
        else if(arr[adj[n][i]]!=2)flag2=1;
    }
    if(flag1==1)arr[n]=2;
    else if(flag2==0)arr[n]=1;
    else visited[n]=false;
    //cout<<n<<" "<<flag1<<" "<<flag2<<" "<<arr[n]<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int n; cin>>n;
	int k1; cin>>k1;
	int s1[k1];
	for(int i=0; i<k1; i++)
	{
	    cin>>s1[i];
	}
	int k2; cin>>k2;
	int s2[k2];
	for(int i=0; i<k2; i++)
	{
	    cin>>s2[i];
	}
	arr[1]=1; arr[n+1]=1; visited[1]=true; visited[n+1]=true;
	for(int i=2; i<=n; i++)
	{
	    for(int j=0; j<k1; j++)
	        adj[i].pb((i-1+s1[j])%n+1+n);
	}
	for(int i=n+2; i<=2*n; i++)
	{
	    for(int j=0; j<k2; j++)
	        adj[i].pb((i+s2[j]-n-1)%n+1);
	}
	for(int i=2; i<=2*n; i++)
	{
	    if(!visited[i])dfs(i);
	}
	for(int i=2; i<=2*n; i++)
	{
	    if(!visited[i])dfs(i);
	}
	string arrs[4]={"Loop ","Lose ","Win "};
	for(int i=2; i<=n; i++)
	{
	    cout<<arrs[arr[i]];
	}
	cout<<endl;
	for(int i=n+2; i<=2*n; i++)
	{
	    cout<<arrs[arr[i]];
	}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, y[2][7000], deg[2][7000];
vector<int> x[2];

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    freopen("in.txt", "r", stdin);
    cin >> n;
    for(int j = 0; j < 2; j++) {
        int sz; cin >> sz;
        x[j].resize(sz);
        for(int i = 0; i < sz; i++)
            cin >> x[j][i];
        for(int i = 0; i < n; i++) deg[j][i] = sz;
    }
    memset(y, -1, sizeof y);
    y[0][0] = y[1][0] = 0;
    queue<pair<int, int>> q;
    q.push({0, 0});
    q.push({1, 0});
    while(!q.empty()) {
        int a = q.front().first, b = q.front().second;
        q.pop();
        for(int k : x[!a]) {
            int bb = (b - k + n) % n;
            deg[!a][bb]--;
            if(y[!a][bb] != -1) continue;
            if(y[a][b] == 0) {
                y[!a][bb] = 1;
                q.push({!a, bb});
            } else if(deg[!a][bb] == 0) {
                y[!a][bb] = 0;
                q.push({!a, bb});
            }
        }
    }
    for(int i = 0; i < 2; i++, cout << '\n')
        for(int j = 1; j < n; j++)
            cout << (y[i][j] == 0 ? "Lose" : y[i][j] == 1 ? "Win" : "Loop") << ' ';
}


#include <bits/stdc++.h>

using namespace std;

int n, y[2][7000];
vector<int> x[2];

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //freopen("in.txt", "r", stdin);
    cin >> n;
    for(int j = 0; j < 2; j++) {
        int sz; cin >> sz;
        x[j].resize(sz);
        for(int i = 0; i < sz; i++)
            cin >> x[j][i];
    }
    memset(y, -1, sizeof y);
    y[0][0] = y[1][0] = 0;
    for(int cnt = 0; cnt < n; cnt++) {
        bool any = false;
        for(int i = 0; i < 2; i++)
            for(int j = 0; j < n; j++) {
                if(y[i][j] != -1) continue;
                bool all = true;
                for(int k : x[i]) {
                    int j1 = (j + k) % n;
                    all &= (y[!i][j1] == 1);
                    if(y[!i][j1] == 0) { y[i][j] = 1; any = true; }
                }
                if(y[i][j] != 1 && all) { y[i][j] = 0; any = true; }
            }
        if(!any) break;
    }
    for(int i = 0; i < 2; i++, cout << '\n')
        for(int j = 1; j < n; j++)
            cout << (y[i][j] == 0 ? "Lose" : y[i][j] == 1 ? "Win" : "Loop") << ' ';
}


#include <bits/stdc++.h>

using namespace std;

int n, y[2][7000], deg[2][7000];
vector<int> x[2];

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    for(int j = 0; j < 2; j++) {
        int sz; cin >> sz;
        x[j].resize(sz);
        for(int i = 0; i < sz; i++)
            cin >> x[j][i];
        for(int i = 0; i < n; i++) deg[j][i] = sz;
    }
    memset(y, -1, sizeof y);
    y[0][0] = y[1][0] = 0;
    queue<pair<int, int>> q;
    q.push({0, 0});
    q.push({1, 0});
    while(!q.empty()) {
        int a = q.front().first, b = q.front().second;
        q.pop();
        for(int k : x[!a]) {
            int bb = (b - k + n) % n;
            deg[!a][bb]--;
            if(y[!a][bb] != -1) continue;
            if(y[a][b] == 0) {
                y[!a][bb] = 1;
                q.push({!a, bb});
            } else if(deg[!a][bb] == 0) {
                y[!a][bb] = 0;
                q.push({!a, bb});
            }
        }
    }
    for(int i = 0; i < 2; i++, cout << '\n')
        for(int j = 1; j < n; j++)
            cout << (y[i][j] == 0 ? "Lose" : y[i][j] == 1 ? "Win" : "Loop") << ' ';
}