#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
using namespace std;
int main() {
  long long a;
  scanf("%I64d", &(a));
  long long l = a - (9 * ((INF * 9) % a)) % a;
  printf("%I64d %I64d\n", l, INF + l - 1);
  return 0;
}
