#include <bits/stdc++.h>
using namespace std;
long long Mod = 1e18;
long long n;
signed main() {
  scanf("%lld", &n);
  long long L = n - (Mod % n * 9 % n * 9 % n) % n, R = (Mod + L - 1);
  printf("%lld %lld\n", L, R);
  return 0;
}
