#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const long long _ = 1e18;
signed main() {
  long long a = read(), q = (_ % a * 9 % a * 9 % a + 1) % a;
  printf("%lld %lld\n", a - q + 1, a - q + _);
  return 0;
}
