/*
This program is desiged to throw exceptions and error in an ungracefull way
 */

import java.io.*;
import java.util.*; //need for the string tokenizer

class ReadLines
{
    StringTokenizer st;
    BufferedReader i_stream;
    BufferedWriter o_stream;

    
    ReadLines( String input_file, String output_file) 
    {
	try {
	    FileReader i_file = new FileReader( input_file );
	    FileWriter o_file = new FileWriter( output_file );
	    i_stream = new BufferedReader( i_file );
	    o_stream = new BufferedWriter( o_file );
	} catch ( IOException e ) {
	    System.out.println("error");
	}
	
    }


    String get_line()
    {
	String s = null;

	try {
	    s = i_stream.readLine();
	}
	catch( IOException e) {
	    System.out.println("error");
	}
	return s;
    }

    void put_line( String s )
    {
	try {
	    o_stream.write( s );
	}
	catch ( IOException e ) {
	    System.out.println("error");
	}
    }

    void close_files()
    {
	try {
	    i_stream.close();
	    o_stream.close();
	}
	catch ( IOException e ) {
	    System.out.println("error");
	}
    }

    String get_words( String s )
    {
	if ( st.hasMoreTokens() )
	    return st.nextToken();
	
	st = new StringTokenizer(s);
	return null;
    }
}


public class Ill_behaved
{
    public static void main (String []args)
    {
	ReadLines rl = new ReadLines(args[0], args[1]);
	String s, t;
	
	s = rl.get_line();
	t = rl.get_words( s );
	System.out.println("word gotten [" + t + "]"); 
	    
	for ( int i=0; s != null; i++ )
	    rl.put_line( i+s );

	rl.close_files();
    }
    
}


