Problem: One very well-known internet resource site (let's call it X) has come up with a New Year adventure. Specifically, they decided to give ratings to all visitors.

There are n users on the site, for each user we know the rating value he wants to get as a New Year Present. We know that user i wants to get at least ai rating units as a present.

The X site is administered by very creative and thrifty people. On the one hand, they want to give distinct ratings and on the other hand, the total sum of the ratings in the present must be as small as possible.

Help site X cope with the challenging task of rating distribution. Find the optimal distribution.

Input

The first line contains integer n (1 ≤ n ≤ 3·105) — the number of users on the site. The next line contains integer sequence a1, a2, ..., an (1 ≤ ai ≤ 109).

Output

Print a sequence of integers b1, b2, ..., bn. Number bi means that user i gets bi of rating as a present. The printed sequence must meet the problem conditions. 

If there are multiple optimal solutions, print any of them.

Examples

Input

3
5 1 1


Output

5 1 2


Input

1
1000000000


Output

1000000000

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

/**
 * <p>One very well-known internet resource site (let's call it X) has come
 * up with a New Year adventure. Specifically, they decided to give ratings
 * to all visitors.</p>
 *
 * <p>There are n users on the site, for each user we know the rating value
 * he wants to get as a New Year Present. We know that user i wants to get at
 * least ai rating units as a present.</p>
 *
 * <p>The X site is administered by very creative and thrifty people. On the
 * one hand, they want to give distinct ratings and on the other hand, the total
 * sum of the ratings in the present must be as small as possible.</p>
 *
 * <p>Help site X cope with the challenging task of rating distribution. Find
 * the optimal distribution.</p>
 *
 * <p><b>Input</b><br></br>The first line contains integer n (1 ≤ n ≤ 3·105) — the number
 * of users on the site. The next line contains integer sequence a1, a2, ...,
 * an (1 ≤ ai ≤ 109).</p>
 *
 * <p><b>Output</b><br></br>Print a sequence of integers b1, b2, ..., bn. Number bi means
 * that user i gets bi of rating as a present. The printed sequence must meet the
 * problem conditions. </p>
 *
 * Created by Vin on 14-1-21.
 */
public class NewYearRatingChange {


    /* #1-try start

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int size = scanner.nextInt(), tmp = 0;
        int[] units = new int[size];
        // synchronized unsorted set container
        Set<Integer> ratingSet =
                Collections.synchronizedSet(new LinkedHashSet<Integer>());
        // read input, stores in int[]
        while (tmp < size) {
            units[tmp++] = scanner.nextInt();
        }
        // each thread deal with 1000 pieces of data
        int modValue = size / 1000;

        //BlockingQueue<Runnable> threadQueue = new LinkedBlockingQueue<Runnable>();
        //ExecutorService es =
        //        new ThreadPoolExecutor(100, 200, 50, TimeUnit.MILLISECONDS, threadQueue);
        if (modValue > 0) {
            for (int i = 0; i < modValue; i++) {
                if (i == modValue - 1) {
                    new Thread(new RatingParseRunnable(ratingSet, i * 1000, size - 1, units)).start();
                    //es.execute(new RatingParseRunnable(ratingSet, i * 1000, size - 1, units));
                } else {
                    new Thread(new RatingParseRunnable(ratingSet, i * 1000, 999 + i * 1000, units)).start();
                    //es.execute(new RatingParseRunnable(ratingSet, i * 1000, 999 + i * 1000, units));
                }
            }
        } else {
            new Thread(new RatingParseRunnable(ratingSet, 0, size - 1, units)).start();
            //es.execute(new RatingParseRunnable(ratingSet, 0, size - 1, units));
        }
        while (true) {
            if (ratingSet.size() == size) {
                break;
            }
        }
        String split = " ";
        for (int i = 0; i < size; i++) {
            if (i == size - 1) split = "";
            System.out.print(units[i] + split);
        }
        scanner.close();
    }


    public static class RatingParseRunnable implements Runnable {

        private final Set<Integer> rs;
        private int startIdx;
        private int endIdx;
        private int[] threadUnits;

        public RatingParseRunnable(final Set<Integer> ratingSet, int startIndex, int endIdx, int[] units) {
            this.rs = ratingSet;
            this.startIdx = startIndex;
            this.endIdx = endIdx;
            this.threadUnits = units;
        }

        @Override
        public void run() {
            for (int i = startIdx; i <= endIdx; i++) {
                int tt = threadUnits[i];
                while (true) {
                    if (rs.add(tt++)) {
                        threadUnits[i] = tt - 1;
                        break;
                    }
                }
            }
        }
    }

    #1 try end.*/


    /*  #2 try start*/
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        long[][] arr = new long[n][3];
        StringTokenizer tok = new StringTokenizer(br.readLine());
        for (int i = 0; i < n; i++) {
            arr[i][0] = i;
            arr[i][1] = Integer.parseInt(tok.nextToken());
        }
        Arrays.sort(arr, new ArrComparator());
        StringBuilder sb = new StringBuilder(15 * n);
        long currNum = 0;

        for (int i = 0; i < n; i++) {
            currNum++;
            if (currNum < arr[i][1]) {
                currNum = arr[i][1];
            }
            arr[i][2] = currNum;
        }
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[(int) arr[i][0]] = arr[i][2];
        }
        String split = " ";
        for (int i = 0; i < n; i++) {
            if(i == n-1)
                split = "";
            sb.append(res[i]).append(split);
        }
        System.out.print(sb.toString());

    }

    private static class ArrComparator implements Comparator<long[]>{
        @Override
        public int compare(long[] o1, long[] o2) {
            return (int)(o1[1] - o2[1]);
        }
    }
    /*  #2 try end */
}