import java.io.*;
import java.util.*;

//Expands one-line tests containing only integers from the given file.
//Supports end-of-line comments beginning with "//"

public class TestExpander {
    public static void main(String[] args) throws IOException {
	if (args.length != 1) {
	    System.err.println("Usage: expand_lines <file-with-tests>");
	    System.exit(1);
	}
	File file = new File(args[0]);
	if (!file.exists() && !file.isFile()) {
	    System.err.println("File does not exist");
	    System.exit(1);
	}
	BufferedReader in = new BufferedReader(new FileReader(file));
	String line;
	int testN = 0;
	while ((line = in.readLine()) != null) {
	    ArrayList<Integer> data = new ArrayList<Integer>();
	    StringTokenizer st = new StringTokenizer(line);
	    while (st.hasMoreTokens()) {
		String token = st.nextToken();
		if (token.startsWith("//")) {
		    break;
		}
		try {
		    data.add(Integer.valueOf(token));
		} catch (NumberFormatException e) {
		    System.err.println("Warning: token " + token + " is neither a comment, nor an integer");
		    break;
		}
	    }
	    if (data.size() > 0) {
		PrintWriter test = new PrintWriter(String.format("%02d", ++testN));
		for (int i = 0; i < data.size(); ++i) {
		    test.print(data.get(i));
		    if (i + 1 == data.size()) {
			test.println();
		    } else {
			test.print(" ");
		    }
		}
		test.close();
	    }
	}
    }
}
