#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x;
    cin >> x;
    int N = 1e9;
    long long ans = 0;
    while (x > 0) {
      while (x < N) N /= 10;
      ans += N;
      x -= N - N / 10;
    }
    cout << ans << endl;
  }
}
