시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB438654624.731%

문제

창영이와 강산이는 상근이와 정인이가 하는 "동전 21개"게임보다 더 재미있는 게임을 한다. 바로 "발로 타자치기"이다.

이 게임을 하려면 먼저 각자 단어를 생각해야 한다. 그 다음 같은 컴퓨터 앞에 앉은 뒤, 창영이는 왼쪽에 앉고, 강산이는 오른쪽에 앉는다.

이제 창영이는 키보드를 바닥에 내려놓고 창영이는 오른발로, 강산이는 왼발로 각자 생각한 단어를 치기 시작한다.

이때, 창영이와 강산이는 서로 번갈아가면서 자신의 단어를 치는데, 꼭 한 글자만 칠 필요는 없다.

이 게임을 같이 하고 싶었지만, 같이 할 친구가 없어서 구경만 하고 있던 선영이는 창영이와 강산이가 번갈아가면서 작성한 단어를 보고, 각 문자를 어떤 사람이 쳤는지 알아내려고 한다.

예를 들어, 창영이가 "weissblume", 강산이가 "exupery"를 생각했고, 서로 번갈아가면서 적절히 타자를 쳐서 화면에 "weeisxsbulupmerey"를 입력했다고 하자.

그럼 선영이는 이 단어를 보고 "11211211211212212" 라고 말할 것이다. 이 뜻은, 1은 창영이가 입력한 알파벳, 2는 강산이가 입력한 알파벳이라는 뜻이다.

항상 창영이와 강산이는 단어를 순서대로 입력한다. 중간에 빼먹고 치지 않는 단어는 없고, 취미생활로 발로 10년동안 타자를 쳤으므로 오타가 발생하지 않는다.

창영이와 강산이가 생각한 단어, 그리고 컴퓨터에 입력한 단어가 주어졌을 때, 각 알파벳을 입력한 사람이 누군지 구하는 프로그램을 작성하시오.

입력

첫째 줄에는 창영이가 생각한 단어, 둘째 줄에는 강산이가 생각한 단어가 주어진다. 이 단어는 알파벳 소문자로 이루어져 있고, 길이는 최대 150이다.

셋째 줄에는 화면에 입력한 단어가 주어진다.

항상 답이 존재하는 경우만 입력으로 주어진다.

출력

첫째 줄에 각 알파벳을 누가 입력했는지를 1 또는 2로 출력한다. 즉, 1로 표시한 위치의 알파벳만 읽으면 창영이가 생각한 단어, 2로 표시한 위치만 읽으면 강산이가 생각한 단어와 같아야 한다. 정답이 여러 개 존재할 수도 있고, 아무거나 출력하면 된다.

예제 입력 1

weissblume
exupery
weeisxsbulupmerey

예제 출력 1

11211211211212212

예제 입력 2

novine
vesna
novesvinena

예제 출력 2

11222111122

예제 입력 3

tata
mama
mtatamaa

예제 출력 3

21112212

예제 입력 4

hsin
sinh
hsinhsin

예제 출력 4

12222111
W3sicHJvYmxlbV9pZCI6IjMyNTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMWNcdWNmNTRcdWI1MjkiLCJkZXNjcmlwdGlvbiI6IjxwPlx1Y2MzZFx1YzYwMVx1Yzc3NFx1YzY0MCBcdWFjMTVcdWMwYjBcdWM3NzRcdWIyOTQgXHVjMGMxXHVhZGZjXHVjNzc0XHVjNjQwIFx1YzgxNVx1Yzc3OFx1Yzc3NFx1YWMwMCBcdWQ1NThcdWIyOTQgJnF1b3Q7PGEgaHJlZj1cIlwvcHJvYmxlbVwvMzI1NFwiPlx1YjNkOVx1YzgwNCAyMVx1YWMxYzxcL2E+JnF1b3Q7XHVhYzhjXHVjNzg0XHViY2Y0XHViMmU0IFx1YjM1NCBcdWM3YWNcdWJiZjhcdWM3ODhcdWIyOTQgXHVhYzhjXHVjNzg0XHVjNzQ0IFx1ZDU1Y1x1YjJlNC4gXHViYzE0XHViODVjICZxdW90O1x1YmMxY1x1Yjg1YyBcdWQwYzBcdWM3OTBcdWNlNThcdWFlMzAmcXVvdDtcdWM3NzRcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlx1Yzc3NCBcdWFjOGNcdWM3ODRcdWM3NDQgXHVkNTU4XHViODI0XHViYTc0IFx1YmEzY1x1YzgwMCBcdWFjMDFcdWM3OTAgXHViMmU4XHVjNWI0XHViOTdjIFx1YzBkZFx1YWMwMVx1ZDU3NFx1YzU3YyBcdWQ1NWNcdWIyZTQuIFx1YWRmOCBcdWIyZTRcdWM3NGMgXHVhYzE5XHVjNzQwIFx1Y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