[Softeer] [한양대 HCPC 2023] X marks the Spot (Python)

2024. 3. 22. 11:40알고리즘

 

 

import sys
input = sys.stdin.readline

N = int(input())
answer = []
for _ in range(N):
    S, T = map(str, input().split())
    for i, s in enumerate(S):
        if s == 'x' or s == 'X':
            answer.append(T[i].upper())
            break

print(''.join(answer))