A = 'a'.ord
T = 't'.ord

def print_result(data, shift)
  print(data.map do |datum|
    datum.each_char.map do |c|
      (c == '.') ? '.' : ((c.ord - A - shift) % 26 + A).chr
    end.join
  end.join(' '))
  print "\n"
end

readlines.each do |line|
  data = line.split
  candidates_of_the = data.select {|datum| datum.size == 3 }
  candidates_of_thxx = data.select {|datum| datum.size == 4 }
  tt = candidates_of_the.find do |candidate|
    (candidate[0].ord - candidate[1].ord) % 26 == 12 && (candidate[1].ord - candidate[2].ord) % 26 == 3
  end
  if tt
    print_result(data, (tt[0].ord - T) % 26)
    next
  end
  tt = candidates_of_thxx.find do |candidate|
    ((candidate[0].ord - candidate[1].ord) % 26 == 12 &&
      (candidate[1].ord - candidate[2].ord) % 26 == 7 &&
      (candidate[3].ord - candidate[2].ord) % 26 == 19) ||
    ((candidate[0].ord - candidate[1].ord) % 26 == 12 &&
      (candidate[2].ord - candidate[1].ord) % 26 == 1 &&
      (candidate[3].ord - candidate[2].ord) % 26 == 10)
  end
  if tt
    print_result(data, (tt[0].ord - T) % 26)
    next
  end
end

