#include <bits/stdc++.h>
using namespace std;
const int64_t max6 = 1e6 + 6;
const int64_t oo = 1e9 + 9;
const int64_t modx = 1e9 + 7;
const int64_t mody = 1e9 + 123;
int main() {
  int64_t t;
  cin >> t;
  while (t--) {
    int64_t s;
    cin >> s;
    int64_t res = 0;
    while (s > 0) {
      if (s < 10)
        res += s, s = 0;
      else {
        int64_t tmp = s / 10;
        s = s - 9 * tmp;
        res = res + tmp * 10;
      }
    }
    cout << res << "\n";
  }
}
