#include <bits/stdc++.h>
const unsigned long long int INF = 1e18;
int main() {
  unsigned long long int a;
  scanf("%I64d", &a);
  unsigned long long int res = INF / 10;
  res %= a;
  res *= 9;
  res %= a;
  res *= 5;
  res %= a;
  res *= 18;
  res %= a;
  unsigned long long int ans = a - res;
  printf("%I64d %I64d\n", ans, ans + INF - 1);
  return 0;
}
