// Mimics operating system command type	
	
import java.util.*;	
import java.io.*;	
	
public class Type {	
	
	// main(): application entry point	
	public static void main(String[] args) {	
		// each command-line parameter is treated as a filename	
		// whose contents are displayed to standard output	
		for (int i = 0; i < args.length; ++i) {	
			Scanner fileIn = null;	
			// open input stream associated with i-th file parameter	
			try {	
				fileIn = null;	
				File file = new File(args[i]);	
				fileIn = new Scanner(file);	
				// args[i] is a readable filename	
	
				while (fileIn.hasNext()) {	
					String s = fileIn.nextLine();	
					System.out.println(s);	
				}	
			}	
			catch (FileNotFoundException e) {	
				// args[i] is not a valid filename	
				System.err.println(args[i] + ": cannot be opened");	
			}	
			catch (IOException e) {	
				System.err.println(args[i] + ": processing error");	
			}	
			finally {	
				if (fileIn != null) {	
					fileIn.close();	
				}	
			}	
		}	
	}	
}	
