#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, i, n, g, sum;
  cin >> t;
  while (t--) {
    cin >> n;
    g = n;
    sum = 0;
    while (g >= 10) {
      sum += g / 10;
      g = g / 10 + g % 10;
    }
    cout << n + sum << "\n";
  }
  return 0;
}
