#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int T; cin >> T; rep(_,T) { ll N; cin >> N; ll M = pow(10, to_string(N).size() + 1u) - 1 - N; //assert(stoll(to_string(N) + to_string(M)) % (N + M) == 0); cout << M << "\n"; } }