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

public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner fs = new FastScanner(System.in);

        // Validate number of elements
        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) {
            // Ensure the next value exists and is a valid number
            if (!fs.hasNext()) { 
                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 for median maintenance
        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 heaps
            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 sum = a + b;
                if ((sum & 1L) == 0L)
                    out.append(sum / 2);
                else
                    out.append(sum / 2).append(".5");
            } else if (maxHeap.size() > minHeap.size()) {
                out.append(maxHeap.peek());
            } else {
                out.append(minHeap.peek());
            }

            if (i != m - 1) out.append(" ");
        }

        System.out.println(out.toString());
    }

    // FastScanner — simplified and compatible with Amypo
    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 hasNext() throws IOException {
            int c;
            while ((c = read()) != -1 && Character.isWhitespace(c));
            if (c == -1) return false;
            ptr--;
            return true;
        }

        boolean hasNextInt() throws IOException { return hasNext(); }

        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) throw new IOException("No more data");
            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;
        }
    }
}
