import std.container;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.solve;
}
 
void solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	
	writeln( 0 );
	stdout.flush();
	input.popFront;
	auto s = input.front;
	if( s == "Vacant" ) return;
	
	auto queue = heapify!( ( a, b ) => b[ 0 ] < a[ 0 ] || ( b[ 0 ] == a[ 0 ] && b[ 1 ] < a[ 1 ] ) )( new Tuple!( bool, long, long, string, long, string )[ 20 ], 0 );
	queue.insert( tuple( true, n - 1, 0L, s, n, s ) );
	while( !queue.empty )
	{
		auto li = queue.front[ 2 ];
		auto ls = queue.front[ 3 ];
		auto ri = queue.front[ 4 ];
		auto rs = queue.front[ 5 ];
		queue.popFront;
		
		auto ci = ( ri + li ) / 2;
		writeln( ci );
		stdout.flush();
		input.popFront;
		auto cs = input.front;
		if( cs == "Vacant" ) return;
		
		auto lcd = ci - li - 1;
		auto rcd = ri - ci - 1;
		if( 0 < lcd ) queue.insert( tuple( ( lcd % 2 ) ? ls == cs : ls != cs, lcd, li, ls, ci, cs ) );
		if( 0 < rcd ) queue.insert( tuple( ( rcd % 2 ) ? rs == cs : rs != cs, rcd, ci, cs, ri, rs ) );
	}
	
	assert( false );
}
