#include <bits/stdc++.h>
using namespace std;
const long long infl = 0x3f3f3f3f3f3f3f3fLL;
const long long infi = 0x3f3f3f3f;
const long long mod = 1000000007;
const long double pi = 3.14159265358979323846264;
long long powm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  return a % b == 0 ? b : gcd(b, a % b);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  clock_t clk = clock();
  ;
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    long long ans = 0;
    long long res = 0;
    long long m = 1000 * 1000 * 1000;
    while (n > 0) {
      while (n < m) m /= 10;
      res += m;
      n -= m - m / 10;
    }
    cout << res << endl;
  }
  return 0;
}
