# Find median of data stream

##### Problem Statement
Given a stream of data, this algorithm will find the median each time a data inserted into the data stream.

##### Input/Output Format
The first line will contain a number **n** representing the number of data to process for this problem. Next there will be exactly **n** lines of input. Each of the input line will contain a integer **a<sub>i</sub>**, representing the data. The only restriction about the input is that, all the numbers should be in the range of 32 bit integer.

For each **a<sub>i</sub>**, the program will print the value of median upto **a<sub>i</sub>** (inclusive).