program check;

uses
	SysUtils, testlib;

const
	maxn = 2000;
	maxm = 10000;

var
	n, m, i, j, s: longint;
	who: string;
	go: array [1..maxn] of longint;
	src, dst, wei: array [1..maxm] of longint;
	vis: array [1..maxn] of boolean;
	sum: array [1..maxn] of longint;
	ss: longint;
	ja, pa: string;

begin
	n := inf.readlongint;
	m := inf.readlongint;

	who := inf.readword(blanks, blanks);

	s := inf.readlongint;

	for i := 1 to m do begin
		src[i] := inf.readlongint;
		dst[i] := inf.readlongint;
		wei[i] := inf.readlongint;
	end;

	for i := 1 to n do begin
		go[i] := inf.readlongint;
	end;

	ja := ans.readstring;
	pa := ouf.readstring;

	if (ja = 'Win') and (pa = 'Win') then
		quit(_ok, 'Win');

	if (pa = 'Win') then
		quit(_wa, 'expected: ' + ja + ', found: ' + pa);

	for i := 1 to n do begin
		j := ouf.readlongint;
		if who[i] = 'A' then begin
			if j <> 0 then
				quit(_wa, 'strategy must contain 0 for Alice''s vertices');
		end else begin
			if (j < 1) or (j > m) then
				quit(_wa, 'invalid arc number');
			if src[j] <> i then
				quit(_wa, format('arc %d doesn''t start from vertex %d', [j, i]));
			go[i] := j;
		end;
	end;

	i := s;
	ss := 0;
	while not vis[i] do begin
		vis[i] := true;
		sum[i] := ss;
		ss := ss + wei[go[i]];
		i := dst[go[i]];
	end;

	if (pa = 'Lose') then begin
		if ss >= sum[i] then begin
			quit(_wa, 'Presented strategy doesn''t force Alice to lose');
		end;

		if ja <> 'Lose' then
			quit(_fail, 'expected: ' + ja + ', found: ' + pa);
		quit(_ok, 'Lose');
	end;

	if (pa = 'Draw') then begin
		if ss <> sum[i] then begin
			quit(_wa, 'Presented strategy doesn''t force the game to end in draw');
		end;

		if ja = 'Lose' then
			quit(_wa, 'expected: ' + ja + ', found: ' + pa);
		if ja = 'Win' then
			quit(_fail, 'expected: ' + ja + ', found: ' + pa);

		quit(_ok, 'Draw');
	end;

	quit(_pe, 'Unexpected outcome');
end.	