#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  int tt;
  cin >> tt;
  while (tt--) {
    int s;
    cin >> s;
    int ans = 0;
    int pw = 1000 * 1000 * 1000;
    while (s > 0) {
      while (s < pw) pw /= 10;
      ans += pw;
      s -= pw - pw / 10;
    }
    cout << ans << endl;
  }
}
