///////////////////////////////    _LeMur_
#define _CRT_SECURE_NO_WARNINGS
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <complex>
#include <cassert>
#include <cfloat>
#include <memory>
#include <chrono>
#include <random>
#include <climits>
#include <limits>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <stack>
#include <tuple>
#include <queue>
#include <ctime>
#include <cmath>
#include <list>
#include <map>
#include <set>

using namespace std;

const int N = 1000005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
// mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
mt19937 myrand(373);

string s;
string c;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> s >> c;

  for (int i = 0; i < (int)s.size(); i++) {
    int len_a = i + 1;
    int len_c = (int)c.size();
    int len_b = (int)s.size() - len_a;

    if (len_a == len_b + len_c - 1 || len_a == len_b + len_c) {
      for (int j = 0; j <= i; j++) cout << s[j];
      cout << " ";
      for (int j = i + 1; j < (int)s.size(); j++) cout << s[j];
      cout << endl;
      break;
    }
  }
  return 0;
}
