#include <stdio.h>
#include <string.h>

#define N 101

// if b[x][y] than constraint var[x] + a[x][y] <= var[y] is defined
// else no constraint for var[x], var[y] is defined
int a[N][N]; // constraints
char b[N][N];
int n; // length of sequence (count of variables)

FILE *f, *g;

int main ()
{
	f = stdin;
	g = stdout;
	for (;;) {
		int m;
		int x, y;
		int i;
		int bad;
		
		// input scaning
		if (fscanf(f,"%d %d",&n,&m) != 2) break;
		for (x=0; x<=n; x++)
			for (y=0; y<=n; y++)
				b[x][y] = 0;
		for (i=0; i<m; i++) {
			int i1, i2, ipom;
			int si, ni, ki;
			char oi[3];
			fscanf(f,"%d %d %s %d",&si,&ni,oi,&ki);
			i2 = si+ni;
			i1 = si-1;
			if (!strcmp(oi,"gt")) {
				ipom = i2; i2 = i1; i1 = ipom;
			}
			else ki = -ki;
			ki++;
			b[i2][i1] = 1;
			a[i2][i1] = ki;
		}
		
		bad = 0;
		for (i=n; i>=0; i--) {
			if (b[i][i])
				if (a[i][i] > 0) bad = 1;

			for (x=0; x<=n; x++)
				for (y=0; y<=n; y++) 
					if (b[x][i] && b[i][y]) {
						int c = a[x][i] + a[i][y];
						if (!b[x][y] || c > a[x][y]) {
							b[x][y] = 1;
							a[x][y] = c;
						}
					}

			for (x=0; x<=n; x++)
				if (b[x][i])
					b[x][i] = 0;

			for (y=0; y<=n; y++)
				if (b[i][y])
					b[i][y] = 0;

		}

		if (bad) fprintf(g,"successful conspiracy\n");
		else fprintf(g,"lamentable kingdom\n");
	}
	fclose(g);
	fclose(f);
	return 0;
}
