#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long a;
  cin >> a;
  long long L = 1, P = 1000000000000000000;
  long long r = (100000000000000000 * 18) % a;
  r = (r * 5) % a;
  r = (r * 9) % a;
  r = (r + 1) % a;
  if (r != 0) {
    L += a - r;
    P += a - r;
  }
  cout << L << " " << P;
  return 0;
}
