Прошу уточнить что не нравится валидатору. Так же код, который выводит строку без id.
public class Solution {
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        FileInputStream inputStream = new FileInputStream(reader.readLine());
        String text = "";

        while (inputStream.available() > 0) {
            int byteTemp = inputStream.read();
            char charTemp = (char)byteTemp;
            text+=String.valueOf(charTemp);
        }

        String[] arrayString = text.split("\n");

        Map<Integer, String> map = new HashMap<>();

        for(String a:arrayString){
            int number = Integer.parseInt(a.substring(0,1));
            String product = a.substring(2);
            map.put(number,product);
        }

        int param = Integer.parseInt(args[0]);

        for(Map.Entry<Integer,  String> kv: map.entrySet()){
            int key = kv.getKey();
            String value = kv.getValue();
            if(param == key)
                System.out.println(key + " " +value);
        }
        inputStream.close();
    }
}