#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>

using namespace std;

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    string s,c;
    cin >> s >> c;
    for (int i = 0; i < s.size()-1; ++i) {
        int a = i+1;
        int b = s.size()-1-i;
        if (a >= b + c.size() - 1 && a < b + c.size() + 1) {
            cout << s.substr(0,a) << ' ' << s.substr(a);
            return 0;
        }
    }
}