#Lutece2875. Wordle Plus

Wordle Plus

Migrated from Lutece 2875 Wordle Plus

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Wordle 是 Josh Wardle 编写的网页文字游戏。在 Wordle 中,玩家要在一天内用六次机会内猜中某个由五个英文字母组成的词汇。每次尝试后,玩家可能得到三种反馈:绿色表示字母位置正确;黄色表示答案包含该字母但位置错误;灰色表示该字母出现次数多于答案中这个字母出现的次数。

一种改进版的 Wordle Plus 规则和 Wordle 差不多,也是绿色表示字母位置正确;黄色表示答案包含该字母但位置错误;灰色表示该字母出现次数多于答案中这个字母出现的次数。但是判断过程和 Wordle 有所区别。首先字母位置正确的一定会标为绿色,如果字母位置不对,并且该字母出现次数多于答案中这个字母出现的次数,这个位置标为灰色,否则标为黄色。

请你按上述规则实现 Wordle Plus 游戏的判断过程。

Input

第一行一个整数 T (1T104)T\ (1\le T\le 10^4),表示测试数据组数。

接下来 TT 组数据,对于每组数据有两行长度为 55 且只包含小写字母的字符串,第一行表示玩家猜测的单词,第二行表示正确答案。

Output

对于每组数据输出一行长度为 55 的字符串,表示判断结果。如果一个位置为绿色,则输出 g,如果为黄色,输出 y,如果为灰色,输出 x

Samples

4
teeth
earth
robot
tooth
favor
vague
apple
opera
xxxgg
xgxyy
xgyxx
ygxxy

Resources

The 20th UESTC Programming Contest Preliminary