#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
long long numbers[10005];
int i=0;
bool two_times=false;
int temp;
while(cin >> temp)
{
numbers[i]=temp;
if(!two_times)
{
nth_element(numbers,(numbers+i/2),numbers+i+1);
cout << numbers[i/2] << endl;
}
else
{
nth_element(numbers,numbers+i/2,numbers+i+1);
nth_element(numbers,numbers+i/2+1, numbers+i+1);
int ret= numbers[i/2] + numbers[i/2+1];
ret/=2;
cout << ret << endl;
}
i++;
two_times=!two_times;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICAgbG9uZyBsb25nIG51bWJlcnNbMTAwMDVdOwogICBpbnQgaT0wOwogICBib29sIHR3b190aW1lcz1mYWxzZTsKICAgaW50IHRlbXA7CiAgIHdoaWxlKGNpbiA+PiB0ZW1wKQogICB7CiAgICAgIG51bWJlcnNbaV09dGVtcDsgICAKICAgICAgaWYoIXR3b190aW1lcykKICAgICAgewogICAgICAgICBudGhfZWxlbWVudChudW1iZXJzLChudW1iZXJzK2kvMiksbnVtYmVycytpKzEpOwogICAgICAgICBjb3V0IDw8IG51bWJlcnNbaS8yXSA8PCBlbmRsOwogICAgICB9CiAgICAgIGVsc2UKICAgICAgewogICAgICAgICBudGhfZWxlbWVudChudW1iZXJzLG51bWJlcnMraS8yLG51bWJlcnMraSsxKTsKICAgICAgICAgbnRoX2VsZW1lbnQobnVtYmVycyxudW1iZXJzK2kvMisxLCBudW1iZXJzK2krMSk7CiAgICAgICAgIGludCByZXQ9IG51bWJlcnNbaS8yXSArIG51bWJlcnNbaS8yKzFdOwogICAgICAgICByZXQvPTI7CiAgICAgICAgIGNvdXQgPDwgcmV0IDw8IGVuZGw7CiAgICAgIH0KICAgICAgCgogICAgICBpKys7CiAgICAgIHR3b190aW1lcz0hdHdvX3RpbWVzOwogICB9Cn0=