#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 50;
const long long mod = 1e9 + 7;
long long x = 1e18;
int main() {
  long long a;
  cin >> a;
  long long l, r;
  l = a - x % a * 9 % a * 9 % a;
  r = x + l - 1;
  cout << l << " " << r << endl;
  return 0;
}
