#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; const ll B = 100000000000000000LL; while (T--) { ll N; cin >> N; ll q = (N - 1) / 9; ll d = (N - 1) % 9 + 1; ll R = d * B; ll L = R - q; cout << L << " " << R << '\n'; } }