#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int x;
    cin >> x;
    if (x <= 9) {
      cout << x << endl;
    } else {
      x = (x / 0.9);
      printf("%lld\n", x);
    }
  }
}
