#include <bits/stdc++.h>
using namespace std;
const long long mxn = 1e18;
int main() {
  long long a;
  scanf("%lld", &a);
  long long l = a - mxn % a * 9 % a * 9 % a;
  long long r = l + mxn - 1;
  cout << l << " " << r << endl;
}
