#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, n1;
    cin >> n;
    n1 = n;
    int cnt = 0;
    while (n / 10 != 0) {
      cnt += n / 10;
      n = n / 10 + n % 10;
    }
    cout << cnt + n1 << endl;
  }
  return 0;
}
