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