$chars = ('a'..'z').to_a
$hints = %w(the this that)

def crypt_caesar(s, n)
  s.chars.to_a.map{|c|
    if 'a'.ord <= c.ord && c.ord <= 'z'.ord
      $chars[((c.ord - 'a'.ord) + n) % $chars.size]
    else
      c
    end
  }.join
end

rawText = gets
1.upto($chars.size) do |n|
  text = crypt_caesar(rawText, n)
  if $hints.any?{|hint| text.include?(hint)}
    puts text
    break
  end
end