#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    long long int n;
    cin >> n;
    long long int sum = 0;
    sum = n / 9;
    if (n % 9 == 0) sum--;
    sum += n;
    cout << sum << endl;
  }
}
