#include <bits/stdc++.h>
using namespace std;
long long a, mx = 1e18 + 1;
signed main() {
  cin >> a;
  long long l, r;
  l = a - mx % a * 9 % a * 9 % a, r = mx + l - 1;
  cout << l << " " << r << endl;
  return 0;
}
