#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res % 1000000007 * a % 1000000007) % 1000000007;
    a = (a % 1000000007 * a % 1000000007) % 1000000007;
    b = b >> 1;
  }
  return res;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, s = 0, p;
    cin >> n;
    p = n;
    while (p / 10 > 0) {
      s = s + p / 10;
      p = p / 10 + p % 10;
    }
    cout << n + s << "\n";
  }
}
