class Solution { public: int Fibonacci(int n) {
if(n>39) return -1; int f=0,g=1; if (n==0) return 0; if (n==1) return 1; n=n-1; while(n) { g=f+g; f=g-f; n--; } return g; }
};