// Arup Guha
// 6/24/2015
// Example of efficient running median calculation using TreeSet.
// Assumes unique input values, since it's using a TreeSet.

import java.util.*;

public class MedianTS {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		TreeSet<item> low = new TreeSet<item>();
		TreeSet<item> high = new TreeSet<item>();
		
		for (int i=0; i<n; i++) {
			
			// Find where this value goes.
			int value = stdin.nextInt();
			if (low.size() == 0) 
				low.add(new item(value, i));
			else if (value >= low.last().num) 
				high.add(new item(value, i));
			else
				low.add(new item(value, i));
			
			// Keeps balance so high isn't the larger list.
			if (high.size() > low.size())
				low.add(high.pollFirst());
			
			// Balance other way!
			if (low.size() - high.size() > 1)
				high.add(low.pollLast());
				
			// Get Median based on even or odd case.
			if (low.size() == high.size())
				System.out.println((low.last().num+high.first().num)/2.0);
			else
				System.out.println(low.last().num);
		}

	}

}

class item implements Comparable<item> {
	
	public int num;
	public int ID;
	
	public item(int n, int myID) {
		num = n;
		ID = myID;
	}
	
	public int compareTo(item other) {
		if (this.num != other.num) return this.num - other.num;
		return this.ID - other.ID;
	}
}
