#include<cstdio>
using namespace std;
int main(){
int T,K;
scanf("%d %d",&T,&K);
int a[K][4]={0};
for(int i=0;i<K;i++){
for(int j=0;j<4;j++){
scanf("%d",&a[i][j]);
}
}
for(int i=0;i<K;i++){
if(T==0){
printf("Game Over.\n");
return 0;
}
if((T-a[i][2])<0){
printf("Not enough tokens. Total = %d.\n",T);
continue;
}
if(a[i][1]==0&&a[i][3]<a[i][0]){
T+=a[i][2];
printf("Win %d! Total = %d.\n",a[i][2],T);
continue;
}
if(a[i][1]==1&&a[i][3]>a[i][0]){
T+=a[i][2];
printf("Win %d! Total = %d.\n",a[i][2],T);
continue;
}
T-=a[i][2];
printf("Lose %d. Total = %d.\n",a[i][2],T);
}
return 0;
}