#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int extra = n / 10;
  int mod = (n % 10) + extra;
  while (mod >= 10) {
    extra += (mod / 10);
    int ext = mod % 10;
    mod /= 10;
    mod += ext;
  }
  cout << n + extra << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
