#include using namespace std; #define int long long #define rep(i,n) for(int i=0;i=0;i--) #define all(v) v.begin(),v.end() #define P pair #define len(s) (int)s.size() template inline bool chmin(T &a, T b){ if(a>b){a=b;return true;} return false; } template inline bool chmax(T &a, T b){ if(asetS,setT; rep(i,1<>j&1)now+=S[j]; } setS.insert(now); } rep(i,1<>j&1)now+=T[j]; } setT.insert(now); } for(string s:setS){ if(setT.find(s)==setT.end()){ cout<>S>>T; assert(len(S)<=100000&&len(T)<=100000); if(len(S)<=18&&len(T)<=18)solvesmall(); else { int cnt1=0,cnt2=0; rep(i,len(S))cnt1+=S[i]=='a'; rep(i,len(T))cnt2+=S[i]=='a'; if(cnt1<=cnt2){ cout<<"-1"<