output_description: For each dataset, a line containing a single decimal integer indicating the
  score for the corresponding performance should be output. No other characters
  should be on the output line.
input_description: The input consists of a number of datasets, each corresponding to a
  contestant's performance. There are no more than 20 datasets in the input.
  
  A dataset begins with a line with an integer _n_ , the number of judges
  participated in scoring the performance (3 ≤ _n_ ≤ 100). Each of the _n_ lines
  following it has an integral score _s_ (0 ≤ _s_ ≤ 1000) marked by a judge. No
  other characters except for digits to express these numbers are in the input.
  Judges' names are kept secret.
  
  The end of the input is indicated by a line with a single zero in it.
attempt: while True:  # 無限に繰り返す
      num = int(input())  # 標準入力
      if num == 0:
          break  # 入力値が0だった場合繰り返しを強制終了する
      else:  # 0でなければ
          num_list = []  # 空リスト作成
          for _ in range(num):  # 入力回繰り返す
              num_list.append(int(input()))  # 標準入力をし、リストに加える
          num_list.sort()  # リストを小さい順に並べる
          num_list.pop(-1)  # リストの最高点を削除する
          num_list.pop(0)  # リストの最低点を削除する
          num = sum(num_list)  # リストの値を合計する
          num1 = len(num_list)  # リストの長さを取得する
          print(int(num / num1))  # リストの平均を出力する
  
problem_description: A: ICPC Score Totalizer Software
  
  ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_a-1)
  
  The International Clown and Pierrot Competition (ICPC), is one of the most
  distinguished and also the most popular events on earth in the show business.
  
  One of the unique features of this contest is the great number of judges that
  sometimes counts up to one hundred. The number of judges may differ from one
  contestant to another, because judges with any relationship whatsoever with a
  specific contestant are temporarily excluded for scoring his/her performance.
  
  Basically, scores given to a contestant's performance by the judges are
  averaged to decide his/her score. To avoid letting judges with eccentric
  viewpoints too much influence the score, the highest and the lowest scores are
  set aside in this calculation. If the same highest score is marked by two or
  more judges, only one of them is ignored. The same is with the lowest score.
  The average, which may contain fractions, are truncated down to obtain final
  score as an integer.
  
  You are asked to write a program that computes the scores of performances,
  given the scores of all the judges, to speed up the event to be suited for a
  TV program.
samples: [{"input": "1000\n    342\n    0\n    5\n    2\n    2\n    9\n    11\n    932\n    5\n    300\n    1000\n    0\n    200\n    400\n    8\n    353\n    242\n    402\n    274\n    283\n    132\n    402\n    523\n    0", "output": "7\n    300\n    326"}]