#include #include #include #include #include #include #include using namespace std; void solve() { int n; cin >> n; int ret = -1; for(int lhs = 1; lhs <= 9; lhs++) { int cand = 0; for(int rhs = lhs; rhs <= 9; rhs++) { cand = 10 * cand + rhs; if(cand >= n) { if(ret == -1 || cand < ret) ret = cand; } } } cout << ret << "\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--) solve(); }