#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) int main(){ int tt; cin >> tt; while(tt--){ ll n; cin >> n; ll m = n; while(true){ //printf("(n,m) = (%d,%d)\n",n,m); ll x = m; ll sn = n; while(x > 0){ x/=10; sn *= 10; } if ((sn+m)%(n+m) == 0){ //printf("(n,m) = (%d,%d)\n",n,m); cout << m << endl; break; } m += n; } } return 0; }