#include <bits/stdc++.h>
using namespace std;
string s1,a1,s2,a2;
int main(){
cin>>a1;
for (int i = 1; i < a1.size(); i++) {
if (a1[i] % 2 == a1[i-1] % 2) {
s1 += max(a1[i], a1[i-1]);
}
}
cin>>a2;
for (int i = 1; i < a2.size(); i++) {
if (a2[i] % 2 == a2[i-1] % 2) {
s2 += max(a2[i], a2[i-1]);
}
}
if(s1==s2)cout<<s1<<endl;
else cout<<s1<<endl<<s2<<endl;
return 0;
}