#include <bits/stdc++.h>
using namespace std;
int main() {
  int testc;
  cin >> testc;
  while (testc--) {
    int num = 0, AcDul = 0, AcTotal = 0;
    cin >> num;
    int temp = num;
    while (num / 10 >= 1) {
      AcDul = num / 10;
      num = (num - (AcDul * 10));
      num += AcDul;
      AcTotal += AcDul;
    }
    cout << temp + AcTotal << endl;
  }
  return 0;
}
