#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 1ll << 60;
const double PI = acos(-1.0);
int n, m;
long long pw[19];
long long sum[20];
long long calc(long long x) {
  if (x == 0) return 0;
  return 45ll * x * pw[x - 1];
}
long long find(long long k) {
  long long x, y;
  int num[20];
  int m = 0;
  while (k) {
    num[m] = k % 10;
    m++;
    k /= 10;
  }
  long long res = 0;
  long long cnt = 0;
  for (int i = 0; i < m; i++) {
    if (num[i]) {
      res += calc(i) * num[i];
      res += sum[num[i] - 1] * pw[i];
      res += num[i] * (cnt + 1);
    }
    cnt += num[i] * pw[i];
  }
  return res;
}
int main() {
  pw[0] = 1;
  pw[1] = 10;
  sum[0] = 0;
  sum[1] = 1;
  for (int i = 2; i <= 19; i++) pw[i] = pw[i - 1] * 10, sum[i] = sum[i - 1] + i;
  long long x, y;
  long long a;
  while (~scanf("%I64d", &a)) {
    long long l = 0, r = 100000000000000000LL;
    long long ansl, ansr;
    long long mid;
    while (l < r) {
      mid = (l + r) >> 1;
      if (find(mid) >= a)
        r = mid;
      else
        l = mid + 1;
    }
    ansl = 1;
    ansr = l;
    x = find(ansl - 1);
    y = find(ansr);
    while (y - x != a) {
      if (y - x > a)
        ansl++;
      else
        ansr++;
      x = find(ansl - 1);
      y = find(ansr);
    }
    printf("%I64d %I64d\n", ansl, ansr);
  }
  return 0;
}
