import std; void main () { int N = readln.chomp.to!int; // ジグザグで通りそう auto command = new byte[](2 * N); foreach (i; 0 .. N) { command[2 * i] = 'R'; command[2 * i + 1] = 'D'; } foreach (c; command) { writeln(c.to!char); stdout.flush; int v = readln.chomp.to!int; if (v == 1) return; if (v == -1) return; } } void read (T...) (string S, ref T args) { import std.conv : to; import std.array : split; auto buf = S.split; foreach (i, ref arg; args) { arg = buf[i].to!(typeof(arg)); } }