#include <bits/stdc++.h>
using namespace std;
const int N = 1125;
int main() {
  int n, m;
  cin >> n >> m;
  string a = "";
  int rem = n;
  while (rem > 0) {
    int x = min(rem, 9);
    a += (char)(x + '0');
    rem -= x;
  }
  string b = "";
  int sum = 0;
  for (int i = a.size() - 1; i >= 0; --i) {
    int val = (int)(a[i] - '0');
    if (i < a.size() - 1) val++;
    int req = !val ? 0 : 10 - val;
    b += (char)(req + '0');
    sum += req;
  }
  while (sum < n) {
    b += '9';
    sum += 9;
  }
  reverse(b.begin(), b.end());
  cout << a << ' ' << b << endl;
  return 0;
}
