#include using namespace std; #define int long long signed main(){ int N; cin>>N; string S,T; cin>>S>>T; if(S[0] != T[0] || S[N-1] != T[N-1]){ cout<<-1< s = {}, t = {}; for(int i=0;i