Given stream of integers within the range from 1-n. Find the median index of the stream and print the value.