while gets
  str, arr = $_.chomp, [*"a".."z"]
  
  until /the|this|that/ =~ str
    i = 0
    
    str.each_char do |c|
      str[i] = arr[(arr.index(c) + 1) % 26] if /\w/ =~ c
      i += 1
    end
  end
  
  puts str
end