TOKI | 프로그래밍의 벗 PivotOJ
PivotOJ

TOKI

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2003 National Competition #2 - SeniorsBOJ 3244

문제

Substring of some string A is defined as one of more (not necessary succeeding) elements of the string with maintaining the sequence. 

There are given two strings, string VOKI and string TOKI. 

Write the program that will calculate any shortest substring of string VOKI such as it is not substring of string TOKI. 

입력

In first line of input file there is string VOKI and in second one is string TOKI. 

The only characters that will occur are lowercase characters of English alphabet (‘a’- ‘z’). String lengths will be less or equal to 2000. 

Note: input will be such so there will always be a solution. 

출력

In the first line of file you should print the length of wanted substring, and in the second line you should print any valid substring from the text of the problem. 

예제

예제 1

입력
ababaa
abbaa
출력
3
bab

예제 2

입력
babab
babba
출력
3
aab

예제 3

입력
banana
anbnaanbaan
출력
5
banna
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.