public class Solution { public static void main(String[] args) throws IOException { int id = Integer.parseInt(args[0]); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String fileName = reader.readLine(); FileInputStream fileInputStream = new FileInputStream(fileName); byte [] readedByte = new byte[fileInputStream.available()]; fileInputStream.read(readedByte); String st = new String(readedByte); String [] priceList = st.split(" "); for(int i = 0; i<priceList.length; i=i+4){ if(Integer.parseInt(priceList[i])==id){ System.out.print(priceList[i]+ " "); System.out.print(priceList[i+1] + " "); System.out.print(priceList[i+2] + " "); System.out.print(priceList[i+3] + " "); } } fileInputStream.close(); reader.close(); } }