#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int c = 0, r, d, a, s;
    a = n;
    while (n) {
      if (n >= 10) {
        r = n / 10;
        n -= r * 10;
        n += r;
        c += r * 10;
      } else {
        c += n;
        n /= 10;
      }
    }
    cout << c << endl;
  }
}
