import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner fs = new FastScanner(System.in);
        if (!fs.hasNextInt()) { System.out.println("INVALID"); return; }
        int m = fs.nextInt();
        if (m < 1 || m > 200_000) { System.out.println("INVALID"); return; }
        long[] arr = new long[m];
        for (int i = 0; i < m; ++i) {
            if (!fs.hasNextLong()) { System.out.println("INVALID"); return; }
            long v = fs.nextLong();
            if (v < -1_000_000_000L || v > 1_000_000_000L) { System.out.println("INVALID"); return; }
            arr[i] = v;
        }

        // two heaps
        PriorityQueue<Long> maxHeap = new PriorityQueue<>(Collections.reverseOrder()); // lower half
        PriorityQueue<Long> minHeap = new PriorityQueue<>(); // upper half

        StringBuilder out = new StringBuilder();
        for (int i = 0; i < m; ++i) {
            long x = arr[i];
            // insert
            if (maxHeap.isEmpty() || x <= maxHeap.peek()) maxHeap.offer(x);
            else minHeap.offer(x);

            // rebalance
            if (maxHeap.size() - minHeap.size() > 1) minHeap.offer(maxHeap.poll());
            else if (minHeap.size() - maxHeap.size() > 1) maxHeap.offer(minHeap.poll());

            // compute median
            if (maxHeap.size() == minHeap.size()) {
                long a = maxHeap.peek();
                long b = minHeap.peek();
                long s = a + b;
                if ((s & 1L) == 0L) out.append(s/2).append(i+1==m? "": " ");
                else out.append((s/2)).append(".5").append(i+1==m? "": " ");
            } else if (maxHeap.size() > minHeap.size()) {
                out.append(maxHeap.peek()).append(i+1==m? "": " ");
            } else {
                out.append(minHeap.peek()).append(i+1==m? "": " ");
            }
        }
        System.out.println(out.toString());
    }

    // Fast scanner
    static class FastScanner {
        private final InputStream in;
        private final byte[] buffer = new byte[1<<16];
        private int ptr = 0, len = 0;
        FastScanner(InputStream is) { in = is; }
        private int read() throws IOException {
            if (ptr >= len) {
                len = in.read(buffer);
                ptr = 0;
                if (len <= 0) return -1;
            }
            return buffer[ptr++];
        }
        boolean hasNextInt() throws IOException {
            int c; while ((c = read()) != -1 && Character.isWhitespace(c));
            if (c == -1) return false; ptr--;
            return true;
        }
        int nextInt() throws IOException { return (int)nextLong(); }
        long nextLong() throws IOException {
            int c = read();
            while (c != -1 && Character.isWhitespace(c)) c = read();
            if (c == -1) return 0;
            boolean neg = false;
            if (c == '-') { neg = true; c = read(); }
            long val = 0;
            while (c >= '0' && c <= '9') {
                val = val*10 + (c - '0'); c = read();
            }
            return neg ? -val : val;
        }
    }
}
