@@ -0,0 +1,1369 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Aclass Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A    %09try%7B%0A%09        Scanner in = new Scanner(System.in);%0A%09        int n = in.nextInt();%0A%09        int%5B%5D types = new int%5Bn%5D;%0A%09        int%5B%5D freq=new int%5B5%5D;%0A%09        for(int types_i=0; types_i %3C n; types_i++)%7B%0A%09            types%5Btypes_i%5D = in.nextInt();%0A%09            switch(types%5Btypes_i%5D)%7B%0A%09                case 1:%0A%09                    freq%5B0%5D++;%0A%09                    break;%0A%09                case 2:%0A%09                    freq%5B1%5D++;%0A%09                    break;%0A%09                case 3:%0A%09                    freq%5B2%5D++;%0A%09                    break;%0A%09                case 4:%0A%09                    freq%5B3%5D++;%0A%09                    break;%0A%09                case 5:%0A%09                    freq%5B4%5D++;%0A%09                    break;%0A%09                default:%0A%09                    break;%0A%09            %7D%0A%09            %0A%09        %7D%0A%09        int arr%5B%5D=new int%5B5%5D;%0A%09        arr=Arrays.copyOf(freq,5);%0A%09        Arrays.sort(arr);%0A%09        int maxFreq=arr%5B4%5D;%0A%09        for(int i=0;i%3C5;i++)%7B%0A%09            if(maxFreq==freq%5Bi%5D)%7B%0A%09                System.out.println(i+1);%0A                    break;%0A%09            %7D%0A%09        %7D%0A        %7D// your code goes here%0A        catch(Exception e)%7B%0A        %09System.out.println(e);%0A        %7D%0A    %7D%0A%7D%0A

add MigratoryBirds.java