  /*                                                                                << Suirkhanov Meyirlan >>

    BISMILLAH (Allah will help you) =);

    bless my code =)

    //keep calm & just code(even if u don't know) :)
           ////,        ////
           \  /,      /  >.
            \  /,   _/  /.              K   K     ZZZZZZ
             \_  /_/   /.               K  K          Z
              \__/_   <                 K K          Z
              /<<< \_\_                 KK          Z
              /,)^>>_._ \               K K        Z
            (/   \ /\\                  K   K     ZZZZZZ
                  // ````
                 ((
        $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
        Insallah everything will be OK)

*/

///scanf ("%d%d", &x, &y);
///printf("%d", a)

//A$APs and Lils are around 0_0

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define pii pair < int , int >
#define pll pair < ll, ll >
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int N = 1e3 + 7;
const ld pi = 3.14159265359;
const ll INF = 1e9;

int n, a[N];

pair < int, int > p[N];

vector < pair < int, int > > v;

set < int > st;

bool u[N];

int main(){

  //freopen("INPUT.TXT", "r", stdin);
  //freopen("OUTPUT.TXT", "w", stdout);

  fast
  randoperation;

  ///           ||
  ///start here \/

  cin >> n;

  for(int i = 1; i <= n; i++){
    cin >> a[i];
    p[i].fi = a[i];
    p[i].se = i;
    st.insert(a[i]);
  }

  if(st.size() == 1){
    cout << "Exemplary pages.";
    return 0;
  }

  if(st.size() != 3){
    cout << "Unrecoverable configuration.";
    return 0;
  }

  for(int i = 1; i <= n; i++){
    if(!u[p[i].fi]){
      u[p[i].fi] = 1;
      v.pb(mp(p[i].fi, p[i].se));
    }
  }

  sort(v.begin(), v.end());

  int x1 = v[0].fi;
  int y1 = v[0].se;

  int x2 = v[1].fi;
  int y2 = v[1].se;

  int x3 = v[2].fi;
  int y3 = v[2].se;

  if((x1 + x3) / 2 == x2){
    cout << x2 - x1 << " ml. from cup #" << y1 << " to cup #" << y3 << '.';
    return 0;
  }
  else{
    cout << "Unrecoverable configuration.";
  }
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int n,a[1005],c[2000][2],sum,b=0,k=1;
	int average;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		sum=sum+a[i];
	}
	average=sum/n;
	if(average*n!=sum){
		printf("Unrecoverable configuration.\n");
	}
	else{
		for(int i=1;i<=n;i++){
			if(a[i]!=average){
				b=1;
				c[k][0]=i;
				c[k][1]=a[i];
				k++;
			}
		}
		if(k>3){
			printf("Unrecoverable configuration.\n");
		}
		else if(b==0){
			printf("Exemplary pages.\n");
		}
		else{
			if(c[1][1]<c[2][1]){
				printf("%d ml. from cup #%d to cup #%d.\n",(c[2][1]-c[1][1])/2,c[1][0],c[2][0]);
			}
			else{
				printf("%d ml. from cup #%d to cup #%d.\n",(c[1][1]-c[2][1])/2,c[2][0],c[1][0]);
			}
		}
	}
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int n,a[1005],c[2000][2],sum=0,b=0,k=1;
	int average;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		sum=sum+a[i];
	}
	average=sum/n;
	if(average*n!=sum){
		printf("Unrecoverable configuration.\n");
	}
	else{
		for(int i=1;i<=n;i++){
			if(a[i]!=average){
				b=1;
				c[k][0]=i;
				c[k][1]=a[i];
				k++;
			}
		}
		if(k>3){
			printf("Unrecoverable configuration.\n");
		}
		else if(b==0){
			printf("Exemplary pages.\n");
		}
		else{
			if(c[1][1]<c[2][1]){
				printf("%d ml. from cup #%d to cup #%d.\n",(c[2][1]-c[1][1])/2,c[1][0],c[2][0]);
			}
			else{
				printf("%d ml. from cup #%d to cup #%d.\n",(c[1][1]-c[2][1])/2,c[2][0],c[1][0]);
			}
		}
	}
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int n,a[1005],c[2000][2],sum,b=0,k=1;
	int average;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		sum=sum+a[i];
	}
	average=sum/n;
	if(average*n!=sum){
		printf("Unrecoverable configuration.\n");
	}
	else{
		for(int i=1;i<=n;i++){
			if(a[i]!=average){
				b=1;
				c[k][0]=i;
				c[k][1]=a[i];
				k++;
			}
		}
		if(k>3){
			printf("Unrecoverable configuration.\n");
		}
		if(b==0){
			printf("Exemplary pages.\n");
		}
		else{
			if(c[1][1]<c[2][1]){
				printf("%d ml. from cup #%d to cup #%d.\n",(c[2][1]-c[1][1])/2,c[1][0],c[2][0]);
			}
			else{
				printf("%d ml. from cup #%d to cup #%d.\n",(c[1][1]-c[2][1])/2,c[2][0],c[1][0]);
			}
		}
	}
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int n,a[1005],c[2000][2],sum=0,b=0,k=1;
	int average;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		sum=sum+a[i];
	}
	average=sum/n;
	if(average*n!=sum){
		printf("Unrecoverable configuration.\n");
	}
	else{
		for(int i=1;i<=n;i++){
			if(a[i]!=average){
				b=1;
				c[k][0]=i;
				c[k][1]=a[i];
				k++;
			}
		}
		if(k>3){
			printf("Unrecoverable configuration.\n");
		}
		if(b==0){
			printf("Exemplary pages.\n");
		}
		else{
			if(c[1][1]<c[2][1]){
				printf("%d ml. from cup #%d to cup #%d.\n",(c[2][1]-c[1][1])/2,c[1][0],c[2][0]);
			}
			else{
				printf("%d ml. from cup #%d to cup #%d.\n",(c[1][1]-c[2][1])/2,c[2][0],c[1][0]);
			}
		}
	}
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    map<int,int> numberToCount;
    vector<int> cups(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> cups[i];
        sum += cups[i];
        map<int,int>::iterator it = numberToCount.find(cups[i]);
        if (it == numberToCount.end()) {
            numberToCount.insert(pair<int,int>(cups[i], 1));
        } else {
            it->second++;
        }
    }
    if (sum % n != 0 || (numberToCount.find(0) != numberToCount.end() &&  numberToCount.find(0)->second > 1 && numberToCount.find(0)->second != n)) {
        cout << "Unrecoverable configuration." << endl;
    } else if (numberToCount.size() == 1){
        cout << "Exemplary pages." << endl;
    } else if (numberToCount.size() <= 3){
        int i = distance(cups.begin(), find(cups.begin(), cups.end(), numberToCount.begin()->first));
        int j = distance(cups.begin(), find(cups.begin(), cups.end(), (--numberToCount.end())->first));
        cout << ((--numberToCount.end())->first - numberToCount.begin()->first) / 2 << " ml. from cup #" << i+1 << " to cup #" << j+1 << "."
             << endl;
    } else {
        cout << "Unrecoverable configuration." << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    map<int,int> numberToCount;
    vector<int> cups(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> cups[i];
        sum += cups[i];
        map<int,int>::iterator it = numberToCount.find(cups[i]);
        if (it == numberToCount.end()) {
            numberToCount.insert(pair<int,int>(cups[i], 1));
        } else {
            it->second++;
        }
    }
    if (sum % n != 0 || (numberToCount.find(0) != numberToCount.end() &&  numberToCount.find(0)->second > 1)) {
        cout << "Unrecoverable configuration." << endl;
    } else if (numberToCount.size() == 1){
        cout << "Exemplary pages." << endl;
    } else if (numberToCount.size() <= 3){
        int i = distance(cups.begin(), find(cups.begin(), cups.end(), numberToCount.begin()->first));
        int j = distance(cups.begin(), find(cups.begin(), cups.end(), (--numberToCount.end())->first));
        cout << ((--numberToCount.end())->first - numberToCount.begin()->first) / 2 << " ml. from cup #" << i+1 << " to cup #" << j+1 << "."
             << endl;
    } else {
        cout << "Unrecoverable configuration." << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> cups(n + 1);
    vector<int> unSortedCups(n + 1);
    vector<int> distinctML;
    unSortedCups[0] = -1;
    cups[0] = -1;
    for (int i = 1; i <= n; i++) {
        cin >> cups[i];
        unSortedCups[i] = cups[i];
    }
    int countZero = count(cups.begin(), cups.end(), 0);
    if (countZero > 1 && countZero != n) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    sort(cups.begin(), cups.end());
    int ml;

    for (int i = 2; i <= n; i++) {
        if (cups[i] != cups[i - 1]) {
            distinctML.push_back(cups[i - 1]);
        }
        if (distinctML.size() > 3) {
            cout << "Unrecoverable configuration." << endl;
            return 0;
        }
    }
    if (distinctML.size() == 0 || distinctML.back() != cups.back()) {
        distinctML.push_back(cups.back());
    }
    if (distinctML.size() > 3) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    if (distinctML.size() == 1) {
        cout << "Exemplary pages." << endl;
    } else if (distinctML.size() == 2 && (distinctML[1] - distinctML[0]) % 2 != 0) {
        cout << "Unrecoverable configuration." << endl;
    } else {
        int i = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML.front()));
        int j = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML.back()));
        cout << (distinctML.back() - distinctML.front()) / 2 << " ml. from cup #" << i << " to cup #" << j << "."
             << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> cups(n + 1);
    vector<int> unSortedCups(n + 1);
    vector<int> distinctML;
    for (int i = 1; i <= n; i++) {
        cin >> cups[i];
        unSortedCups[i] = cups[i];
    }

    sort(cups.begin(), cups.end());
    int ml;

    for (int i = 2; i <= n; i++) {
        if (cups[i] != cups[i - 1]) {
            distinctML.push_back(cups[i - 1]);
        }
        if (distinctML.size() > 3) {
            cout << "Unrecoverable configuration." << endl;
            return 0;
        }
    }
    if (distinctML.size() == 0 || distinctML.back() != cups.back()) {
        distinctML.push_back(cups.back());
    }
    if (distinctML.size() > 3) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    if (distinctML.size() == 1) {
        cout << "Exemplary pages." << endl;
    } else if (distinctML.size() == 2) {
        cout << "Unrecoverable configuration." << endl;
    } else {
        int i = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML[0]));
        int j = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML[2]));
        cout << (distinctML[2] - distinctML[0]) / 2 << " ml. from cup #" << i << " to cup #" << j << "." << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    map<int,int> numberToCount;
    vector<int> cups(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> cups[i];
        sum += cups[i];
        map<int,int>::iterator it = numberToCount.find(cups[i]);
        if (it == numberToCount.end()) {
            numberToCount.insert(pair<int,int>(cups[i], 1));
        } else {
            it->second++;
        }
    }
    if (sum % n != 0) {
        cout << "Unrecoverable configuration." << endl;
    } else if (numberToCount.size() == 1){
        cout << "Exemplary pages." << endl;
    } else if (numberToCount.size() <= 3){
        int i = distance(cups.begin(), find(cups.begin(), cups.end(), numberToCount.begin()->first));
        int j = distance(cups.begin(), find(cups.begin(), cups.end(), (--numberToCount.end())->first));
        cout << ((--numberToCount.end())->first - numberToCount.begin()->first) / 2 << " ml. from cup #" << i+1 << " to cup #" << j+1 << "."
             << endl;
    } else {
        cout << "Unrecoverable configuration." << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> cups(n + 1);
    vector<int> unSortedCups(n + 1);
    vector<int> distinctML;
    unSortedCups[0] = -1;
    cups[0] = -1;
    for (int i = 1; i <= n; i++) {
        cin >> cups[i];
        unSortedCups[i] = cups[i];
    }

    if (count(cups.begin(), cups.end(), 0) > 1) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    sort(cups.begin(), cups.end());
    int ml;

    for (int i = 2; i <= n; i++) {
        if (cups[i] != cups[i - 1]) {
            distinctML.push_back(cups[i - 1]);
        }
        if (distinctML.size() > 3) {
            cout << "Unrecoverable configuration." << endl;
            return 0;
        }
    }
    if (distinctML.size() == 0 || distinctML.back() != cups.back()) {
        distinctML.push_back(cups.back());
    }
    if (distinctML.size() > 3) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    if (distinctML.size() == 1) {
        cout << "Exemplary pages." << endl;
    } else if (distinctML.size() == 2 && (distinctML[1] - distinctML[0]) % 2 != 0) {
        cout << "Unrecoverable configuration." << endl;
    } else {
        int i = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML.front()));
        int j = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML.back()));
        cout << (distinctML.back() - distinctML.front()) / 2 << " ml. from cup #" << i << " to cup #" << j << "."
             << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> cups(n + 1);
    vector<int> unSortedCups(n + 1);
    vector<int> distinctML;
    for (int i = 1; i <= n; i++) {
        cin >> cups[i];
        unSortedCups[i] = cups[i];
    }

    sort(cups.begin(), cups.end());
    int ml;

    for (int i = 2; i <= n; i++) {
        if (cups[i] != cups[i - 1]) {
            distinctML.push_back(cups[i - 1]);
        }
        if (distinctML.size() > 3) {
            cout << "Unrecoverable configuration." << endl;
            return 0;
        }
    }
    if (distinctML.size() == 0 || distinctML.back() != cups.back()) {
        distinctML.push_back(cups.back());
    }
    if (distinctML.size() > 3) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    if (distinctML.size() == 1) {
        cout << "Exemplary pages." << endl;
    } else if (distinctML.size() == 2) {
        cout << "Unrecoverable configuration." << endl;
    } else {
        int i = *find(unSortedCups.begin(), unSortedCups.end(), distinctML[0]);
        int j = *find(unSortedCups.begin(), unSortedCups.end(), distinctML[2]);
        cout << (distinctML[2] - distinctML[0]) / 2 << " ml. from cup #" << i << " to cup #" << j << "." << endl;
    }

    return 0;
}


//
// Created by JZKM4041 on 1/29/2020.
//

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> cups(n + 1);
    vector<int> unSortedCups(n + 1);
    vector<int> distinctML;
    unSortedCups[0] = -1;
    cups[0] = -1;
    for (int i = 1; i <= n; i++) {
        cin >> cups[i];
        unSortedCups[i] = cups[i];
    }

    sort(cups.begin(), cups.end());
    int ml;

    for (int i = 2; i <= n; i++) {
        if (cups[i] != cups[i - 1]) {
            distinctML.push_back(cups[i - 1]);
        }
        if (distinctML.size() > 3) {
            cout << "Unrecoverable configuration." << endl;
            return 0;
        }
    }
    if (distinctML.size() == 0 || distinctML.back() != cups.back()) {
        distinctML.push_back(cups.back());
    }
    if (distinctML.size() > 3) {
        cout << "Unrecoverable configuration." << endl;
        return 0;
    }

    if (distinctML.size() == 1) {
        cout << "Exemplary pages." << endl;
    } else if (distinctML.size() == 2 && (distinctML[1] - distinctML[0]) % 2 != 0) {
        cout << "Unrecoverable configuration." << endl;
    } else {
        int i = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML.front()));
        int j = distance(unSortedCups.begin(), find(unSortedCups.begin(), unSortedCups.end(), distinctML.back()));
        cout << (distinctML.back() - distinctML.front()) / 2 << " ml. from cup #" << i << " to cup #" << j << "."
             << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
#define pb      push_back
#define all(v)  v.begin(),v.end()
#define see(x)  cout<<#x<<" : "<<(x)<<endl;
#define ya      cout<<"YES"<<endl;
#define no      cout<<"NO"<<endl;
#define ff      first
#define sc      second
typedef long long ll;
typedef pair<ll,ll> pii;

int n,a,b,v;
int aa[1009];
int main()
{
    int i,sum=0,cnt=0,ans=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>aa[i];
        sum+=aa[i];
    }
    if(sum%n)
    {
        puts("Unrecoverable configuration.");
        exit(0);
    }
    v=sum/n;
    for(i=1;i<=n;i++)
    {
        if(v==aa[i])cnt++;
        else
        {
            if(aa[i]>v)ans=aa[i]-v,a=i;
            else
            b=i;
        }
    }
    if(cnt==n)
    {
        puts("Exemplary pages.");
        exit(0);
    }
    if(cnt==n-2)
    {
        cout<<ans<< " ml. from cup #"<<b<< " to cup #"<<a<<"."<<endl;
        exit(0);
    }
    puts("Unrecoverable configuration.");
    return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
#define pb      push_back
#define all(v)  v.begin(),v.end()
#define see(x)  cout<<#x<<" : "<<(x)<<endl;
#define ya      cout<<"YES"<<endl;
#define no      cout<<"NO"<<endl;
#define ff      first
#define sc      second
typedef long long ll;
typedef pair<ll,ll> pii;

int n,a,b,v;
int aa[1009];
int main()
{
    int i,sum=0,cnt=0,ans=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>aa[i];
        sum+=aa[i];
    }
    if(sum%n)
    {
        puts("Unrecoverable configuration.");
        exit(0);
    }
    v=sum/n;
    for(i=1;i<=n;i++)
    {
        if(v==aa[i])cnt++;
        else
        {
            if(aa[i]>v)ans=aa[i]-v,a=i;
            else
            b=i;
        }
    }
    if(cnt==n)
    {
        puts("Exemplary pages.");
        exit(0);
    }
    if(cnt==n-2)
    {
        cout<<ans<< " ml. from cup #"<<b<< "to cup #"<<a<<"."<<endl;
        exit(0);
    }
    puts("Unrecoverable configuration.");
    return 0;
}


#include<bits/stdc++.h>
#include<string.h>
using namespace std;
#define pb      push_back
#define all(v)  v.begin(),v.end()
#define see(x)  cout<<#x<<" : "<<(x)<<endl;
#define ya      cout<<"YES"<<endl;
#define no      cout<<"NO"<<endl;
#define ff      first
#define sc      second
typedef long long ll;
typedef pair<ll,ll> pii;

int n,a,b,v;
int aa[1009];
int main()
{
    int i,sum=0,cnt=0,ans=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>aa[i];
        sum+=aa[i];
    }
    if(sum%n)
    {
        puts("Unrecoverable configuration.");
        exit(0);
    }
    v=sum/n;
    for(i=1;i<=n;i++)
    {
        if(v==aa[i])cnt++;
        else
        {
            if(aa[i]>v)ans=aa[i]-v,a=i;
            else
            b=i;
        }
    }
    if(cnt==n)
    {
        puts("Exemplary pages.");
        exit(0);
    }
    if(cnt==n-2)
    {
        cout<<ans<< "ml. from cup #"<<b<< "to cup #"<<a<<"."<<endl;
        exit(0);
    }
    puts("Unrecoverable configuration.");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    if(n==3)
    {
       sor(v);
       if(v[0]==v[1]&&v[1]==v[2])
        cout <<"Exemplary pages.";
       else if(float(v[0]+v[2])/2==v[1])
       {
           int a,b,c;
           for(int i=0;i<n;i++)
           {
               if(arr[i]==v[0])
                a=i+1;
               else if(arr[i]==v[1]) b=i+1;
               else if(arr[i]==v[2]) c=i+1;
           }
            cout <<(v[2]-v[0])/2<<" ml. "<<"from cup #"<<a<<" to cup #"<<c<<".";
       }
       else cout<<"Unrecoverable configuration.";
       return 0;
    }
    if(n==2)
    {
        if(arr[0]==arr[1])
            cout <<"Exemplary pages.";
        else if((arr[0]+arr[1])%2==0)
        {
             if(arr[0]>arr[1])
            cout <<(arr[0]-arr[1])/2<<" ml. "<<"from cup #"<<"2"<<" to cup #"<<"1"<<".";
            else  cout <<(arr[1]-arr[0])/2<<" ml. "<<"from cup #"<<"1"<<" to cup #"<<"2"<<".";
        }
        else cout <<"Unrecoverable configuration.";
        return 0;
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n-1;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"from cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    if(n==2)
    {
        if(arr[0]==arr[1])
            cout <<"Exemplary pages.";
        else if((arr[0]+arr[1])%2==0)
        {
             if(arr[0]>arr[1])
            cout <<(arr[0]-arr[1])/2<<" ml. "<<"from cup #"<<"2"<<" to cup #"<<"1"<<".";
            else  cout <<(arr[1]-arr[0])/2<<" ml. "<<"from cup #"<<"1"<<" to cup #"<<"2"<<".";
        }
        else cout <<"Unrecoverable configuration.";
        return 0;
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n-1;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"from cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"form cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    if(n==2)
    {
        if(arr[0]==arr[1])
            cout <<"Exemplary pages.";
        else if((arr[0]+arr[1])%2==0)
        {
             if(arr[0]>arr[1])
            cout <<(arr[0]-arr[1])/2<<" ml. "<<"from cup #"<<"2"<<" to cup #"<<"1"<<".";
            else  cout <<(arr[1]-arr[0])/2<<" ml. "<<"from cup #"<<"1"<<" to cup #"<<"2"<<".";
        }
        else cout <<"Unrecoverable configuration.";
        return 0;
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"from cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"from cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    if(n==2)
    {
        if((arr[0]+arr[1])%2==0)
        {
             if(arr[0]>arr[1])
            cout <<(arr[0]-arr[1])/2<<" ml. "<<"from cup #"<<"2"<<" to cup #"<<"1"<<".";
            else  cout <<(arr[1]-arr[0])/2<<" ml. "<<"from cup #"<<"1"<<" to cup #"<<"2"<<".";
        }
        else cout <<"Unrecoverable configuration.";
        return 0;
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"from cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pi acos(-1)
#define mod 1000000007
#define F first
#define S second
#define sor(v) sort(v.begin(),v.end())
#define unique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define sp1 " "
#define en1 "\n"
#define ll long long int
#define se(n) fixed<<setprecision(n)
#define float double
int main()
{
   // freopen("input.txt","w",stdin);
    int n;
    cin >>n;
    ll arr[n];
    vector<int> v;
    for(int i=0;i<n;i++)
    {
        cin >>arr[i];
        v.pb(arr[i]);
    }
    if(n==3)
    {
       sor(v);
       if(v[0]==v[1]&&v[1]==v[2])
        cout <<"Exemplary pages.";
       else if(float(v[0]+v[2])/2==v[1])
       {
           int a,b,c;
           for(int i=0;i<n;i++)
           {
               if(arr[i]==v[0])
                a=i+1;
               else if(arr[i]==v[1]) b=i+1;
               else if(arr[i]==v[2]) c=i+1;
           }
            cout <<(v[2]-arr[0])/2<<" ml. "<<"from cup #"<<a<<" to cup #"<<c<<".";
       }
       else cout<<"Unrecoverable configuration.";
       return 0;
    }
    if(n==2)
    {
        if(arr[0]==arr[1])
            cout <<"Exemplary pages.";
        else if((arr[0]+arr[1])%2==0)
        {
             if(arr[0]>arr[1])
            cout <<(arr[0]-arr[1])/2<<" ml. "<<"from cup #"<<"2"<<" to cup #"<<"1"<<".";
            else  cout <<(arr[1]-arr[0])/2<<" ml. "<<"from cup #"<<"1"<<" to cup #"<<"2"<<".";
        }
        else cout <<"Unrecoverable configuration.";
        return 0;
    }
    sor(v);
    int count=1,ma=0,t;
    for(int i=0;i<n-1;i++)
    {
      if(v[i]==v[i+1])
            count++;
      else
      {
          if(count>ma)
          {
            ma=count;
            t=v[i];
          }
          count=1;
      }
    }
   if(count>ma)
   {
       ma=count;
       t=v[n-1];
   }
    if(ma==n)
    {
        cout <<"Exemplary pages.";
        return 0;
    }
    if(n-ma!=2)
    {
        cout <<"Unrecoverable configuration.";
        return 0;
    }
    v.clear();
    vector< pair<int,int> > w;
    for(int i=0;i<n;i++)
    {
      if(arr[i]!=t)
            w.pb(mp(arr[i],i+1));
    }
    if(t==float(w[0].F+w[1].F)/2)
    {
        if(w[0].F>w[1].F)
            cout <<(w[0].F-w[1].F)/2<<" ml. "<<"from cup #"<<w[1].S<<" to cup #"<<w[0].S<<".";
            else  cout <<(w[1].F-w[0].F)/2<<" ml. "<<"from cup #"<<w[0].S<<" to cup #"<<w[1].S<<".";
            return 0;
    }
    cout <<"Unrecoverable configuration.";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define lint long long
 int main(){

     long long sum=0,n,vb,vs,x,z,y,ma=INT_MIN,mi=INT_MAX,mai=-1,mii=-1;
     bool first =true;
     cin>>n;
        int *input=new int[n];
     for(int i=0;i<n;i++){
          cin>>input[i];
          sum+=input[i];
        if(ma<input[i]){
            ma=input[i];mai=i+1;
        }
        if(mi>input[i]){
            mi=input[i];mii=i+1;
        }}
      if(mi==ma){
          cout<<"Exemplary pages.";
      }
      else{
          int av=sum/n;
          sum=0;
          input[mii-1]=(ma+mi)/2;
          input[mai-1]=(ma+mi)/2;
          for(int i=0;i<n;i++){
              sum+=input[i];
          }
          if(av==sum/n&&(ma+mi)%2==0){
              cout<<ma-av<<" ml. from cup #"<<mii<<" to cup #"<<mai<<".";
          }
          else{
              cout<<"Unrecoverable configuration.";
          }
      }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define lint long long
 int main(){

     long long ansi,n,vb,vs,x,z,y;
     bool first =true;
     cin>>n;
         set<int, greater <int>> st;
         map<int,int> ct,ind;
         set <int, greater <int> > :: iterator itr,itr1;
     for(int i=0;i<n;i++){
          cin>>x;
          st.insert(x);
          ct[x]+=1;
          ind[x]=i+1;
      }
      if(st.size()==1){
          cout<<"Exemplary pages.";
      }
      else if(st.size()==2){
          itr=st.begin();
          x=*itr;
          itr++;
          y=*itr;
           if(ct[x]==1&&ct[y]==1&&(x+y)%2==0){
              cout<<max(x,y)/2<<" ml. from cup #"<<ind[y]<<" to cup #"<<ind[x]<<".";

          }
          else{
                cout<<"Unrecoverable configuration.";
          }
      }
      else if(st.size()==3){
          itr=st.begin();
          x=*itr;
          itr++;
          y=*itr;
          z=*(++itr);
          if(ct[x]==1&&ct[z]==1&&(x+z)/2==y){
              cout<<x-y<<" ml. from cup #"<<ind[z]<<" to cup #"<<ind[x]<<".";

          }
          else{
                cout<<"Unrecoverable configuration.";
          }
      }
      else {
          cout<<"Unrecoverable configuration.";
      }
     return 0;
 }


#include<bits/stdc++.h>
using namespace std;
#define lint long long
 int main(){

     long long ansi,n,vb,vs,x,z,y;
     bool first =true;
     cin>>n;
         set<int, greater <int>> st;
         map<int,int> ct,ind;
         set <int, greater <int> > :: iterator itr,itr1;
     for(int i=0;i<n;i++){
          cin>>x;
          st.insert(x);
          ct[x]+=1;
          ind[x]=i+1;
      }
      if(st.size()==1){
          cout<<"Exemplary pages.";
      }
      else if(st.size()==3){
          itr=st.begin();
          x=*itr;
          itr++;
          y=*itr;
          z=*(++itr);
          if(ct[x]==1&&ct[z]==1&&(x+z)/2==y){
              cout<<x-y<<" ml. from cup #"<<ind[z]<<" to cup #"<<ind[x]<<".";

          }
          else{
                cout<<"Unrecoverable configuration.";
          }
      }
      else if(st.size()==2||st.size()>=4){
          cout<<"Unrecoverable configuration.";
      }
     return 0;
 }


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

//#define PB push_back
#define PB emplace_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

/*
bool seive[1010000];
vi prime;

void seiveGen(int limit) {
    limit += 100;
    int sqrtn = sqrt(limit);
    for(int i = 3; i <= sqrtn; i += 2) {
            if(!seive[i>>1]) {
                    for(int j = i * i; j < limit; j += i + i) {
                            seive[j>>1] = 1;
                    }
            }
    }
    prime.PB(2);
    for(int i = 3; i < limit; i += 2) {
            if(!seive[i>>1]) prime.PB(i);
    }
}
*/

//
//debug
#ifdef yamin
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

clock_t tStart = clock();
#define timeStamp dbg("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif // yamin

#define move __move

//WHAT'S UP BITCHES

const int maxn = 7e3 + 10;

int in_stack[maxn][2];
int movecnt[2], move[2][maxn];
int n;

int func(int u, int p) {
	if(u == 0) return 2;
	int ret = 2;
	in_stack[u][p] = 1;
	for(int i = 0; i < movecnt[p]; ++i) {
		int v = u + move[p][i];
		if(v >= n) v -= n;
//		if(v == 0) dbg(u, p);
		if(in_stack[v][1-p]) ret = min(ret, 1);
		else ret = min(ret, 2 - func(v, 1 - p));
	}
	in_stack[u][p] = 0;
	return ret;
}

int main() {
#ifndef yamin
	optimize();
#endif

	cin >> n;
	cin >> movecnt[0];
	for(int i = 0; i < movecnt[0]; ++i) cin >> move[0][i];
	cin >> movecnt[1];
	for(int i = 0; i < movecnt[1]; ++i) cin >> move[1][i];
	for(int i = 0; i < 2; ++i) {
		for(int j = 1; j < n; ++j) {
			int val = func(j, i);
			if(val == 0) cout << "Win ";
			else if(val == 1) cout << "Loop ";
			else if(val == 2) cout << "Lose ";
		}
		cout << endl;
	}
	return 0;
}


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

#define sz(x) (int)(x).size()
#define F first
#define S second
#define mpa make_pair
#define pb emplace_back

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector< pii > vii;
typedef vector< vi > vvi;

const int maxn = 7e3 + 11;
int n;
vi s[2];

const int loose = 0;
const int win = 1;
bool vis[2][maxn][2];
int deg[maxn][2];

int32_t main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int k, i = 0; i < 2; i++) {
		cin >> k;
		s[i].resize(k);
		for (auto &x : s[i])
			cin >> x;
	}

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

	while (!q[loose].empty()) {
		while (!q[loose].empty()) {
			pii fr = q[loose].front();
			q[loose].pop();
			int player = fr.second ^ 1;
			int me = fr.first;
			for (auto x : s[player]) {
				int wp = me - x;
				while (wp < 0) wp += n;
				if (!vis[win][wp][player] && !vis[loose][wp][player]) {
					vis[win][wp][player] = 1;
					q[win].push( { wp, player} );
				}
			}
		}

		while (!q[win].empty()) {
			pii fr = q[win].front();
			q[win].pop();
			int player = fr.second ^ 1;
			int me = fr.first;
			for (auto x : s[player]) {
				int lp = me - x;
				while (lp < 0) lp += n;
				if (!vis[loose][lp][player] && !vis[win][lp][player] && ++deg[lp][player] == sz(s[player])) {
					vis[loose][lp][player] = 1;
					q[loose].push( {lp, player} );
				}
			}
		}
	}

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


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

#define sz(x) (int)(x).size()
#define F first
#define S second
#define mpa make_pair
#define pb emplace_back

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector< pii > vii;
typedef vector< vi > vvi;

const int maxn = 7e3 + 11;
int n;
vi s[2];

const int loose = 0;
const int win = 1;
bool vis[2][maxn][2];
int deg[maxn][2];

int32_t main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int k, i = 0; i < 2; i++) {
		cin >> k;
		s[i].resize(k);
		for (auto &x : s[i])
			cin >> x;
	}

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

	while (!q[loose].empty()) {
		while (!q[loose].empty()) {
			pii fr = q[loose].front();
			q[loose].pop();
			int player = fr.second ^ 1;
			int me = fr.first;
			for (auto x : s[player]) {
				int wp = me - x;
				while (wp < 0) wp += n;
				if (!vis[win][wp][player] && !vis[loose][wp][player]) {
					vis[win][wp][player] = 1;
					q[win].push( { wp, player} );
				}
			}
		}

		while (!q[win].empty()) {
			pii fr = q[win].front();
			q[win].pop();
			int player = fr.second ^ 1;
			int me = fr.first;
			for (auto x : s[player]) {
				int lp = me - x;
				while (lp < 0) lp += n;
				if (!vis[loose][lp][player] && !vis[win][lp][player] && ++deg[lp][player] == sz(s[player])) {
					vis[loose][lp][player] = 1;
					q[loose].push( {lp, player} );
				}
			}
		}
	}

	for (int player = 0; player < 2; player++) {
		for (int i = 1; i < n; i++) {
			if (vis[win][i][player])
				cout << "Win ";
			else if (vis[loose][i][player])
				cout << "Loose ";
			else
				cout << "Loop ";
		}
		cout << endl;
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define loop(i, n) for(int i = 0;i < int(n);i++)
#define rloop(i, n) for(int i = int(n);i >= 0;i--)
#define range(i, a, b) for(int i = int(a);i <= int(b);i++)
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1, v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1, v2, v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1, v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1, v2, v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define endl '\n'

typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
typedef long long ll;
typedef pair<int, int> pii;

const int N = 7007;
set<int> arr[N][2];
int ans[N][2];
int n, k[2];
vi v[2];

int main() {

#ifndef ONLINE_JUDGE
    freopen("in.in", "r", stdin);
    //freopen("out.in", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int x;
    memset(ans, -1, sizeof ans);
    queue<pair<int, pii> > q;
    cin >> n;
    loop(z, 2) {
        cin >> k[z];
        loop(j, k[z]) {
            cin >> x;
            q.push({z, {1, n - x}});
            range(i, 1, n - 1)arr[i][z].insert(x);
        }
    }

    while (!q.empty()) {
        int p = q.front().fr;
        int state = q.front().sc.fr;
        int place = q.front().sc.sc;
        ans[place][p] = state;
        q.pop();
        if (state) {
            range(j, 1, n - 1) {
                if (j == place)continue;
                int need = place + n - j;
                if (need >= n)need -= n;
                if (arr[j][!p].count(need)) {
                    arr[j][!p].erase(need);
                    if (ans[j][!p] == -1 && arr[j][!p].empty()) {
                        ans[j][!p] = 0;
                        q.push({!p, {0, j}});
                    }
                }
            }
        } else {
            //lose
            range(j, 1, n - 1) {
                if (j == place)continue;
                int need = place + n - j;
                if (need >= n)need -= n;
                if (ans[j][!p] == -1 && arr[j][!p].count(need)) {
                    ans[j][!p] = 1;
                    q.push({!p, {1, j}});
                }
            }
        }
    }

    loop(z, 2) {
        range(i, 1, n - 1) {
            if (ans[i][z] == -1) {
                cout << "Loop ";
            } else if (ans[i][z]) {
                cout << "Win ";
            } else {
                cout << "Lose ";
            }
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define loop(i, n) for(int i = 0;i < int(n);i++)
#define rloop(i, n) for(int i = int(n);i >= 0;i--)
#define range(i, a, b) for(int i = int(a);i <= int(b);i++)
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1, v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1, v2, v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1, v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1, v2, v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define endl '\n'

typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
typedef long long ll;
typedef pair<int, int> pii;

const int N = 7007;
bool arr[N][N][2];
int cnt[N][2];
int ans[N][2];
int n, k[2];
vi v[2];

int main() {

#ifndef ONLINE_JUDGE
    freopen("in.in", "r", stdin);
    //freopen("out.in", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int x;
    memset(ans, -1, sizeof ans);
    queue<pair<int, pii> > q;
    cin >> n;
    loop(z, 2) {
        cin >> k[z];
        loop(j, k[z]) {
            cin >> x;
            q.push({z, {1, n - x}});
            range(i, 1, n - 1)arr[i][x][z] = true, cnt[i][z]++;
        }
    }

    while (!q.empty()) {
        int p = q.front().fr;
        int state = q.front().sc.fr;
        int place = q.front().sc.sc;
        ans[place][p] = state;
        q.pop();
        if (state) {
            range(j, 1, n - 1) {
                if (j == place)continue;
                int need = place + n - j;
                if (need >= n)need -= n;
                if (arr[j][need][!p]) {
                    arr[j][need][!p] = false;
                    cnt[j][!p]--;
                    if (ans[j][!p] == -1 && cnt[j][!p] == 0) {
                        ans[j][!p] = 0;
                        q.push({!p, {0, j}});
                    }
                }
            }
        } else {
            //lose
            range(j, 1, n - 1) {
                if (j == place)continue;
                int need = place + n - j;
                if (need >= n)need -= n;
                if (ans[j][!p] == -1 && arr[j][need][!p]) {
                    ans[j][!p] = 1;
                    q.push({!p, {1, j}});
                }
            }
        }
    }

    loop(z, 2) {
        range(i, 1, n - 1) {
            if (ans[i][z] == -1) {
                cout << "Loop ";
            } else if (ans[i][z]) {
                cout << "Win ";
            } else {
                cout << "Lose ";
            }
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define loop(i, n) for(int i = 0;i < int(n);i++)
#define rloop(i, n) for(int i = int(n);i >= 0;i--)
#define range(i, a, b) for(int i = int(a);i <= int(b);i++)
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1, v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1, v2, v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1, v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1, v2, v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define endl '\n'

typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
typedef long long ll;
typedef pair<int, int> pii;

const int N = 7007;
set<int> arr[N][2];
int ans[N][2];
int n, k[2];
vi v[2];

int main() {

#ifndef ONLINE_JUDGE
    freopen("in.in", "r", stdin);
    //freopen("out.in", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int x;
    memset(ans, -1, sizeof ans);
    queue<pair<int, pii> > q;
    cin >> n;
    loop(z, 2) {
        cin >> k[z];
        loop(j, k[z]) {
            cin >> x;
            q.push({z, {1, n - x}});
            range(i, 1, n - 1)arr[i][z].insert(x);
        }
    }

    while (!q.empty()) {
        int p = q.front().fr;
        int state = q.front().sc.fr;
        int place = q.front().sc.sc;
        ans[place][p] = state;
//        cout << place << " " << p << " " << state << endl;
        q.pop();
        if (state) {
            range(j, 1, n - 1) {
                if (j == place)continue;
                int need = place + n - j;
                if (need >= n)need -= n;
                if (arr[j][!p].count(need)) {
                    arr[j][!p].erase(need);
                    if (arr[j][!p].empty()) {
                        q.push({!p, {0, j}});
                    }
                }
            }
        } else {
            //lose
            range(j, 1, n - 1) {
                if (j == place)continue;
                int need = place + n - j;
                if (need >= n)need -= n;
                if (ans[j][!p] == -1 && arr[j][!p].count(need)) {
                    q.push({!p, {1, j}});
                }
            }
        }
    }

    loop(z, 2) {
        range(i, 1, n - 1) {
            if (ans[i][z] == -1) {
                cout << "Loop ";
            } else if (ans[i][z]) {
                cout << "Win ";
            } else {
                cout << "Lose ";
            }
        }
        cout << endl;
    }

    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

int s[2][10005];
bool used[2][10005];
int cnt[2][10005];
vector<int> v1[2];

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	cin>>n;
	for(j=0;j<2;j++){
		cin>>m;
		for(i=0;i<m;i++){
			cin>>a;
			v1[j].push_back(a);
		}
	}
	s[0][0]=-1,s[1][0]=-1;
	for(j=0,k=0;j<2*n*n;j++,k--){
		for(i=0;i<2;i++){
			if(k<0)k+=n;
			if(used[i][k])continue;
			if(cnt[i][k]==v1[i].size())s[i][k]=-1;
			if(s[i][k]==0)continue;
			used[i][k]=true;
			if(s[i][k]==1){
				for(auto to:v1[1-i]){
					a=k-to;
					if(a<0)a+=n;
					cnt[1-i][a]++;
				}
			}
			if(s[i][k]==-1){
				for(auto to:v1[1-i]){
					a=k-to;
					if(a<0)a+=n;
					s[1-i][a]=1;
				}
			}
		}
	}
	for(i=0;i<2;i++){
		for(j=1;j<n;j++){
			if(s[i][j]==-1)cout<<"Lose";
			if(s[i][j]==0)cout<<"Loop";
			if(s[i][j]==1)cout<<"Win";
			if(j!=n-1)cout<<" ";
		}
		cout<<endl;
	}
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

int s[2][10005];
bool used[2][10005];
int cnt[2][10005];
vector<int> v1[2];

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	cin>>n;
	for(j=0;j<2;j++){
		cin>>m;
		for(i=0;i<m;i++){
			cin>>a;
			v1[j].push_back(a);
		}
	}
	s[0][0]=-1,s[1][0]=-1;
	for(j=0,k=0;j<n*n;j++,k--){
		for(i=0;i<2;i++){
			if(k<0)k+=n;
			if(used[i][k])continue;
			if(cnt[i][k]==v1[i].size())s[i][k]=-1;
			if(s[i][k]==0)continue;
			used[i][k]=true;
			if(s[i][k]==1){
				for(auto to:v1[1-i]){
					a=k-to;
					if(a<0)a+=n;
					cnt[1-i][a]++;
				}
			}
			if(s[i][k]==-1){
				for(auto to:v1[1-i]){
					a=k-to;
					if(a<0)a+=n;
					s[1-i][a]=1;
				}
			}
		}
	}
	for(i=0;i<2;i++){
		for(j=1;j<n;j++){
			if(s[i][j]==-1)cout<<"Lose";
			if(s[i][j]==0)cout<<"Loop";
			if(s[i][j]==1)cout<<"Win";
			if(j!=n-1)cout<<" ";
		}
		cout<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for (int i=1;i<=n;i++)
#define REP(i,a,b) for (int i=a;i<=b;i++)

#define pb push_back

typedef long long ll;

const int inf=0x3f3f3f3f;
const ll linf=1e18;
const int N=1000000+10;

int n;
int k1,a[N];
int k2,b[N];
bool vis[N];
int s[N][3];
// -1 lose 0 unknown 1 win
int d[N][3];
bool in[N][3];

queue<pair<int,int> > q;

// 一个状态依赖多个状态的转移，用触发式刷表实现状态的有序枚举
// f[i]=min{f[j]}这样的转移因为min的可叠加性每次直接去min更新即可
// 可以逐步更新成答案
// 而本题的状态是只有全部后继确定后才可以确定（在极端情况下，后继都是必胜态）
// 于是我们每次刷表的时候去检查我们更新的状态是否已经确定了所有后继状态

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	//freopen("in.txt","r",stdin);
	cin>>n;
	cin>>k1;
	FOR(i,k1) cin>>a[i];
	cin>>k2;
	FOR(i,k2) cin>>b[i];
	REP(i,2,n) {
		FOR(j,k1) {
			int to=(i+a[j]-1)%n+1;
			if (to==1) {
				s[i][1]=1;
				in[i][1]=1;
				q.push(make_pair(i,1));
			}
		}
		FOR(j,k2) {
			int to=(i+b[j]-1)%n+1;
			if (to==1) {
				s[i][2]=1;
				in[i][2]=1;
				q.push(make_pair(i,2));
			}
		}
	}
	while (q.size()) {
		pair<int,int> t=q.front();
		q.pop();
		int x=t.first,k=t.second;
		//cout<<x<<" "<<k<<endl;
		int val=s[x][k];
		if (k==2) {
			FOR(i,k1) {
				int to=(x-a[i]-1+n)%n+1;
				if (in[to][3-k]) continue;
				if (val==-1) {
					in[to][3-k]=1;
					s[to][3-k]=1;
					q.push(make_pair(to,3-k));
				} else if (d[to][3-k]==k1-1) {
					in[to][3-k]=1;
					s[to][3-k]=-1;
					q.push(make_pair(to,3-k));
				}
				d[to][3-k]++;
			}
		} else {
			FOR(i,k2) {
				int to=(x-b[i]-1+n)%n+1;
				if (in[to][3-k]) continue;
				if (val==-1) {
					in[to][3-k]=1;
					s[to][3-k]=1;
					q.push(make_pair(to,3-k));
				} else if (d[to][3-k]==k2-1) {
					in[to][3-k]=1;
					s[to][3-k]=-1;
					q.push(make_pair(to,3-k));
				}
				d[to][3-k]++;
			}
		}
	}
	REP(i,2,n) {
		if (s[i][1]==1) {
			cout<<"Win"<<" ";
		} else if (s[i][1]==0) {
			cout<<"Loop"<<" ";
		} else cout<<"Lose"<<" ";
	}
	cout<<endl;
	REP(i,2,n) {
		if (s[i][2]==1) {
			cout<<"Win"<<" ";
		} else if (s[i][2]==0) {
			cout<<"Loop"<<" ";
		} else cout<<"Lose"<<" ";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for (int i=1;i<=n;i++)
#define REP(i,a,b) for (int i=a;i<=b;i++)

#define pb push_back

typedef long long ll;

const int inf=0x3f3f3f3f;
const ll linf=1e18;
const int N=1000000+10;

int n;
int k1,a[N];
int k2,b[N];
bool vis[N];
int s[N][3];
// -1 lose 0 unknown 1 win
int d[N][3];
bool in[N][3];

queue<pair<int,int> > q;

// 一个状态依赖多个状态的转移，用触发式刷表实现状态的有序枚举
// f[i]=min{f[j]}这样的转移因为min的可叠加性每次直接去min更新即可
// 可以逐步更新成答案
// 而本题的状态是只有全部后继确定后才可以确定（在极端情况下，后继都是必胜态）
// 于是我们每次刷表的时候去检查我们更新的状态是否已经确定了所有后继状态

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	freopen("in.txt","r",stdin);
	cin>>n;
	cin>>k1;
	FOR(i,k1) cin>>a[i];
	cin>>k2;
	FOR(i,k2) cin>>b[i];
	REP(i,2,n) {
		FOR(j,k1) {
			int to=(i+a[j]-1)%n+1;
			if (to==1) {
				s[i][1]=1;
				in[i][1]=1;
				q.push(make_pair(i,1));
			}
		}
		FOR(j,k2) {
			int to=(i+b[j]-1)%n+1;
			if (to==1) {
				s[i][2]=1;
				in[i][2]=1;
				q.push(make_pair(i,2));
			}
		}
	}
	while (q.size()) {
		pair<int,int> t=q.front();
		q.pop();
		int x=t.first,k=t.second;
		//cout<<x<<" "<<k<<endl;
		int val=s[x][k];
		if (k==2) {
			FOR(i,k1) {
				int to=(x-a[i]-1+n)%n+1;
				if (in[to][3-k]) continue;
				if (val==-1) {
					in[to][3-k]=1;
					s[to][3-k]=1;
					q.push(make_pair(to,3-k));
				} else if (d[to][3-k]==k1-1) {
					in[to][3-k]=1;
					s[to][3-k]=-1;
					q.push(make_pair(to,3-k));
				}
				d[to][3-k]++;
			}
		} else {
			FOR(i,k2) {
				int to=(x-b[i]-1+n)%n+1;
				if (in[to][3-k]) continue;
				if (val==-1) {
					in[to][3-k]=1;
					s[to][3-k]=1;
					q.push(make_pair(to,3-k));
				} else if (d[to][3-k]==k2-1) {
					in[to][3-k]=1;
					s[to][3-k]=-1;
					q.push(make_pair(to,3-k));
				}
				d[to][3-k]++;
			}
		}
	}
	REP(i,2,n) {
		if (s[i][1]==1) {
			cout<<"Win"<<" ";
		} else if (s[i][1]==0) {
			cout<<"Loop"<<" ";
		} else cout<<"Lose"<<" ";
	}
	cout<<endl;
	REP(i,2,n) {
		if (s[i][2]==1) {
			cout<<"Win"<<" ";
		} else if (s[i][2]==0) {
			cout<<"Loop"<<" ";
		} else cout<<"Lose"<<" ";
	}
	return 0;
}


#include <iostream>
#include <math.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <iomanip>
#include <set>
#include <list>
#include <string>
#include <memory.h>
#include <bitset>
#include <stack>
using namespace std;
#define ll long long
#define ppi pair<int , int>
#define mp make_pair
const int MAX = 7e3 + 111;
vector<int> arr1 , arr2;
int dp[MAX][2];
int score[MAX][2];
vector<bool> freq[MAX][2];
int n , k1 , k2;
void winnerAdd (int idx ,  int lvl , vector<int> & arr1 , vector<int > & arr2);
void loserAdd (int idx , int lvl , vector<int> & arr1 , vector<int> & arr2);
void winnerAdd (int idx ,  int lvl , vector<int> & arr1 , vector<int > & arr2)
{
	dp[idx][lvl] = 1;
	int k1 = arr1.size();
	for (int i = 0 ; i < k1 ; i ++)
	{
		int prev = (idx - arr1[i] + n ) % n;
		if (!prev) prev = n;
		if (prev == 1) continue;
		if (!freq[prev][!lvl][i])
			freq[prev][!lvl][i]= 1  ,score[prev][!lvl]++;
		if (score[prev][!lvl] == k1 && dp[prev][!lvl] == -1)
			loserAdd(prev , !lvl , arr2 , arr1);
	}
}
void loserAdd (int idx , int lvl , vector<int> & arr1 , vector<int> & arr2)
{
	dp[idx][lvl] = 2;
	int k1 = arr1.size();
	for (int i = 0 ; i < k1 ; i ++)
	{
		int prev = (idx - arr1[i] + n) % n;
		if (!prev) prev = n;
		if (prev == 1) continue;
		if (dp[prev][!lvl] == -1)
			winnerAdd(prev , !lvl , arr2 , arr1);
	}
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
#endif
	memset(dp, -1, sizeof dp);
	cin >> n;
	cin >> k1;
	arr1.resize(k1);
	for (int i = 0; i < k1; i++)
		scanf("%d", &arr1[i]);
	cin >> k2;
	arr2.resize(k2);
	for (int i = 0; i < k2; i++)
		scanf("%d", &arr2[i]);
	for (int i = 1; i <= n; ++i)
	{
		freq[i][0].resize(k1 + 11);
		freq[i][1].resize(k2 + 11);
	}
	for (int i = 0; i < k1; i++)
	{
		int idx = (n - arr1[i] + 1 + n) % n;
		if (!idx) idx = n;
		if (dp[idx][0] == -1)
			winnerAdd(idx , 0 , arr2 , arr1);
	}
	for (int i = 0; i < k2; i++)
	{
		int idx = (n - arr2[i] + 1 + n) % n;
		if (!idx) idx = n;
		if (dp[idx][1] == -1)
			winnerAdd(idx , 1 , arr1 , arr2);
	}

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


#include <iostream>
#include <math.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <iomanip>
#include <set>
#include <list>
#include <string>
#include <memory.h>
#include <bitset>
#include <stack>
using namespace std;
#define ll long long
#define ppi pair<int , int>
#define mp make_pair
const int MAX = 7e3 + 111;
vector<int> arr1 , arr2;
int dp[MAX][2];
int score[MAX][2];
vector<int> freq[MAX][2];
int n , k1 , k2;
void winnerAdd (int idx ,  int lvl , vector<int> & arr1 , vector<int > & arr2);
void loserAdd (int idx , int lvl , vector<int> & arr1 , vector<int> & arr2);
void winnerAdd (int idx ,  int lvl , vector<int> & arr1 , vector<int > & arr2)
{
	dp[idx][lvl] = 1;
	int k1 = arr1.size();
	for (int i = 0 ; i < k1 ; i ++)
	{
		int prev = (idx - arr1[i] + n ) % n;
		if (!prev) prev = n;
		if (prev == 1) continue;
		if (!freq[prev][!lvl][i])
			freq[prev][!lvl][i]= 1  ,score[prev][!lvl]++;
		if (score[prev][!lvl] == k1 && dp[prev][!lvl] == -1)
			loserAdd(prev , !lvl , arr2 , arr1);
	}
}
void loserAdd (int idx , int lvl , vector<int> & arr1 , vector<int> & arr2)
{
	dp[idx][lvl] = 2;
	int k1 = arr1.size();
	for (int i = 0 ; i < k1 ; i ++)
	{
		int prev = (idx - arr1[i] + n) % n;
		if (!prev) prev = n;
		if (prev == 1) continue;
		if (dp[prev][!lvl] == -1)
			winnerAdd(prev , !lvl , arr2 , arr1);
	}
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
#endif
	memset(dp, -1, sizeof dp);
	cin >> n;
	cin >> k1;
	arr1.resize(k1);
	for (int i = 0; i < k1; i++)
		scanf("%d", &arr1[i]);
	cin >> k2;
	arr2.resize(k2);
	for (int i = 0; i < k2; i++)
		scanf("%d", &arr2[i]);
	for (int i = 1; i <= n; ++i)
	{
		freq[i][0].resize(k1 + 11);
		freq[i][1].resize(k2 + 11);
	}
	for (int i = 0; i < k1; i++)
	{
		int idx = (n - arr1[i] + 1 + n) % n;
		if (!idx) idx = n;
		if (dp[idx][0] == -1)
			winnerAdd(idx , 0 , arr2 , arr1);
	}
	for (int i = 0; i < k2; i++)
	{
		int idx = (n - arr2[i] + 1 + n) % n;
		if (!idx) idx = n;
		if (dp[idx][1] == -1)
			winnerAdd(idx , 1 , arr1 , arr2);
	}

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


#include <iostream>
#include <math.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <iomanip>
#include <set>
#include <list>
#include <string>
#include <memory.h>
#include <bitset>
#include <stack>
using namespace std;
#define ll long long
#define ppi pair<int , int>
#define mp make_pair
const int MAX = 7e3 + 111;
vector<int> arr1 , arr2;
int dp[MAX][2];
int score[MAX][2];
map<pair<int, int >, int > freq[2];
int n , k1 , k2;
void winnerAdd (int idx ,  int lvl , vector<int> & arr1 , vector<int > & arr2);
void loserAdd (int idx , int lvl , vector<int> & arr1 , vector<int> & arr2);
void winnerAdd (int idx ,  int lvl , vector<int> & arr1 , vector<int > & arr2)
{
	dp[idx][lvl] = 1;
	int k1 = arr1.size();
	for (int i = 0 ; i < k1 ; i ++)
	{
		int prev = (idx - arr1[i] + n ) % n;
		if (!prev) prev = n;
		if (prev == 1) continue;
		if (!freq[!lvl][mp(prev , i)])
			freq[!lvl][mp(prev , i)]= 1  ,score[prev][!lvl]++;
		if (score[prev][!lvl] == k1 && dp[prev][!lvl] == -1)
			loserAdd(prev , !lvl , arr2 , arr1);
	}
}
void loserAdd (int idx , int lvl , vector<int> & arr1 , vector<int> & arr2)
{
	dp[idx][lvl] = 2;
	int k1 = arr1.size();
	for (int i = 0 ; i < k1 ; i ++)
	{
		int prev = (idx - arr1[i] + n) % n;
		if (!prev) prev = n;
		if (prev == 1) continue;
		if (dp[prev][!lvl] == -1)
			winnerAdd(prev , !lvl , arr2 , arr1);
	}
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
#endif
	memset(dp, -1, sizeof dp);
	cin >> n;
	cin >> k1;
	arr1.resize(k1);
	for (int i = 0; i < k1; i++)
		scanf("%d", &arr1[i]);
	cin >> k2;
	arr2.resize(k2);
	for (int i = 0; i < k2; i++)
		scanf("%d", &arr2[i]);
	for (int i = 0; i < k1; i++)
	{
		int idx = (n - arr1[i] + 1 + n) % n;
		if (!idx) idx = n;
		winnerAdd(idx , 0 , arr2 , arr1);
	}
	for (int i = 0; i < k2; i++)
	{
		int idx = (n - arr2[i] + 1 + n) % n;
		if (!idx) idx = n;
		winnerAdd(idx , 1 , arr1 , arr2);
	}

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


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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define fill(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 7e3+10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int dp[2][N];
int size[2][N];
int k[2];
int n;
int a[2][N];
int main(){
  fast;
  fill(dp,-1);
  cin >> n;
  cin >> k[0];
  FOR(i,0,k[0]-1)cin >> a[0][i];
  cin >> k[1];
  FOR(i,0,k[1]-1)cin >> a[1][i];
  dp[0][0] = 0;
  dp[1][0] = 0;
  queue<ii> pq;
  pq.push({0,0});
  pq.push({0,1});
  FOR(i,1,n-1){
  	size[0][i] = k[0];
  	size[1][i] = k[1];
  }
  while(not pq.empty()){
  	auto f = pq.front();
  	int xx = f.S ^ 1;
  	pq.pop();
  	FOR(i,0,k[xx]-1){
  		assert(dp[f.S][f.F] != -1);
  		int x = f.F - a[xx][i];
  		if(x < 0) x += n;
  		if(dp[f.S][f.F] == 0){
  			dp[xx][x] = 1;
  			pq.push({x, xx});
  		}
  		else{
  			size[xx][x]--;
  			if(size[xx][x] == 0){
  				if(dp[xx][x] != -1)continue;
  				dp[xx][x] = 0;
  				pq.push({x,xx});
  			}
  		}
  	}
  }
  FOR(i,1,n-1){
  	int x = dp[0][i];
  	if(x == 1){
  		cout << "Win ";
  	}
  	else if(x == 0){
  		cout << "Lose ";
  	}
  	else{
  		cout << "Loop ";
  	}
  }
  cout << "\n";
  FOR(i,1,n-1){
  	int x = dp[1][i];
  	if(x == 1){
  		cout << "Win ";
  	}
  	else if(x == 0){
  		cout << "Lose ";
  	}
  	else{
  		cout << "Loop ";
  	}
  }
  return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define fill(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 7e3+10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int dp[2][N];
int size[2][N];
int k[2];
int n;
int a[2][N];
int main(){
  fast;
  fill(dp,-1);
  cin >> n;
  cin >> k[0];
  FOR(i,0,k[0]-1)cin >> a[0][i];
  cin >> k[1];
  FOR(i,0,k[1]-1)cin >> a[1][i];
  dp[0][0] = 0;
  dp[1][0] = 0;
  queue<ii> pq;
  pq.push({0,0});
  pq.push({0,1});
  FOR(i,1,n-1){
  	size[0][i] = k[0];
  	size[1][i] = k[1];
  }
  while(not pq.empty()){
  	auto f = pq.front();
  	int xx = f.S ^ 1;
  	pq.pop();
  	FOR(i,0,k[xx]-1){
  		assert(dp[f.S][f.F] != -1);
  		int x = f.F - a[xx][i];
  		if(x < 0) x += n;
  		if(dp[f.S][f.F] == 0){
  			if(dp[xx][x] != -1)continue;
  			dp[xx][x] = 1;
  			pq.push({x, xx});
  		}
  		else{
  			size[xx][x]--;
  			if(size[xx][x] == 0){
  				dp[xx][x] = 0;
  				pq.push({x,xx});
  			}
  		}
  	}
  }
  FOR(i,1,n-1){
  	int x = dp[0][i];
  	if(x == 1){
  		cout << "Win ";
  	}
  	else if(x == 0){
  		cout << "Lose ";
  	}
  	else{
  		cout << "Loop ";
  	}
  }
  cout << "\n";
  FOR(i,1,n-1){
  	int x = dp[1][i];
  	if(x == 1){
  		cout << "Win ";
  	}
  	else if(x == 0){
  		cout << "Lose ";
  	}
  	else{
  		cout << "Loop ";
  	}
  }
  return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define fill(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 7e3+10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int dp[N][2];
int k[2];
int n;
int a[2][N];
int DP(int i,int p){
	int &ret = dp[i][p];
	if(~ret)return ret;
	ret = 1;
	int f = 0;
	FOR(it,0,k[p]-1){
		int x = (i + a[p][it])%n;
		x = DP(x,1-p);
		if(x == 0){
			return ret = 1;
		}
		if(x == -2){
			f = 1;
		}
	}
	if(f == 0)return ret = 0;
	if(f == 1){
		return ret = -2;
	}
}
int main(){
  fast;
  fill(dp,-1);
  cin >> n;
  cin >> k[0];
  FOR(i,0,k[0]-1)cin >> a[0][i];
  cin >> k[1];
  FOR(i,0,k[1]-1)cin >> a[1][i];
  dp[0][0] = 0;
  dp[0][1] = 0;
  FOR(i,1,n-1){
  	int x = DP(i,0);
  	if(x == 1){
  		cout << "Win ";
  	}
  	else if(x == 0){
  		cout << "Lose ";
  	}
  	else{
  		cout << "Loop ";
  	}
  }
  cout << "\n";
  FOR(i,1,n-1){
  	int x = DP(i,1);
  	if(x == 1){
  		cout << "Win ";
  	}
  	else if(x == 0){
  		cout << "Lose ";
  	}
  	else{
  		cout << "Loop ";
  	}
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef int ll;
typedef long double ld;

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define vll vector<ll>
#define pll pair<ll,ll>
const ll N=7005;
ll vis1[N],vis2[N],rick[N],mor[N],dp1[N],dp2[N];
ll cnt1[N],cnt2[N],in1[N],in2[N];
ll hoohaa;
vll G1[N];
vll G2[N];
queue<pll> Q;
ll a,b,n;
ll cnt=0;
ll bfs()
{
	while(!Q.empty())
	{
		pll t=Q.front();
		Q.pop();
		ll x1=t.first;
		ll x2=t.second;
		// if(cnt<5)
		{
			cnt++;
			// cout<<x1<<" "<<x2<<endl;
		}
		if(x1==0)
		{
			if(dp1[x2]==0)
			{
				lp(i,0,b)
				{
					ll p=x2,x=mor[i];
					if(x2-mor[i]<0)
					{
						p=n-1;
						x=x-(x2+1);
					}
					if(dp2[p-x]==-1)
					{
						dp2[p-x]=1;
						Q.push(mp(1,p-x));
					}
				}
			}
			else
			{
				lp(i,0,b)
				{
					ll p=x2,x=mor[i];
					if(x2-mor[i]<0)
					{
						p=n-1;
						x=x-(x2+1);
					}
					cnt2[p-x]++;
					if(cnt2[p-x]==b)
					{
						if(dp2[p-x]==-1)
						{
							dp2[p-x]=0;
							Q.push(mp(1,p-x));
						}
					}
				}
			}
		}
		else
		{
			if(dp2[x2]==0)
			{
				lp(i,0,a)
				{
					ll p=x2,x=rick[i];
					if(x2-rick[i]<0)
					{
						p=n-1;
						x=x-(x2+1);
					}
					if(dp1[p-x]==-1)
					{
						dp1[p-x]=1;
						Q.push(mp(0,p-x));
					}
				}
			}
			else
			{
				lp(i,0,a)
				{
					ll p=x2,x=rick[i];
					if(x2-rick[i]<0)
					{
						p=n-1;
						x=x-(x2+1);
					}
					cnt1[p-x]++;
					if(cnt1[p-x]==a)
					{
						if(dp1[p-x]==-1)
						{
							dp1[p-x]=0;
							Q.push(mp(0,p-x));
						}
					}
				}
			}
		}
	}
}

int main()
{
    ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
	cin >> n;
	cin >> a;
	lp(i,0,a) cin >> rick[i];
	cin >> b;
	lp(i,0,b) cin >> mor[i];
	lp(i,0,n)
	{
		dp1[i]=-1;
		dp2[i]=-1;
	}
	// cerr<<1<<endl;

	Q.push(mp(0,0));
	Q.push(mp(1,0));
	// cerr<<1<<endl;
	dp1[0]=0;
	dp2[0]=0;
	bfs();
	lp(i,1,n)
	{
		if(dp1[i]==0) cout<<"Lose"<<" ";
		else if(dp1[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	lp(i,1,n)
	{
		if(dp2[i]==0) cout<<"Lose"<<" ";
		else if(dp2[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef int ll;
typedef long double ld;

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define vll vector<ll>
#define pll pair<ll,ll>
const ll N=7005;
ll vis1[N],vis2[N],rick[N],mor[N],dp1[N],dp2[N];
ll cnt1[N],cnt2[N],in1[N],in2[N];
ll hoohaa;
vll G1[N];
vll G2[N];
queue<pll> Q;
ll a,b,n;
ll cnt=0;
ll bfs()
{
	while(!Q.empty())
	{
		pll t=Q.front();
		Q.pop();
		ll x1=t.first;
		ll x2=t.second;
		// if(cnt<5)
		{
			cnt++;
			// cout<<x1<<" "<<x2<<endl;
		}
		if(x1==0)
		{
			if(dp1[x2]==0)
			{
				lp(i,0,G1[x2].size())
				{
					if(dp2[G1[x2][i]]==-1)
					{
						dp2[G1[x2][i]]=1;
						Q.push(mp(1,G1[x2][i]));
					}
				}
			}
			else
			{
				lp(i,0,G1[x2].size())
				{
					cnt2[G1[x2][i]]++;
					if(cnt2[G1[x2][i]]==b)
					{
						if(dp2[G1[x2][i]]==-1)
						{
							dp2[G1[x2][i]]=0;
							Q.push(mp(1,G1[x2][i]));
						}
					}
				}
			}
		}
		else
		{
			if(dp2[x2]==0)
			{
				lp(i,0,G2[x2].size())
				{
					if(dp1[G2[x2][i]]==-1)
					{
						dp1[G2[x2][i]]=1;
						Q.push(mp(0,G2[x2][i]));
					}
				}
			}
			else
			{
				lp(i,0,G2[x2].size())
				{
					cnt1[G2[x2][i]]++;
					if(cnt1[G2[x2][i]]==a)
					{
						if(dp1[G2[x2][i]]==-1)
						{
							dp1[G2[x2][i]]=0;
							Q.push(mp(0,G2[x2][i]));
						}
					}
				}
			}
		}
	}
}

int main()
{
    ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
	cin >> n;
	cin >> a;
	lp(i,0,a) cin >> rick[i];
	cin >> b;
	lp(i,0,b) cin >> mor[i];
	lp(i,0,n)
	{
		dp1[i]=-1;
		dp2[i]=-1;
	}
	lp(i,0,n)
	{
		lp(j,0,a)
		{
			ll p=i,x=rick[j];
			if(i+rick[j]>=n)
			{
				x=rick[j]-(n-i);
				p=0;
			}
			// cout<<"2"<<" "<<p+x<<" "<<i<<endl;
			G2[p+x].pb(i);
		}
		lp(j,0,b)
		{
			ll p=i,x=mor[j];
			if(i+mor[j]>=n)
			{
				x=mor[j]-(n-i);
				p=0;
			}
			// cout<<"1"<<" "<<p+x<<" "<<i<<endl;

			G1[p+x].pb(i);
		}
	}
	// cerr<<1<<endl;

	Q.push(mp(0,0));
	Q.push(mp(1,0));
	// cerr<<1<<endl;
	dp1[0]=0;
	dp2[0]=0;
	bfs();
	lp(i,1,n)
	{
		if(dp1[i]==0) cout<<"Lose"<<" ";
		else if(dp1[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	lp(i,1,n)
	{
		if(dp2[i]==0) cout<<"Lose"<<" ";
		else if(dp2[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef int ll;
typedef long double ld;

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define vll vector<ll>
#define pll pair<ll,ll>
const ll N=7005;
ll vis1[N],vis2[N],rick[N],mor[N],dp1[N],dp2[N];
ll cnt1[N],cnt2[N],in1[N],in2[N];

vll G1[N];
vll G2[N];
queue<pll> Q;
ll a,b,n;
ll cnt=0;
ll bfs()
{
	while(!Q.empty())
	{
		pll t=Q.front();
		Q.pop();
		ll x1=t.first;
		ll x2=t.second;
		// if(cnt<5)
		{
			cnt++;
			// cout<<x1<<" "<<x2<<endl;
		}
		if(x1==0)
		{
			if(dp1[x2]==0)
			{
				lp(i,0,G1[x2].size())
				{
					if(dp2[G1[x2][i]]==-1)
					{
						dp2[G1[x2][i]]=1;
						Q.push(mp(1,G1[x2][i]));
					}
				}
			}
			else
			{
				lp(i,0,G1[x2].size())
				{
					cnt2[G1[x2][i]]++;
					if(cnt2[G1[x2][i]]==b)
					{
						if(dp2[G1[x2][i]]==-1)
						{
							dp2[G1[x2][i]]=0;
							Q.push(mp(1,G1[x2][i]));
						}
					}
				}
			}
		}
		else
		{
			if(dp2[x2]==0)
			{
				lp(i,0,G2[x2].size())
				{
					if(dp1[G2[x2][i]]==-1)
					{
						dp1[G2[x2][i]]=1;
						Q.push(mp(0,G2[x2][i]));
					}
				}
			}
			else
			{
				lp(i,0,G2[x2].size())
				{
					cnt1[G2[x2][i]]++;
					if(cnt1[G2[x2][i]]==a)
					{
						if(dp1[G2[x2][i]]==-1)
						{
							dp1[G2[x2][i]]=0;
							Q.push(mp(0,G2[x2][i]));
						}
					}
				}
			}
		}
	}
}

int main()
{
    ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
	cin >> n;
	cin >> a;
	lp(i,0,a) cin >> rick[i];
	cin >> b;
	lp(i,0,b) cin >> mor[i];
	lp(i,0,n)
	{
		dp1[i]=-1;
		dp2[i]=-1;
	}
	lp(i,0,n)
	{
		lp(j,0,a)
		{
			ll p=i,x=rick[j];
			if(i+rick[j]>=n)
			{
				x=rick[j]-(n-i);
				p=0;
			}
			// cout<<"2"<<" "<<p+x<<" "<<i<<endl;
			G2[p+x].pb(i);
		}
		lp(j,0,b)
		{
			ll p=i,x=mor[j];
			if(i+mor[j]>=n)
			{
				x=mor[j]-(n-i);
				p=0;
			}
			// cout<<"1"<<" "<<p+x<<" "<<i<<endl;

			G1[p+x].pb(i);
		}
	}
	// cerr<<1<<endl;

	Q.push(mp(0,0));
	Q.push(mp(1,0));
	// cerr<<1<<endl;
	dp1[0]=0;
	dp2[0]=0;
	bfs();
	lp(i,1,n)
	{
		if(dp1[i]==0) cout<<"Lose"<<" ";
		else if(dp1[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	lp(i,1,n)
	{
		if(dp2[i]==0) cout<<"Lose"<<" ";
		else if(dp2[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define vll vector<ll>
#define pll pair<ll,ll>
const ll N=7005;
ll vis1[N],vis2[N],rick[N],mor[N],dp1[N],dp2[N];
ll cnt1[N],cnt2[N],in1[N],in2[N];

vll G1[N];
vll G2[N];
queue<pll> Q;
ll a,b,n;
ll cnt=0;
ll bfs()
{
	while(!Q.empty())
	{
		pll t=Q.front();
		Q.pop();
		ll x1=t.first;
		ll x2=t.second;
		// if(cnt<5)
		{
			cnt++;
			// cout<<x1<<" "<<x2<<endl;
		}
		if(x1==0)
		{
			if(dp1[x2]==0)
			{
				lp(i,0,G1[x2].size())
				{
					if(dp2[G1[x2][i]]==-1)
					{
						dp2[G1[x2][i]]=1;
						Q.push(mp(1,G1[x2][i]));
					}
				}
			}
			else
			{
				lp(i,0,G1[x2].size())
				{
					cnt2[G1[x2][i]]++;
					if(cnt2[G1[x2][i]]==b)
					{
						if(dp2[G1[x2][i]]==-1)
						{
							dp2[G1[x2][i]]=0;
							Q.push(mp(1,G1[x2][i]));
						}
					}
				}
			}
		}
		else
		{
			if(dp2[x2]==0)
			{
				lp(i,0,G2[x2].size())
				{
					if(dp1[G2[x2][i]]==-1)
					{
						dp1[G2[x2][i]]=1;
						Q.push(mp(0,G2[x2][i]));
					}
				}
			}
			else
			{
				lp(i,0,G2[x2].size())
				{
					cnt1[G2[x2][i]]++;
					if(cnt1[G2[x2][i]]==a)
					{
						if(dp1[G2[x2][i]]==-1)
						{
							dp1[G2[x2][i]]=0;
							Q.push(mp(0,G2[x2][i]));
						}
					}
				}
			}
		}
	}
}

int main()
{
    ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
	cin >> n;
	cin >> a;
	lp(i,0,a) cin >> rick[i];
	cin >> b;
	lp(i,0,b) cin >> mor[i];
	lp(i,0,n)
	{
		dp1[i]=-1;
		dp2[i]=-1;
	}
	lp(i,0,n)
	{
		lp(j,0,a)
		{
			ll p=i,x=rick[j];
			if(i+rick[j]>=n)
			{
				x=rick[j]-(n-i);
				p=0;
			}
			// cout<<"2"<<" "<<p+x<<" "<<i<<endl;
			G2[p+x].pb(i);
		}
		lp(j,0,b)
		{
			ll p=i,x=mor[j];
			if(i+mor[j]>=n)
			{
				x=mor[j]-(n-i);
				p=0;
			}
			// cout<<"1"<<" "<<p+x<<" "<<i<<endl;

			G1[p+x].pb(i);
		}
	}
	// cerr<<1<<endl;

	Q.push(mp(0,0));
	Q.push(mp(1,0));
	// cerr<<1<<endl;
	dp1[0]=0;
	dp2[0]=0;
	bfs();
	lp(i,1,n)
	{
		if(dp1[i]==0) cout<<"Lose"<<" ";
		else if(dp1[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	lp(i,1,n)
	{
		if(dp2[i]==0) cout<<"Lose"<<" ";
		else if(dp2[i]==1) cout<<"Win"<<" ";
		else cout<<"Loop"<<" ";
	}
	cout<<endl;
	return 0;
}


/* You can't connect the dots looking forward
   you can only connect them looking backwards. */

/* Nothing is impossible; impossible itself says "I'm possible" */

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed;
#define dbset(x) for(int i=0 ; i<x.size(); i++) cerr << x[i] << " "; cerr << endl;
#define inf 1000000007
#define INF 1000000000000000000LL
#define PI 3.14159265358979323846
#define mod 1000000007
#define mod1 1000696969
#define flusz fflush(stdout);
#define VI vector<int>
#define VPI vector < pair<int,int> >
#define PII pair<int, int>
#define BIT bitset<N>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define endl '\n'
#define REP(x, y) for(int x = 0; x < (y); ++x)
#define FOR(x, y, z) for(int x = y; x <= (z); ++x)
#define FORR(x, y, z) for(int x = y; x >= (z); --x)
using namespace std;

template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...);
}
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)

#define N 7007

int test;

int n;

VI g[2];

// 1 = win, 2 = lose

int dp[2][N];
int vis[2][N];
int ile[2][N];

queue<PII>q;

void bfs(){
    q.push(mp(0,0));
    q.push(mp(1,0));

    while(!q.empty()){
        auto it = q.front();
        q.pop();

        if (vis[it.st][it.nd])
            continue;

        vis[it.st][it.nd] = 1;

        int curs = dp[it.st][it.nd];

        for(auto it1 : g[it.st^1]){
            int poz = it.nd - it1 + n;
            poz%=n;

            if (curs == 1){ // win
                ile[it.st^1][poz]++;

                if (ile[it.st^1][poz] == g[it.st^1].size()){
                    dp[it.st^1][poz] = 2;
                    q.push(mp(it.st^1,poz));
                }
            }else{
                dp[it.st^1][poz] = 1;
                q.push(mp(it.st^1,poz));
            }
        }
    }

    return;
}

void solve()
{
    cin >> n;

    int x;
    cin >> x;

    FOR(i,1,x){
        int y;
        cin >> y;
        g[0].pb(y);
    }

    cin >> x;

    FOR(i,1,x){
        int y;
        cin >> y;
        g[1].pb(y);
    }

    FOR(i,0,n){
        dp[0][i] = dp[1][i] = -1;
    }

    bfs();

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

    return;
}

int32_t main()
{
    boost

    test=1;

    while(test--)
    {
        solve();
    }

  return 0;
}


/* You can't connect the dots looking forward
   you can only connect them looking backwards. */

/* Nothing is impossible; impossible itself says "I'm possible" */

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed;
#define dbset(x) for(int i=0 ; i<x.size(); i++) cerr << x[i] << " "; cerr << endl;
#define inf 1000000007
#define INF 1000000000000000000LL
#define PI 3.14159265358979323846
#define mod 1000000007
#define mod1 1000696969
#define flusz fflush(stdout);
#define VI vector<int>
#define VPI vector < pair<int,int> >
#define PII pair<int, int>
#define BIT bitset<N>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define endl '\n'
#define REP(x, y) for(int x = 0; x < (y); ++x)
#define FOR(x, y, z) for(int x = y; x <= (z); ++x)
#define FORR(x, y, z) for(int x = y; x >= (z); --x)
using namespace std;

template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...);
}
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)

#define int long long
#define N 500007

int test;

int n;
string s,ss;

void solve()
{

    return;
}

int32_t main()
{
    boost

    test=1;

    while(test--)
    {
        solve();
    }

  return 0;
}


/*input
8
4 6 2 3 4
2 3 6
*/
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define ps putchar(' ')
#define pn putchar('\n')
#define ppb pop_back
#define mp make_pair
#define ft first
#define sd second
#define sz size()
#define bn begin()
#define ed end()
#define get(x) scanf("%d", &x);
#define getl(x) scanf("%I64d", &x);
#define PI acos(0)*2
#define puts myputs
#define gets mygets

using namespace std;

inline void pi(int x){if(x==0){putchar('0');return;}char c[10];int k=0;if(x<0){putchar('-');x=-x;}while(x){int nx=x/10;c[k++]=x-nx*10;x=nx;}while(k--){putchar(c[k]+'0');}}
inline void pin(const int&x){pi(x);putchar('\n');};
inline void pl(ll x){if(x==0){putchar('0');return;}char c[19];int k=0;if(x<0){putchar('-');x=-x;}while(x){ll nx=x/10;c[k++]=x-nx*10;x=nx;}while(k--){putchar(c[k]+'0');}}
inline void pln(const ll&x){pl(x);putchar('\n');};
inline void gi(int&val){val=1;char c;do{c=getchar();}while(c!='-'&&(c<'0'||c>'9'));int zn=1;if(c=='-'){zn=-1;c=getchar();}val=c-'0';c=getchar();while(c>='0'&&c<='9'){val*=10;val+=c-'0';c=getchar();}val*=zn;}
inline void gl(ll&val){val=1;char c;do{c=getchar();}while(c!='-'&&(c<'0'||c>'9'));int zn=1;if(c=='-'){zn=-1;c=getchar();}val=c-'0';c=getchar();while(c>='0'&&c<='9'){val*=10;val+=c-'0';c=getchar();}val*=zn;}
inline void gl(ll&val1,ll&val2){gl(val1);gl(val2);}
inline void gi(int&val1,int&val2){gi(val1);gi(val2);}
inline void gl(ll&val1,ll&val2,ll&val3){gl(val1);gl(val2);gl(val3);}
inline void gi(int&val1,int&val2,int&val3){gi(val1);gi(val2);gi(val3);}
inline void mygets(char*b){int i=0;for(;;++i){const char c=getchar();if(c=='\n'||c==EOF){break;}b[i]=c;}b[i]='\0';}
inline void mygets(string&b){int i=0;for(;;++i){const char c=getchar();if(c=='\n'||c==EOF){break;}b.pb(c);}}
inline void mygets(char&b){b=getchar();getchar();}
inline void myputs(const string&b){for(int i=0;i<b.size();++i){putchar(b[i]);}}
inline void putsn(const string&b){puts(b);putchar('\n');}
inline void myputs(const char&b){putchar(b);}
inline void putsn(const char&b){putchar(b);putchar('\n');}

const int N = 7000 + 7, M = 150000, mod = 1000000007, inf = 1000000007;
const ll lmod = 1000000007, linf = 1e18 + 77;
const ld eps = 1e-14;

int p[3][N];

int f[N][2];
int s[2];

int main() {
  ios_base::sync_with_stdio(false);
  int n;
  gi(n);
  for (int i = 0; i <= n; i++) {
    f[i][0] = f[i][1] = -1;
  }
  f[0][0] = 0;
  f[0][1] = 0;
  int k;
  gi(s[0]);
  for (int i = 0; i < s[0]; i++) {
    gi(p[0][i]);
  }
  gi(s[1]);
  for (int i = 0; i < s[1]; i++) {
    gi(p[1][i]);
  }

  queue <pair <int, bool> > q;

  q.push({0, 0});
  q.push({0, 1});

  map <pair <int, bool>, int> M;
  while (!q.empty()) {
    int v = q.front().ft;
    bool flag = q.front().sd;
    //cout << v << " " << flag << endl;
    q.pop();
    for (int i = 0; i < s[!flag]; i++) {
      int to = (v - p[!flag][i] + n) % n;
      if (f[to][!flag] != -1) {
        continue;
      }
      f[to][!flag] = 1;
      for (int j = 0; j < s[flag]; j++) {
        int toj = (to - p[flag][j] + n) % n;
        if (f[toj][flag] != -1) {
          continue;
        }
        M[{toj, flag}]++;
        if (M[{toj, flag}] == s[flag]) {
          f[toj][flag] = 0;
          q.push({toj, flag});
        }
      }

    }
  }

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

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

}


/*input
8
4 6 2 3 4
2 3 6
*/
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define ps putchar(' ')
#define pn putchar('\n')
#define ppb pop_back
#define mp make_pair
#define ft first
#define sd second
#define sz size()
#define bn begin()
#define ed end()
#define get(x) scanf("%d", &x);
#define getl(x) scanf("%I64d", &x);
#define PI acos(0)*2
#define puts myputs
#define gets mygets

using namespace std;

inline void pi(int x){if(x==0){putchar('0');return;}char c[10];int k=0;if(x<0){putchar('-');x=-x;}while(x){int nx=x/10;c[k++]=x-nx*10;x=nx;}while(k--){putchar(c[k]+'0');}}
inline void pin(const int&x){pi(x);putchar('\n');};
inline void pl(ll x){if(x==0){putchar('0');return;}char c[19];int k=0;if(x<0){putchar('-');x=-x;}while(x){ll nx=x/10;c[k++]=x-nx*10;x=nx;}while(k--){putchar(c[k]+'0');}}
inline void pln(const ll&x){pl(x);putchar('\n');};
inline void gi(int&val){val=1;char c;do{c=getchar();}while(c!='-'&&(c<'0'||c>'9'));int zn=1;if(c=='-'){zn=-1;c=getchar();}val=c-'0';c=getchar();while(c>='0'&&c<='9'){val*=10;val+=c-'0';c=getchar();}val*=zn;}
inline void gl(ll&val){val=1;char c;do{c=getchar();}while(c!='-'&&(c<'0'||c>'9'));int zn=1;if(c=='-'){zn=-1;c=getchar();}val=c-'0';c=getchar();while(c>='0'&&c<='9'){val*=10;val+=c-'0';c=getchar();}val*=zn;}
inline void gl(ll&val1,ll&val2){gl(val1);gl(val2);}
inline void gi(int&val1,int&val2){gi(val1);gi(val2);}
inline void gl(ll&val1,ll&val2,ll&val3){gl(val1);gl(val2);gl(val3);}
inline void gi(int&val1,int&val2,int&val3){gi(val1);gi(val2);gi(val3);}
inline void mygets(char*b){int i=0;for(;;++i){const char c=getchar();if(c=='\n'||c==EOF){break;}b[i]=c;}b[i]='\0';}
inline void mygets(string&b){int i=0;for(;;++i){const char c=getchar();if(c=='\n'||c==EOF){break;}b.pb(c);}}
inline void mygets(char&b){b=getchar();getchar();}
inline void myputs(const string&b){for(int i=0;i<b.size();++i){putchar(b[i]);}}
inline void putsn(const string&b){puts(b);putchar('\n');}
inline void myputs(const char&b){putchar(b);}
inline void putsn(const char&b){putchar(b);putchar('\n');}

const int N = 7000 + 7, M = 150000, mod = 1000000007, inf = 1000000007;
const ll lmod = 1000000007, linf = 1e18 + 77;
const ld eps = 1e-14;

int p[3][N];

int f[N][2];
int s[2];

int k[N][2];

int main() {
  ios_base::sync_with_stdio(false);
  int n;
  gi(n);
  for (int i = 0; i <= n; i++) {
    f[i][0] = f[i][1] = -1;
  }
  f[0][0] = 0;
  f[0][1] = 0;

  gi(s[0]);
  for (int i = 0; i < s[0]; i++) {
    gi(p[0][i]);
  }
  gi(s[1]);
  for (int i = 0; i < s[1]; i++) {
    gi(p[1][i]);
  }

  queue <pair <int, bool> > q;

  q.push({0, 0});
  q.push({0, 1});

  while (!q.empty()) {
    int v = q.front().ft;
    bool flag = q.front().sd;
    q.pop();
    if (f[v][flag] == 0) {
      for (int i = 0; i < s[!flag]; i++) {
        int to = (v - p[!flag][i] + n) % n;
        if (f[to][!flag] != -1) {
          continue;
        }
        f[to][!flag] = 1;
        q.push({to, !flag});
      }
    } else {

      for (int i = 0; i < s[!flag]; i++) {
        int to = (v - p[!flag][i] + n) % n;
        if (f[to][!flag] != -1) {
          continue;
        }
        k[to][!flag]++;
        if (k[to][!flag] == s[!flag]) {
          f[to][!flag] = 0;
          q.push({to, !flag});
        }
      }

    }
  }

  for (int i = 1; i < n; i++) {
    int res = f[i][0];
    if (res == 0)
      puts("Lose ");
    if (res == 1)
      puts("Win ");
    if (res == -1)
      puts("Loop ");
  }
  pn;

  for (int i = 1; i < n; i++) {
    int res = f[i][1];
    if (res == 0)
      puts("Lose ");
    if (res == 1)
      puts("Win ");
    if (res == -1)
      puts("Loop ");
  }
  pn;

}


/*input
8
4 6 2 3 4
2 3 6
*/
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define ps putchar(' ')
#define pn putchar('\n')
#define ppb pop_back
#define mp make_pair
#define ft first
#define sd second
#define sz size()
#define bn begin()
#define ed end()
#define get(x) scanf("%d", &x);
#define getl(x) scanf("%I64d", &x);
#define PI acos(0)*2
#define puts myputs
#define gets mygets

using namespace std;

inline void pi(int x){if(x==0){putchar('0');return;}char c[10];int k=0;if(x<0){putchar('-');x=-x;}while(x){int nx=x/10;c[k++]=x-nx*10;x=nx;}while(k--){putchar(c[k]+'0');}}
inline void pin(const int&x){pi(x);putchar('\n');};
inline void pl(ll x){if(x==0){putchar('0');return;}char c[19];int k=0;if(x<0){putchar('-');x=-x;}while(x){ll nx=x/10;c[k++]=x-nx*10;x=nx;}while(k--){putchar(c[k]+'0');}}
inline void pln(const ll&x){pl(x);putchar('\n');};
inline void gi(int&val){val=1;char c;do{c=getchar();}while(c!='-'&&(c<'0'||c>'9'));int zn=1;if(c=='-'){zn=-1;c=getchar();}val=c-'0';c=getchar();while(c>='0'&&c<='9'){val*=10;val+=c-'0';c=getchar();}val*=zn;}
inline void gl(ll&val){val=1;char c;do{c=getchar();}while(c!='-'&&(c<'0'||c>'9'));int zn=1;if(c=='-'){zn=-1;c=getchar();}val=c-'0';c=getchar();while(c>='0'&&c<='9'){val*=10;val+=c-'0';c=getchar();}val*=zn;}
inline void gl(ll&val1,ll&val2){gl(val1);gl(val2);}
inline void gi(int&val1,int&val2){gi(val1);gi(val2);}
inline void gl(ll&val1,ll&val2,ll&val3){gl(val1);gl(val2);gl(val3);}
inline void gi(int&val1,int&val2,int&val3){gi(val1);gi(val2);gi(val3);}
inline void mygets(char*b){int i=0;for(;;++i){const char c=getchar();if(c=='\n'||c==EOF){break;}b[i]=c;}b[i]='\0';}
inline void mygets(string&b){int i=0;for(;;++i){const char c=getchar();if(c=='\n'||c==EOF){break;}b.pb(c);}}
inline void mygets(char&b){b=getchar();getchar();}
inline void myputs(const string&b){for(int i=0;i<b.size();++i){putchar(b[i]);}}
inline void putsn(const string&b){puts(b);putchar('\n');}
inline void myputs(const char&b){putchar(b);}
inline void putsn(const char&b){putchar(b);putchar('\n');}

const int N = 7000 + 7, M = 150000, mod = 1000000007, inf = 1000000007;
const ll lmod = 1000000007, linf = 1e18 + 77;
const ld eps = 1e-14;

int p[3][N];

int f[N][2];
int s[2];

int main() {
  ios_base::sync_with_stdio(false);
  int n;
  gi(n);
  for (int i = 0; i <= n; i++) {
    f[i][0] = f[i][1] = -1;
  }
  f[0][0] = 0;
  f[0][1] = 0;
  int k;
  gi(s[0]);
  for (int i = 0; i < s[0]; i++) {
    gi(p[0][i]);
  }
  gi(s[1]);
  for (int i = 0; i < s[1]; i++) {
    gi(p[1][i]);
  }

  queue <pair <int, bool> > q;

  q.push({0, 0});
  q.push({0, 1});

  map <pair <int, bool>, int> M;
  while (!q.empty()) {
    int v = q.front().ft;
    bool flag = q.front().sd;
    q.pop();
    if (f[v][flag] == 0) {
      for (int i = 0; i < s[!flag]; i++) {
        int to = (v - p[!flag][i] + n) % n;
        if (f[to][!flag] != -1) {
          continue;
        }
        f[to][!flag] = 1;
        q.push({to, !flag});
      }
    } else {

      for (int i = 0; i < s[!flag]; i++) {
        int to = (v - p[!flag][i] + n) % n;
        if (f[to][!flag] != -1) {
          continue;
        }
        M[{to, !flag}]++;
        if (M[{to, !flag}] == s[!flag]) {
          f[to][!flag] = 0;
          q.push({to, !flag});
        }
      }

    }
  }

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

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

}