#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    long long s, c = 0, r, a, t, e;
    cin >> s;
    e = s;
    while (e) {
      r = e % 10;
      a = e - r;
      t = a / 10;
      c += t;
      e = e - a + t;
      if (t == 0) {
        break;
      }
    }
    cout << c + s << "\n";
  }
}
