2402: Troublesome Keys

Memory Limit:128 MB Time Limit:1.000 S
Creator:
Submit:50 Solved:0

Description

As Alex is typing, their keyboard is acting strangely. Two letter keys are causing trouble: 
• One letter key displays the same wrong letter each time it is pressed. Alex calls this key the silly key. Oddly, Alex never actually tries to type the wrong letter displayed by the silly key. 
• Another letter key doesn’t display anything when it is pressed. Alex calls this key the quiet key. 
Alex presses the silly key at least once but they don’t necessarily press the quiet key. Your job is to determine the troublesome keys and the wrong letter that is displayed. Luckily, this is possible because Alex never presses the silly key immediately after pressing the quiet key and Alex never presses the quiet key immediately after pressing the silly key.

当Alex正在打字时,他们的键盘表现得很奇怪。两个字母键引起了麻烦:

  • 一个字母键每次被按下时都显示同一个错误的字母。Alex称这个键为愚蠢键。奇怪的是,Alex从未真正尝试打出愚蠢键所显示的错误字母。
  • 另一个字母键按下时不显示任何东西。Alex称这个键为静音键。
Alex至少按了一次愚蠢键,但不一定按静音键。 你的任务是确定引起麻烦的键和显示的错误字母。幸运的是,这是可能的,因为Alex从不会在按静音键之后立即按愚蠢键,也不会在按愚蠢键之后立即按静音键。

Input

There will be two lines of input. The first line of input represents the N keys Alex presses on the keyboard. 
The second line of input represents the letters displayed on the screen. 
Both lines of input will only contain lowercase letters of the alphabet. 
将有两行输入。第一行输入代表Alex在键盘上按下的N个键。
第二行输入代表屏幕上显示的字母。
两行输入都只包含字母表中的小写字母。

Output

There will be two lines of output.
On the first line, output the letter corresponding to the silly key and the wrong letter displayed on the screen when it is pressed, separated by a single space. 
On the second line, output the letter corresponding to the quiet key if it is pressed. Output the dash character (-) if the quiet key is not pressed.
将有两行输出。
在第一行上,输出对应愚蠢键的字母和按下时屏幕上显示的错误字母,中间用一个空格分隔。 

在第二行上,如果按下了静音键,则输出对应静音键的字母。如果没有按静音键,则输出短划线字符(-)。

Sample Input

forloops
fxrlxxp

Sample Output

o x
s

HINT

 对应愚蠢键的字母是字母o。每次按下时,显示的错误字母是x。静音键对应的字母是s,没有显示出来。
数据范围: N ≤ 500 000 

Source/Category