시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 220 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+XHVjNzc0IFx1YWM4Y1x1Yzc4NFx1Yzc0NCBcdWQ1NThcdWI4MjRcdWJhNzQgXHViYTNjXHVjODAwIFx1YWMwMVx1Yzc5MCBcdWIyZThcdWM1YjRcdWI5N2MgXHVjMGRkXHVhYzAxXHVkNTc0XHVjNTdjIFx1ZDU1Y1x1YjJlNC4gXHVhZGY4IFx1YjJlNFx1Yzc0YyBcdWFjMTlcdWM3NDAgXHVjZWY0XHVkNGU4XHVkMTMwIFx1YzU1ZVx1YzVkMCBcdWM1NDlcdWM3NDAgXHViNGE0LCBcdWNjM2RcdWM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