import java.io.*;

class ReadArgs {
    public static void main(String args[]) {
        try {
            for (String filename : args) {
                BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF-8"));
                for (int i = 1; ; i++) {
                    String x = br.readLine();
                    if (x == null) break;
                    System.out.println(String.format("%d %s", i, x));
                }
            }
        } catch (Exception e) {
        }
    }
}