#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
long long l, r, mod;
int main() {
  cin >> mod;
  l = mod - INF % mod * 9 % mod * 9 % mod;
  r = l + INF - 1;
  cout << l << ' ' << r;
}
