#include<iostream>
using namespace std;
int fab(int n)
{
if (n == 1 || n == 2)
{
return 1;
} else {
return fab(n - 2) + fab(n - 1);
}
}
int fab2 (int n)
{
int a[20];
a[1] = 1;
a[2] = 1;
for (int i = 3; i <= n; i++)
{
a[i] = a[i-2] + a[i-1];
}
return a[n];
}
int main()
{
for (int i = 1; i < 20; i++)
{
cout << fab (i) << endl;
}
cout << endl;
for (int i = 1; i < 20; i++)
{
cout << fab2 (i) << endl;
}
return 0;
}