class Caesar
  class << self
    def shift(string, key)
      string.chars.map { |c| shift_letter(c, key) }.join
    end

    def shift_letter(char, key)
      # the input can only contain lowercase letters
      return char if char < 'a' || char > 'z'
      (((char.ord - 'a'.ord + key) % 26) + 'a'.ord).chr
    end
  end
end

class KeyGuessing
  KNOWN_WORDS = %w(the this that)

  class << self
    def guess_key(code)
      # This is sort of naive as I'm just trying out all of the possibilites,
      # but it's way simpler than trying calculate ord differences between
      # letters in words.
      (1..26).each do |key|
        decoded = Caesar.shift(code, key)
        words = decoded.split(' ')
        return key if words.any? { |w| KNOWN_WORDS.include?(w) }
      end
      nil
    end
  end
end

$stdin.each_line do |line|
  code = line.chop
  key = KeyGuessing.guess_key(code)
  if key
    puts Caesar.shift(code, key)
  else
    puts "Couldn't guess key for: #{code}"
  end
end