#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int ans = n;
  int rafi = n;
  while (rafi >= 10) {
    int x = rafi / 10;
    ans += x;
    rafi = rafi % 10 + x;
  }
  cout << ans << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
