#include <bits/stdc++.h>
using namespace std;
long long M = 1e17, a;
int main() {
  scanf("%I64d", &a);
  long long x = (a - 9 * (5 * (18 * M % a) % a) % a - 1 + a) % a;
  cout << x + 1 << " " << 10 * M + x << '\n';
  return 0;
}
