#844
Silver III
KOLONE
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

When moving, ants form rows so that each ant except the first is behind another ant. It is not widely known what happens when two rows of ants moving in opposite directions run into each other in a passage too narrow for both rows to pass through. One theory says that, in that situation, ants will jump over each other.

From the moment the rows meet, each second every ant jumps over (or gets jumped over, as they agree upon) the ant in front of himself so that the two ants swap places, but only if the other ant is moving in the opposite direction. Find the order of the ants after T seconds.

입력

The first line contains two integers N1N_1 and N2N_2, the numbers of ants in the first and second rows, respectively.

The next two rows contain the orders of ants in the first and second row (first to last). Each ant is uniquely determined by an uppercase letter of the English alphabet (this letter is unique between both rows).

The last line of input contains the integer TT (0T500 \le T \le 50).

출력

Output the order of the ants after TT seconds on a single line. Our viewpoint is such that the first row of ants comes from our left side and the other one from our right side.

예제 입력 1

3 3
ABC
DEF
0

예제 출력 1

CBADEF

예제 입력 2

3 3
ABC
DEF
2

예제 출력 2

CDBEAF

예제 입력 3

3 4
JLA
CRUO
3

예제 출력 3

CARLUJO
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Silver III1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.