n = gets.to_i.succ s = "" while n != 0 if n % 26 == 0 s += 'Z' n = n / 26 - 1 else s += ('A'.ord - 1 + n % 26).chr n /= 26 end end puts s.reverse