use std::collections::HashMap; #[allow(unused_macros)] macro_rules! input { ( $($t:ty),* ) => {{ let mut s = String::new(); std::io::stdin().read_line(&mut s); let mut splits = s.trim().split_whitespace(); ($( { splits.next().unwrap().parse::<$t>().unwrap() },)*) }} } #[allow(dead_code)] fn primes(n: u64) -> Vec { if n < 3 { return vec![]; } let mut res: Vec = vec![2]; for i in 3..n { let i = i as u64; let root = ((n as f64).sqrt().ceil() as usize + 1) as u64; let composite = res.iter().take_while(|&&x| x <= root).any(|x| i % x == 0); if !composite { res.push(i); } } return res; } fn prime_factorization(n: u64) -> std::collections::HashMap { let primes = primes((n / 2) + 2); let mut h = std::collections::HashMap::new(); let mut current = n; while current != 1 { let mut found = false; for p in &primes { if current % p == 0 { let count = h.entry(*p).or_insert(0); *count += 1; current /= p; found = true; } } if !found { let count = h.entry(n).or_insert(0); *count += 1; break; } } return h; } fn count_values(v: Vec) -> HashMap { let mut h = HashMap::new(); for val in v { let count = h.entry(val).or_insert(0); *count += 1; } h } #[allow(dead_code)] fn divisors(n: u64) -> Vec { let mut res = vec![]; for i in (1..(((n as f64).sqrt().floor() as u64) + 1)).rev() { if n % i == 0 { res.insert(0, i); if i != n / i { res.push(n / i); } } } return res; } #[allow(unused_must_use)] #[allow(unused_variables)] fn solve() { let (n,) = input!(u64); if n == 1 { println!("1"); return; } let h = prime_factorization(n); let vals: Vec = h.values().map(|&a| a).collect(); let same_value_count = count_values(vals); let divs = divisors(n); let divisor_total: &u64 = &divs[..(divs.len() - 1)].iter().sum(); if same_value_count.keys().next().unwrap() == &1 && same_value_count.len() != 1 { println!("Sosu!"); } else if same_value_count.keys().next().unwrap() % &2 == 0 { println!("Heihosu!"); } else if same_value_count.keys().next().unwrap() % &3 == 0 { println!("Ripposu!"); } else if divisor_total == &n { println!("Kanzensu!"); } else { println!("{}", n); } } fn main() { solve(); }