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