var last1 = 0;
var last2 = 1;
var fib = [last1, last2];
while (fib.length < 40) {
	fib = [...fib, last1 + last2];
	var temp = (last1 + last2);
	last1 = last2;
	last2 = temp;
}
while (fib.length) {
	print(fib.shift(), " ");
}
print("\n");




// Compatibility functions
function print(...args){
	for (var arg of args){
		process.stdout.write(arg.toString())
	}
}