N = gets.to_i def build_str(ch, len, is_first = false) if is_first res = ch * len ch.succ! else res = ch * len ch.succ! res << ch ch.succ! end res end cur = 'a' is_first = true len = 0 ans = '' 30.times do |i| if N[i] == 0 if is_first str = build_str(cur, i, true) is_first = false ans << str end else if is_first len += 1 else str = build_str(cur, i) ans << str end end end if ans[-1] <= 'z' puts ans else puts 'sushi' end