#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ ll n; cin >> n; if(n <= 9){ cout << n << ' ' << n << '\n'; continue; } ll R = 99'999'999'999'999'999LL; ll th = 100'000'000'000'000'000LL; ll m = n / 9, rem = n - m * 9; if(rem == 0){ cout << R - m + 1 << ' ' << R << '\n'; }else{ cout << rem * th - m << ' ' << rem * th << '\n'; } } }