#include <bits/stdc++.h>
#include "validate.h"
using namespace std;


int main(int argc, char **argv)
{
	init_io(argc,argv);
	int n, q, i, s, x, y;
	// s = -1   =>   first query is never 'equal'
	// s = -2   =>   first (n + 1)/2 - 2 queries will be 'equal'
	// s >= 0   =>   random with seed s.
	judge_in >> s >> n;
	srand(s);
	int a[n], b[n], f = 1;
	cout << n << endl;
	for (i = 0; i < n; i++) a[i] = b[i] = 0;
	if (s >= 0) a[rand()%n] = (2*(rand()%2) - 1), f = 0; // +/- 1

	for (q = 0; ; q++)
	{
		string qt;
		if (!(author_out >> qt)) wrong_answer("Wrong answer: premature EOF.\n");
		if (qt.compare("!") == 0) break;
		else if (qt.compare("?") == 0)
		{
			if (!(author_out >> x >> y)) wrong_answer("Wrong answer: expected two integers.\n");
			x--, y--;

			if (x < 0 || x >= n || y < 0 || y >= n) wrong_answer("Wrong answer: query indices out of range.\n");
			if (x == y) wrong_answer("Wrong answer: query indices are identical.\n");

			if (s == -1 && q == 0) a[rand()%2 ? x : y] = 2*(rand()%2) - 1, f = 0;
			if (f && s == -2 && q >= (n + 1)/2 - 1)
			{ // we should save the unequal until the end but we must make sure that the odd coin we decide hasn't been queried already.
				if (!b[x] && !b[y]) a[rand()%2 ? x : y] = 2*(rand()%2) - 1, f = 0;
				else if (!b[x]) a[x] = 2*(rand()%2) - 1, f = 0;
				else if (!b[y]) a[y] = 2*(rand()%2) - 1, f = 0;
			}

			b[x] = b[y] = 1;
			if (a[x] == a[y]) cout << "equal" << endl;
			else if (a[x] < a[y]) cout << "lighter" << endl;
			else if (a[x] > a[y]) cout << "heavier" << endl;
		}
		else wrong_answer("Wrong answer: expected '?' or '!'.\n");
	}
	if (q > (n + 1)/2) wrong_answer("Wrong answer: Too many guesses: %d (which is %d over).\n", q, q - (n + 1)/2);
	if (f)
	{
		int t = 0;
		for (i = 0; i < n; i++) t += b[i];
		assert(t != n);
		if (t != n - 1) wrong_answer("Wrong answer: Makeing a guess when they can't know the answer.");
		for (i = 0; i < n; i++) if (!b[i]) break;
		a[i] = 2*(rand()%2) - 1;
	}

	if (!(author_out >> x)) wrong_answer("Wrong answer: expected an integer.\n");
	x--;
	if (x < 0 || x >= n) wrong_answer("Wrong answer: answer indices out of range.\n");
	if (a[x] == 0) wrong_answer("Wrong answer: wrong coin guessed.\n");

	string junk;
	if (author_out >> junk) wrong_answer("Wrong answer: trailing output.\n");

	accept();
}

