use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let n: Vec<u32> = s.split_whitespace().flat_map(str::parse).collect();
	println!(
		"{}",
		match (n[0], n[1], n[2], n[3]) {
			(a, b, h, w) if a == b || h == w => "Same",
			(a, b, h, w) if (a < b) != (h < w) => "Rotating",
			_ => "Non-rotating",
		}
	);
}