For this Question: For two strings A and B, let A + B denote the concatenation of A and B in this order.
You are given N strings Si,. , SN​. Modify and print them as follows, in the order i = 1,. , N:
 
Let X be the number of strings S1​,. , Si-1​ are equal to Si​.
if X = 0 print Si.
if X (X > 0) print Si​+(+X+), treating X as a string.The first line of the input contains a single integer N.
The next N lines contains N strings S1, S2,. SN.

Constraints:
1 <= N <= 2 x 10^5
Si is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.Print N lines as specified in the Problem Statement.Sample Input 1:
5
newfile
newfile
newfolder
newfile
newfolder
 
Sample Output 1:
newfile
newfile(1)
newfolder
newfile(2)
newfolder(1)
 
 
Sample Input 2:
11
a
a
a
a
a
a
a
a
a
a
a
 
Sample Output 2:
a
a(1)
a(2)
a(3)
a(4)
a(5)
a(6)
a(7)
a(8)
a(9)
a(10), I have written this Solution Code: 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 [] inp = new String [n];
        Map <String,Integer> mp = new HashMap<>();
        for(int i= 0 ;i<n;i++){
            inp[i]=br.readLine();

        }

        for(String ele : inp ){
            mp.put(ele,mp.getOrDefault(ele,0)+1);
            if(mp.get(ele)==1) System.out.println(ele);
            else System.out.println(ele+'('+(mp.get(ele)-1)+')');
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?