string = list(input()) N = len(string) M = int(input()) cursor = N for _ in range(M): command = input().split() if command[0] == "L": if cursor > 0: cursor -= 1 elif command[0] == "D": if cursor 0: string.pop(cursor-1) cursor -= 1 elif command[0] == "P": string.insert(cursor, command[1]) cursor += 1 for s in string: print(s, end='') 처음에 위와 같..