#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long p = 0;
    while (n > 9) {
      long long q = n / 10;
      p += (10 * q);
      long long r = n - (10 * q);
      n = r + q;
    }
    cout << n + p << "\n";
  }
  return 0;
}
