시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
0.2 초 256 MB 26 4 4 20.000%

문제

You have two strings and you need to check whether you can cut the second one into three pieces so that the first string can be concatenated from these three pieces.

입력

The input file contains two non-empty strings, each on a separate line. Each string consists of at most 5000 lowercase roman letters. Strings have the same length and each letter has the same number of occurrences in both strings.

출력

Print YES if it is possible to cut the string as described, and NO in the opposite case. If you print YES, the following three lines should contain the parts of the second string in the correct concatenation order. These parts cannot be empty. If you have several options to cut, print any of them.

예제 입력 1

beast
betas

예제 출력 1

YES
be
as
t

예제 입력 2

royalitem
romeitaly

예제 출력 2

NO