while line = gets
  26.times do |i|
    r = line.each_char.inject('') do |r, c|
      r << ('a' <= c && c <= 'z' ? (c.ord - i).chr : c)
    end
    if /the|this|that/ =~ r
      puts r
      break
    end
  end
end