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

public class mtf_as implements Runnable {
    BufferedReader in;
    StringTokenizer st;

    public int nextInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return Integer.parseInt(st.nextToken());
    }


    class Tree {
        int v;
        int y;

        int ls;
        int sz;

        Tree l;
        Tree r;
        Tree p;

        public Tree(int v, int y) {
            this.v = v;
            this.y = y;
            ls = 0;
            sz = 1;
        }

        int check(Tree p) {
            if (p != this.p) {
                System.out.println("Parent is corrupted");
            }
            int ll = 0;
            if (l != null) {
                ll = l.check(this);
            }
            if (ll != ls) {
                System.out.println("Left size corrupted");
            }
            int rr = 0;
            if (r != null) {
                rr = r.check(this);
            }
            if (ll + rr + 1 != sz) {
                System.out.println("Total size corrupted");
            }
            return ll + rr + 1;
        }
    }

    Tree merge(Tree l, Tree r) {
        if (l == null) {
            return r;
        }
        if (r == null) {
            return l;
        }
        if (l.y < r.y) {
            l.sz += r.sz;
            l.r = merge(l.r, r);
            l.r.p = l;
            return l;
        } else {
            r.sz += l.sz;
            r.ls += l.sz;
            r.l = merge(l, r.l);
            r.l.p = r;
            return r;
        }
    }

    Tree[] split(Tree t, int s) {
        if (t == null) {
            return new Tree[]{null, null};
        }

        Tree[] res = new Tree[2];
        if (t.ls >= s) {
            Tree[] tmp = split(t.l, s);
            res[0] = tmp[0];
            t.sz -= s;
            t.ls -= s;
            t.l = tmp[1];
            if (t.l != null) {
                t.l.p = t;
            }
            res[1] = t;
        } else {
            Tree[] tmp = split(t.r, s - t.ls - 1);
            res[1] = tmp[1];
            t.sz = s;
            t.r = tmp[0];
            if (t.r != null) {
                t.r.p = t;
            }
            res[0] = t;
        }
        return res;
    }

    class RMQ {
        int s;
        int[] v;
        int[] a;

        RMQ(int[] b) {
            a = b.clone();
            int n = b.length;
            s = 1;
            while (s < n) {
                s *= 2;
            }
            v = new int[2 * s - 1];
        }

        void set1(int x) {
            int i = Arrays.binarySearch(a, x);
            if (v[s - 1 + i] == 1) {
                return;
            }
            int j = s - 1 + i;
            while (j >= 0) {
                v[j]++;
                j = (j + 1) / 2 - 1;
            }
        }

        int count(int x) {
            int i = Arrays.binarySearch(a, x);
            int l = s - 1;
            int r = s - 1 + i - 1;
            int res = 0;
            while (l <= r) {
                if (l % 2 == 0) {
                    res += v[l];
                    l++;
                }
                if (r % 2 == 1) {
                    res += v[r];
                    r--;
                }
                l = (l + 1) / 2 - 1;
                r = (r + 1) / 2 - 1;
            }
            return res;
        }
    }

    public int count(Tree t) {
        int r = t.ls;
        while (t.p != null) {
            if (t.p.r == t) {
                r += t.p.ls + 1;
            }
            t = t.p;
        }
        return r;
    }

    public Tree insert(Tree t, int x, int y, Map<Integer, Tree> nodes) {
        if (t == null) {
            t = new Tree(x, y);
            nodes.put(x, t);
            return t;
        } else {
            if (t.y > y) {
                Tree tmp = new Tree(x, y);
                tmp.r = t;
                tmp.sz += t.sz;
                tmp.p = t.p;
                t.p = tmp;
                nodes.put(x, tmp);
                return tmp;
            } else {
                t.l = insert(t.l, x, y, nodes);
                t.l.p = t;
                t.ls = t.l.sz;
                t.sz++;
                return t;
            }
        }
    }

    public void solve() throws IOException {
        in = new BufferedReader(new FileReader("mtf.in"));
        PrintWriter out = new PrintWriter("mtf.out");

        int n = nextInt();
        int[] a = new int[n];
        TreeSet<Integer> v = new TreeSet<Integer>();
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
            v.add(a[i]);
        }
        int[] base = new int[v.size()];
        int index = 0;
        for (int x : v) {
            base[index++] = x;
        }

        Random rand = new Random(294780129047701274L);
        RMQ rmq = new RMQ(base);
        Tree tree = null;
        HashSet<Integer> used = new HashSet<Integer>();
        HashMap<Integer, Tree> nodes = new HashMap<Integer, Tree>();

        int[] b = new int[n];
        for (int i = 0; i < n; i++) {
            if (used.contains(a[i])) {
                int where = count(nodes.get(a[i]));
                b[i] = where + 1;
                Tree[] tmp = split(tree, where);
                Tree[] tmp2 = split(tmp[1], 1);
                tmp2[0] = merge(tmp2[0], tmp[0]);
                tree = merge(tmp2[0], tmp2[1]);
            } else {
                b[i] = a[i] + (used.size() - rmq.count(a[i]));
                rmq.set1(a[i]);
                used.add(a[i]);
                tree = insert(tree, a[i], rand.nextInt(), nodes);
            }
//            tree.check(null);
        }

        for (int i = 0; i < n; i++) {
            out.print(b[i]);
            if (i < n - 1) {
                out.print(" ");
            }
        }
        out.println();
        System.err.println(used.size());

        in.close();
        out.close();
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
        }
    }

    public static void main(String[] arg) {
        new Thread(new mtf_as()).start();
    }
}