def METHOD_NAME(expectPrompt=True):
  line = readLine()
  while True:
    if line is None:
      if not expectPrompt:
        break
    else:
      if line[-1] == '?':       # Got prompt
        break
      if line[0] == '!':        # Got error
        raise Exception(line[1:])
    line = readLine()
  return line