#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
const long long INF = 1e18;
int main() {
  long long a, s;
  while (scanf("%I64d", &a) != EOF) {
    long long s = INF / 10;
    s = s * 5 % a;
    s = s * 9 % a;
    s = s * 9 % a;
    s = s * 2 % a;
    long long ans = a - s % a;
    printf("%I64d %I64d\n", ans, INF + ans - 1);
  }
  return 0;
}
