#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const int N=2e5+1;
int n;
int a[N];
int f[N];
int d(ll x){
	int s=0;
	while(x>0){
		s+=x%10;x/=10;
	}
	return s;
}
void solve(){
	ll n;cin >> n;
	ll x=n;
	while(d(x)%2==d(n)%2) x++;
	cout << x << '\n';
	
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	int t;cin >> t;while(t--) solve();
}