Problem list
Log in
#icpc00143 · ICPC NWERC 2020

Keyboardd

Bronze I 5.0 s 2048 MB

Oh no! Joanna just spilled some syrup on her keyboard and now some of the keys are sticky. This causes her considerable frustration, as every time she presses one of the sticky keys, the corresponding character gets entered twice on her computer.

This could not have happened at a more inconvenient time; it is the start of the contest and she was just about to type in the solution to the first problem! Joanna does not have time to remove and clean every key on her keyboard, so she wonders if there is a way to quickly identify the sticky keys. Starting to panic, she quickly types some text on her keyboard and stares at the resulting text displayed on her screen.

Given the line of text that Joanna typed on her keyboard and the resulting text displayed on her screen, help her determine which keys must be sticky.

Input

The input consists of:

  • One line containing a string $s$ ($1 \leq \mathrm{length}(s) \leq 1,000$), the text that Joanna typed on her keyboard.
  • One line containing a string $t$ ($1 \leq \mathrm{length}(t) \leq 1,000$), the text displayed on Joanna's screen as a result.

Both $s$ and $t$ consist only of lower-case letters ('a'–'z') and spaces (' '), and start and end with a letter.

It is guaranteed that $t$ is the result of doubling each character in $s$ that corresponds to a sticky key. At least one character in $s$ corresponds to a sticky key (i.e. $s \neq t$).

Output

Output all characters (letters and space) corresponding to keys that must be sticky, in any order.

Example 1

Input
this is very annoying
thiss iss veery annoying
Output
se

Example 2

Input
so sticky
ssoo  ssttiicckkyy
Output
its yock
Source
ICPC NWERC 2020
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code