#include <bits/stdc++.h>
using namespace std;
void KhanhCute() {
  int n;
  cin >> n;
  long long res = 0;
  while (n >= 10) {
    int x = n / 10;
    n -= x * 9;
    res += x * 10;
  }
  cout << res + n << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    KhanhCute();
  }
  return 0;
}
