Help me in solving FIBXOR01 problem

My issue

import java.util.Scanner;

class Codechef {
static int fiba(int c, int a, int b) {
if (c == 0) {
return a;
}
if (c == 1) {
return b;
}
return fiba(c - 1, a, b) ^ fiba(c - 2, a, b);
}

public static void main(String[] args) throws java.lang.Exception {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        System.out.println(fiba(c, a, b));
    }
    sc.close();
}

}
what’s wrong with my approach?

My code

import java.util.Scanner;

class Codechef {
    static int fiba(int c, int a, int b) {
        if (c == 0) {
            return a;
        }
        if (c == 1) {
            return b;
        }
        return fiba(c - 1, a, b) ^ fiba(c - 2, a, b);
    }

    public static void main(String[] args) throws java.lang.Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            System.out.println(fiba(c, a, b));
        }
        sc.close();
    }
}

Problem Link: Special Fibonacci Practice Coding Problem

@darksoul_priy1
this logic will give u tle .
try to recognize the pattern the answer will repeat after some operations .
just try for smaller cases u will get the pattern.