2522 - I2P(II)2022_Yang_lab4 Scoreboard

Time

2022/05/06 13:20:00 2022/05/06 15:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11417 String Operation

11417 - String Operation   

Description

Given a set of strings, perform the operations according to the following commands, and output the final result of the given set of strings.

 

Commands:

s n m: Swap the nth string and the mth string.

i n m: Insert the mth string at the tail of the nth string.

si n m: Swap the specified strings first, and then insert.

is n m: Insert first, and then swap the two specified strings.

e: Exit.

 

Consider a set of strings:

ab

cd

ef

And a sequence of commands:

s 0 1

i 1 2

The result will be:

cd

abef

ef

 

You will be provided with main.cpp and function.h, and asked to implement function.cpp.

Input

The first line is an integer N indicating the number of input strings.

The following N lines each contains one input string.

Starting from the N+2th line will be a sequence of commands.

Output

Output the final result of the input strings.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11417.cpp

Partial Judge Header

11417.h

Tags




Discuss