Ok so, I'm doing hackerrank's Fibonacci modified question. I am able to solve this question only when the iteration goes to 8 anything pass that and it starts returning a large negative number. I thought this was because of an integer overflow so I changed my types to unsigned long long yet the problems still persist. Any help is appreciated.
Link to original problem: https://www.hackerrank.com/challenges/fibonacci-modified/problem
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    int modFib(unsigned t1, unsigned t2, unsigned n) {
        if (n == 1) {
            return t1;
        } 
        else if (n == 2) {
            return t2;
        } else {
            return modFib(t1, t2, n-2) + (modFib(t1, t2, n-1) * modFib(t1, t2, n-1));
        }
    }
    
    int main() {
        cout << modFib(0, 1, 10) << endl;
        return 0;
    }
//Expected output is 84266613096281243382112
//I get -1022889632
 
    