시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 217 33 22 21.569%

문제

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

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

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

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

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

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

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

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

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

입력

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

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

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

출력

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

예제 입력 1

weissblume
exupery
weeisxsbulupmerey

예제 출력 1

11211211211212212
W3sicHJvYmxlbV9pZCI6IjMyNTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMWNcdWNmNTRcdWI1MjkiLCJkZXNjcmlwdGlvbiI6IjxwPlx1Y2MzZFx1YzYwMVx1Yzc3NFx1YzY0MCBcdWFjMTVcdWMwYjBcdWM3NzRcdWIyOTQgXHVjMGMxXHVhZGZjXHVjNzc0XHVjNjQwIFx1YzgxNVx1Yzc3OFx1Yzc3NFx1YWMwMCBcdWQ1NThcdWIyOTQgJnF1b3Q7PGEgaHJlZj1cIlwvcHJvYmxlbVwvMzI1NFwiPlx1YjNkOVx1YzgwNCAyMVx1YWMxYzxcL2E+JnF1b3Q7XHVhYzhjXHVjNzg0XHViY2Y0XHViMmU0IFx1YjM1NCBcdWM3YWNcdWJiZjhcdWM3ODhcdWIyOTQgXHVhYzhjXHVjNzg0XHVjNzQ0IFx1ZDU1Y1x1YjJlNC4gXHViYzE0XHViODVjICZxdW90O1x1YmMxY1x1Yjg1YyBcdWQwYzBcdWM3OTBcdWNlNThcdWFlMzAmcXVvdDtcdWM3NzRcdWIyZTQuPFwvcD5cclxuXHJcblxyXG5cclxuPHA+XHVjNzc0IFx1YWM4Y1x1Yzc4NFx1Yzc0NCBcdWQ1NThcdWI4MjRcdWJhNzQgXHViYTNjXHVjODAwIFx1YWMwMVx1Yzc5MCBcdWIyZThcdWM1YjRcdWI5N2MgXHVjMGRkXHVhYzAxXHVkNTc0XHVjNTdjIFx1ZDU1Y1x1YjJlNC4gXHVhZGY4IFx1YjJlNFx1Yzc0YyBcdWFjMTlcdWM3NDAgXHVjZWY0XHVkNGU4XHVkMTMwIFx1YzU1ZVx1YzVkMCBcdWM1NDlcdWM3NDAgXHViNGE0LCBcdWNjM2RcdW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