#C287. Fibonacci Sequence Generator

    ID: 46233 Type: Default 1000ms 256MiB

Fibonacci Sequence Generator

Fibonacci Sequence Generator

This problem requires you to generate the first n terms of the Fibonacci sequence. The Fibonacci sequence is defined as follows:

\(F_0 = 0, \quad F_1 = 1, \quad F_n = F_{n-1} + F_{n-2}\)

The input is a single value which can be either an integer or a string that represents an integer. If the input is invalid (for example, non-numeric, negative, or zero), the program should output "Invalid input". Otherwise, the program should output the first n Fibonacci numbers separated by a single space.

inputFormat

The input is read from standard input. It consists of a single line containing one value. This value should represent a positive integer (n).

outputFormat

If the input is a valid positive integer, output a single line containing the first n Fibonacci numbers separated by spaces. Otherwise, output "Invalid input".

## sample
5
0 1 1 2 3