For this Question: There are N participants in a programming contest. You are given an integer array A of size N. The i<sup>th</sup> element of the array A denotes the score of the i<sup>th</sup> participant. Find the rank of all the participants. 1st place participant has the highest score, the 2nd place participant has the 2nd highest score, and so on. If two participants have same score, the participant with higher index will be placed above the participant with lower index in rank list.First line contains an integer N.
Next line contains N space separated integers denoting elements of array.

Constraints
1 <= N <= 10^5
1 <= Ai<= 10^5Print N space separated integers where the i<sup>th</sup> integer is the rank of the i<sup>th</sup> participant.Sample Input 1:
3
3 2 1

Output 
1 2 3

Explanation:
Participant 1 has highest score, so his rank is 1.
Participant 2 has second highest score, so his rank is 2. 
Participant 3 has lowest score, so his rank is 3. 

Sample Input 2:
4
7 7 7 7

Output 
4 3 2 1

Explanation
As all participants have same score, the participant with higher index will be placed above in rank list., I have written this Solution Code: /*package whatever //do not write package name here */

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

class Main{
	public static void main (String[] args)throws IOException {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	    int n=Integer.parseInt(br.readLine());
    	    String line = br.readLine();
    	    String[] strs = line.trim().split("\\s+");
    	    int a[] = new int[n];
    	    int ans[] = new int[n];
            for (int i = 0; i < n; i++) {
                 a[i] = Integer.parseInt(strs[i]);
            }
        	PriorityQueue<Pair> p = new PriorityQueue<Pair>(n, new cmp());
    	    for(int i=0;i<n;i++){
    		    p.add(new Pair(a[i], i));
    	    }
        	int ind = 1;
        	while (p.size() > 0) {
        		ans[p.peek().c] = ind;
        		ind++;
        		p.poll();
        	}
        	for(int i=0;i<n;i++){
        		System.out.print(ans[i]+ " ");
        	}
	}
	
}
class cmp implements Comparator<Pair>{
    public int compare(Pair s1, Pair s2) {
        if (s1.f < s2.f)
            return 1;
        else if (s1.f > s2.f)
            return -1;
        else{
            if(s1.c<s2.c)return 1;
            else return -1;
        }
    }
}
  
class Pair {
    public int f;
    public int c;
    public Pair(int f, int c) {
        this.f = f;
        this.c = c;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?