#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long a, ans;
void read(long long &x) {
  int f = 0;
  x = 0;
  char ch = getchar();
  for (; !(ch >= '0' && ch <= '9'); ch = getchar()) f |= ch == '-';
  for (; (ch >= '0' && ch <= '9'); ch = getchar())
    x = (x << 3) + (x << 1) + (ch ^ 48);
  x = (f) ? -x : x;
}
int main() {
  read(a);
  ans = 1e18;
  long long L = a - ans % a * 9 % a * 9 % a;
  long long R = L + ans - 1;
  printf("%lld %lld", L, R);
  return 0;
}
