#include <bits/stdc++.h>
using namespace std;
int main() {
  long testcase = 0, s;
  cin >> testcase;
  for (long test = 0; test < testcase; test++) {
    cin >> s;
    int spent = 0;
    if (s >= 10) {
      while (s >= 10) {
        spent += (s / 10) * 10;
        s = s - ((s / 10) * 10) + (s / 10);
      }
      spent += s;
      cout << spent << endl;
    } else
      cout << s << endl;
  }
  return 0;
}
