class Fibonacci {
    public static void main(String[] args) {
        try {
            int lo = 1;
            int hi = 1;
            int n = Integer.parseInt(args[0]);
            System.out.println(lo);
            for (int i = 1; i < n; i++) { 
                System.out.println(hi);
                hi = lo + hi;
                lo = hi - lo; 
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            System.err.println("No command line argument.");
        } catch (NumberFormatException e) {
            System.err.println("Command line argument "
                               + e.getMessage()
                               + " is not an integer.");
        } finally {
            System.out.println("Done!");
        }
    }
}
