#include <iostream>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <iomanip>
#include <set>
#define I int
#define LL long long
#define F float
#define S string
#define B bool
#define C char
#define N 200001
#define PI 3.14159265358979
using namespace std;
int main()
{
    C a,b,c;
    cin>>a>>b>>c;
    if(a==b&&b==c)
    {
        cout<<"Won";
    }
    else cout<<"Lost";
    return 0;
}

#include<iostream> 
#include<cstdio> 
#include<algorithm>
#include<cstring>
#include<cmath>
#define res register int
#define LL long long
#define oo 0x3f3f3f3f
using namespace std;
LL Fastmul(LL a,LL b,LL p){
	LL ans=0;
	while(b>0){
		if(b&1)	ans=(ans+a)%p;
		a=a*2%p;
		b>>=1;
	}
	return ans;
}
LL Fastpow(LL a,LL b,LL p){
	LL ans=1;
	while(b>0){
		if(b&1)	ans=ans*a%p;
		a=Fastmul(a,a,p);
		b>>=1;
	}
	return ans%p;
}
int mp[10][4]={{0,0,0,0},{1,1,1,1},{2,4,8,6},{3,9,7,1},{4,6,4,6},{5,5,5,5},{6,6,6,6},{7,9,3,1},{8,4,2,6},{9,1,9,1}};
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	b=Fastpow(b,c,4);
	a=a%10;
	if(b==0)	b=4;
	cout<<mp[a][b-1];
	return 0;
}