/**
 *    author:  tourist
 *    created: 04.11.2025 20:05:10
**/
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s, c;
  cin >> s >> c;
  int n = int(s.size());
  int m = int(c.size());
  for (int i = 1; i < n; i++) {
    int j = n - i;
    if (j + m - 1 <= i && i <= j + m) {
      cout << s.substr(0, i) << " " << s.substr(i) << '\n';
      break;
    }
  }
  return 0;
}
