#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int rem = n / 9;
    if (n % 9 == 0) rem--;
    n += rem;
    cout << n << endl;
  }
  return 0;
}
