#include <iostream> #include <algorithm> using namespace std; const int MAXN = 10000 + 10; int arr[MAXN]; int main () { int n; while (cin >> n && n != 0){ for (int i = 0; i < n; i++){ cin >> arr[i]; } sort (arr, arr + n); int mediumNum = 0; if (n % 2 == 0){ mediumNum = (arr[n / 2] + arr[n / 2 - 1]) / 2; }else{ mediumNum = arr[n / 2]; } cout << mediumNum << endl; } return 0; }