[HELP]Marbles - Please check the approach

Here’s the link - MARBLES

I want to know why my code is giving a WA .Please help me in figuring this out. Here’s my code.

THANKS IN ADVANCE !!!

//JUST LIKE ANIMALS !!!!

#include<bits/stdc++.h>
using namespace std; 
typedef unsigned long long ll;

bool ispalin(ll n){
ll i;
string s=to_string(n);
for(i=0;i<(s.length()/2);i++){
	if(s[i]!=s[s.length()-1-i]){
		return false;
	}
}
return true;
}

int main(){
int t;cin>>t;
while(t--){
	ll n,i;cin>>n;
	
	if(n%99==0&&n%11==0)cout<<n+2<<endl;
	else{
		for(i=n+1;;i++){
		if(ispalin(i)==true)
		{
			cout<<i<<endl;break;
		}
	}
	}
}
return 0;
}

The input can be numbers with 1000000 digits and these wont fit in any data type , so you can’t use this direct approach.

Actually its working for the exact number you provide correctly. I guess I am missing a base case or something. Thanks anyways. BTW, we can store a 10^6 number in long long datatype variable.

You understood it wrongly I said that the input number can have 1000000 digits not the number 1000000 itself .