#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 50, inf = 1e18, mod = 1024523;
inline long long read() {
  char c = getchar();
  long long ans = 0, f = 0;
  for (; c < '0' || c > '9'; c = getchar()) f = (c == '-');
  for (; c >= '0' && c <= '9'; c = getchar()) (ans *= 10) += c - '0';
  return f ? -ans : ans;
}
inline void chkmax(long long &x, long long y) { x = x > y ? x : y; }
inline void chkmin(long long &x, long long y) { x = x < y ? x : y; }
inline long long max(long long x, long long y) { return x > y ? x : y; }
inline long long min(long long x, long long y) { return x < y ? x : y; }
long long calc(long long x) {
  long long ans = 0;
  for (; x; x /= 10) ans += x % 10;
  return ans;
}
unsigned long long tot = 45, add = 45;
unsigned long long l = 1, r = 1e18;
int main() {
  unsigned long long a = read();
  for (long long i = (2), upnum = (18); i <= upnum; i++) {
    (tot += add) *= 10;
    add *= 10;
    tot %= a;
    add %= a;
  }
  (tot += 1) %= a;
  cout << (l + a - tot) << " " << (r + a - tot) << endl;
  return 0;
}
