**Inputs**

```
Hi.
Bye.
#

```

**Actual outputs:**

```
h(1)i(1)

```

**Expected outputs:**

```
h(1) i(1)
b(1) e(1) y(1)

```

There must be a gap between both items. How do I need to modify my `while` loop so `#` will indicate stop?

```
import java.util.Scanner;

public class MyClass {
    public static void main(String args[]) {
        int a[] = new int[26];

        Scanner sc =  new Scanner (System.in);
        String str = sc.nextLine();     

        for (char ch : str.toCharArray())
            if (ch >= 65 && ch <= 90)
                a[ch - 65]++;
            else if (ch >= 97 && ch <= 122)
                a[ch - 97]++;   

        for (int i = 0; i < 26; i++)
            if (a[i] > 0)
                System.out.print((char)(i + 97) + "(" + a[i] + ")");    
    }       
}

```