Language: Java

import java.util.*;
 
 
 
public class Main {
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int max = 0;
		 Map<String, Integer> map = new HashMap<String, Integer>();
		 while(N > 0) {
			 String str = sc.next();
			if(Map.containsKey(str)) {
				Map.put(str,(Map.get(str)));
			}
			else {
                Map.put(str,1);
            }
			 if (Map.get(str) > max) {
	                max = Map.get(str);
	            }
			N--;
		 }
	        List<String> result = new ArrayList<>();
	        for (String str: Map.keySet()){
	            if(Map.get(str) == max){
	                result.add(str);
	            }
	        }
	        Collections.sort(result);
	        for(String s : result) {
	        	System.out.println(s);
	        }
	}
}

Compiler output:
Main.java:13: error: non-static method containsKey(Object) cannot be referenced from a static context
			if(Map.containsKey(str)) {
			      ^
Main.java:14: error: non-static method put(K,V) cannot be referenced from a static context
				Map.put(str,(Map.get(str)));
				   ^
  where K,V are type-variables:
    K extends Object declared in interface Map
    V extends Object declared in interface Map
Main.java:14: error: non-static method get(Object) cannot be referenced from a static context
				Map.put(str,(Map.get(str)));
				                ^
  where V is a type-variable:
    V extends Object declared in interface Map
Main.java:17: error: non-static method put(K,V) cannot be referenced from a static context
                Map.put(str,1);
                   ^
  where K,V are type-variables:
    K extends Object declared in interface Map
    V extends Object declared in interface Map
Main.java:19: error: non-static method get(Object) cannot be referenced from a static context
			 if (Map.get(str) > max) {
			        ^
  where V is a type-variable:
    V extends Object declared in interface Map
Main.java:19: error: bad operand types for binary operator '>'
			 if (Map.get(str) > max) {
			                  ^
  first type:  Object
  second type: int
Main.java:20: error: non-static method get(Object) cannot be referenced from a static context
	                max = Map.get(str);
	                         ^
  where V is a type-variable:
    V extends Object declared in interface Map
Main.java:20: error: incompatible types: Object cannot be converted to int
	                max = Map.get(str);
	                             ^
Main.java:25: error: non-static method keySet() cannot be referenced from a static context
	        for (String str: Map.keySet()){
	                            ^
  where K is a type-variable:
    K extends Object declared in interface Map
Main.java:25: error: incompatible types: Object cannot be converted to String
	        for (String str: Map.keySet()){
	                                   ^
Main.java:26: error: non-static method get(Object) cannot be referenced from a static context
	            if(Map.get(str) == max){
	                  ^
  where V is a type-variable:
    V extends Object declared in interface Map
Main.java:26: error: bad operand types for binary operator '=='
	            if(Map.get(str) == max){
	                            ^
  first type:  Object
  second type: int
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
12 errors