#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int test = n / 5;
  int x = n % 5;
  if (x == 0) x = 5;
  int flag = 0;
  if (test * 4 + 10 - x < n) {
    flag = n - (test * 4 + x);
    flag = (flag / 8) + 1;
  }
  for (int i = 0; i < flag; i++) cout << "1";
  for (int i = 0; i < n / 5; i++) cout << "5";
  cout << x << endl;
  for (int i = 0; i < flag; i++) cout << "8";
  for (int i = 0; i < n / 5; i++) cout << "4";
  cout << 10 - x << endl;
  return 0;
}
