import java.util.*;

public class Main {
    public static void main(String[] args) {
        int[] a = {1, 3, 3, 4, 1, 4, 4, 4, 4};
        int n = a.length;

        Scanner scanner = new Scanner(System.in);
        int q = scanner.nextInt();

        for (int l = 0; l < q; l++) {
            int qry = scanner.nextInt();
            int frq = 0;

            for (int j = 0; j < n; j++) {
                if (a[j] == qry) {
                    frq++;
                }
            }

            System.out.print(qry + " -> number occurs ");
            System.out.print(frq + " ");
            System.out.println("-> times in the array given");
        }
    }
}
