#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
int arr[maxn];
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int ans = n;
    while (n) {
      int tip = n % 10;
      ans += n / 10;
      n = n / 10 + tip;
      if (n < 10) break;
    }
    cout << ans << endl;
  }
  return 0;
}
