#include <bits/stdc++.h>
using namespace std;
bool fun(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  if ((a.first > b.first) || (a.first == b.first && a.second < b.second))
    return 1;
  return 0;
}
int main() {
  long long int t, i;
  cin >> t;
  while (t--) {
    long long int s, x;
    cin >> s;
    x = s;
    if (x <= 9) {
      cout << x << endl;
    } else if (x % 9 == 0) {
      cout << s + x / 9 - 1 << endl;
    } else
      cout << s + x / 9 << endl;
  }
}
