uses
	testlib, sysutils, math;

const
	maxn = 100000;

var
	ja, pa: string;
	n, m, s, i, l, r, w, v: longint;
	a: array [1..4 * maxn] of longint;

begin
	ja := ans.readstring;
	pa := ouf.readstring;
	if (ja = 'consistent') and (pa = 'inconsistent') then
		quit(_wa, 'inconsistent unexpected');
	if (ja = 'inconsistent') and (pa = 'inconsistent') then
		quit(_ok, 'inconsistent');

	if (pa <> 'consistent') then
		quit(_pe, 'consistent or inconsistent expected');

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

	s := 1;
	while (s < n) do
		s := s * 2;

	for i := 1 to n do begin
		a[i + s - 1] := ouf.readlongint;
	end;

	for i := s - 1 downto 1 do begin
		a[i] := min(a[2 * i], a[2 * i + 1]);
	end;

	for i := 1 to m do begin
		l := inf.readlongint + s - 1;
		r := inf.readlongint + s - 1;
		v := inf.readlongint;
		
		w := maxlongint;
		while (l <= r) do begin
			if (a[l] < w) then
				w := a[l];
			if (a[r] < w) then
				w := a[r];
			l := (l + 1) div 2;
			r := (r - 1) div 2;
		end;                

		if (v <> w) then
			quit(_wa, format('incorrect answer for Q(%d, %d), expected: %d, found: %d', [l, r, v, w]));
	end;

	if (ja = 'inconsistent') then
		quit(_fail, 'inconsistent expected');

	quit(_ok, format('%d numbers', [n]));
end.