use std::io::{self, BufRead}; fn get_lines() -> Vec { let stdin = io::stdin(); let lines: Vec = stdin.lock().lines().map(|l| l.unwrap()).collect(); return lines; } fn main(){ let s = &get_lines()[0]; let mut ans: u32 = 0; let mut i = s.chars(); let mut x = i.nth(3); loop { let c = match x { Some(x) => x, None => { if s.chars().rev().next().unwrap() != 'u' { ans <<= 1; } for c in format!("{:b}", ans * 2).chars() { if c == '1' { print!("hamu"); } else { print!("ham"); } } println!(""); return; } }; if c == 'u' { ans <<= 1; ans += 1; x = i.nth(3); } else { ans <<= 1; x = i.nth(2); } } }