#include #define rep(i,n)for(int i=0;i<(int)(n);i++) using namespace std; using ll=long long; using ld=long double; using pai=pair; using pall=pair; using vint=vector; using vll=vector; using pquel=priority_queue,greater>; using pquei=priority_queue,greater>; ll one=1,zero=0; const string yes="Yes",no="No"; const ll bip=1000000007,sap=998244353; const ld pi=3.1415926535897932384626433832; const int inty=(one<<31)-1; const ll lly=(one<<63)-1; unordered_mapuf; unordered_mapufo; void ufi(ll &x){ if(ufo[x]==0){ ufo[x]=1; uf[x]=x; } return; } void ufm(ll &x,ll &y){ ufi(x); ufi(y); queueq; q.push(x); q.push(y); while(uf[x]!=x){ x=uf[x]; q.push(x); } while(uf[y]!=y){ y=uf[y]; q.push(y); } while(!(q.empty())){ y=q.front(); q.pop(); uf[y]=x; } return; } void uft(ll &x){ ufi(x); ll y; queueq; q.push(x); while(uf[x]!=x){ x=uf[x]; q.push(x); } while(!(q.empty())){ y=q.front(); q.pop(); uf[y]=x; } return; } ll divi(ll a,ll b){ b=abs(b); a=(a%b+b)%b; if(2*a>fft(int &n,vector>&pol){ if(n==1)return pol; n/=2; vector>f1(n),f2(n),f3(n*2); for(int i=0;i>invfft(int &n,vector>&pol){ if(n==1)return pol; n/=2; vector>f1(n),f2(n),f3(n*2); for(int i=0;i>t; ll n,k; while(t--){ cin>>n; k=10; while(k<=n){ k*=10; } cout<<10*k-1-n<