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