#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, s, bs = 0, c;
  cin >> t;
  while (t--) {
    bs = 0;
    cin >> s;
    while (s >= 10) {
      string s1 = to_string(s);
      s = s - pow(10, s1.size() - 1);
      bs += pow(10, s1.size() - 1);
      s += pow(10, s1.size() - 2);
    }
    bs += s;
    cout << bs << endl;
  }
}
