:)
package com.codegym.task.task18.task1803;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/*
Most frequent bytes
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String fileName = reader.readLine();
FileInputStream inputStream = new FileInputStream(fileName);
ArrayList<Integer> intList = new ArrayList<>();
HashMap<Integer, Integer> map = new HashMap<>();
while(inputStream.available() > 0){
int read = inputStream.read();
intList.add(read);
}
int max = 0;
for(int i = 0; i < intList.size(); i++){
int x = inputStream.read();
int count = 0;
if(intList.get(i).equals(x));{
count ++;
map.put(intList.get(i), count);
}
if(count > max){
max = count;
count = 0;
}
}
inputStream.close();
for(Map.Entry<Integer, Integer> entry : map.entrySet()){
if(entry.getKey() == max){
System.out.print(entry.getValue() + " ");
}
}
}
}