#include
#include
#include //不加这个cin >> s在vs2015提示出错
using namespace std;
int main()
{
string s, s2, s3;
int a[30], b[30], sum = 0, i = 0, j = 0;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
cin >> s;
cin >> s2;
//s = "ROBOTASIOXZ"; //调试用
//s2 = "ASIOXZROBOT";
for (i = 0; i < s.size(); i++)
a[s[i] - 'A'] = 1; // 设为1就好了,没必要累加然后再循环置为1
for (i = 0; i < s2.size(); i++)
b[s2[i] - 'A'] = 1; // 同上
for (i = 0; i < 26; i++)
{
if (a[i] && b[i]) // 都是1则路口数+1,并把路口编号加到s3末尾
{
sum++;
s3 += (i + 'A'); // s3[j]=(i+'A')会导致s3越界,因为s3原本是空串
}
}
if (sum == 0)
cout << "WuXiao" << endl;
else if (sum == 1)
{
cout << "ZhiHui" << endl;
cout << '1' << endl;
cout << s3 << endl; //只有一个路口,直接输出编号
}
else
{
cout << "XLuo" << endl;
cout << sum << endl;
for (i = 0; i < (s3.size() - 1); i++) //输出前序路口编号
cout << s3[i] << '-';
cout << s3[i] << endl; //输出最后一个路口编号
}
return 0;
}