fn rand_memory() -> usize { Box::into_raw(Box::new("I hope this is a random number")) as usize } fn rand() -> usize { static mut X: usize = 0; unsafe { if X == 0 { X = rand_memory(); } X ^= X << 13; X ^= X >> 17; X ^= X << 5; X } } fn read() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); s.trim().split_whitespace().flat_map(|s| s.parse()).collect() } fn main() { let (h, w, p) = { let a = read(); (a[0] as usize, a[1] as usize, a[2] as u32) }; for _ in 0..1001 { let mut s = String::new(); let mut c = b'L'; while s.len() < 400 { s.extend("RD".chars().cycle().take(rand() % 20 + 10)); s.extend((0..(rand() % 5 + 1)).map(|_| c as char)); c ^= b'L' ^ b'U'; } s.truncate(400); println!("{}", s); if read()[0] == -1 { break; } } }