#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const int N = 1e5 + 7;
const long long INF = 0x3ffffffffffLL;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;
int gao(long long x) {
  int ret = 0;
  while (x) ret += (x % 10), x /= 10;
  return ret;
}
long long calc(long long x) {
  long long ret = 0, l, po = 1, r = 0;
  while (x) {
    l = x / 10;
    ret += l * 45 * po;
    long long digit = x % 10;
    ret += (digit - 1) * digit / 2 * po;
    ret += digit * (r + 1);
    r = r + digit * po;
    x /= 10;
    po *= 10;
  }
  return ret;
}
long long n;
int main() {
  long long l = 0, r = 20000000000000000;
  cin >> n;
  bool flag = false;
  while (l < r) {
    long long mid = l + r >> 1;
    long long temp = calc(mid);
    if (temp < n)
      l = mid + 1;
    else if (temp > n)
      r = mid;
    else {
      cout << 1 << ' ' << mid << endl;
      return 0;
    }
  }
  long long tot = calc(l);
  r = l;
  l = 1;
  while (1) {
    if (tot < n)
      r++, tot += gao(r);
    else if (tot > n)
      tot -= gao(l), l++;
    else {
      cout << l << ' ' << r << endl;
      return 0;
    }
  }
}
