#include <bits/stdc++.h>
using namespace std;
long long n, m = 1, l;
int main() {
  scanf("%I64d", &n);
  while (n > m) m *= 10, l++;
  long long w = m / 10, sm = 0;
  sm = 1;
  for (int i = 1; i <= l; i++) sm = (sm + 45 * w) % n;
  long long ans = (n - sm) % n;
  printf("%I64d %I64d\n", ans + 1, m + ans);
}
