#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
stack<long long> sa;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, sum = 0;
    cin >> a;
    sum = a;
    do {
      sum += a / 10;
      a = a % 10 + a / 10;
    } while (a > 9);
    cout << sum << endl;
  }
  return 0;
}
