Alice's library

3

41 votes
Data Structures, Basics of Stacks, Stack, Trees, Stacks
Problem

Alice is rearranging her library. She takes the innermost shelf and reverses the order of books. She breaks the walls of the shelf. In the end, there will be only books and no shelf walls. Print the order of books.

Opening and closing walls of shelves are shown by '/' and '\' respectively whereas books are represented by lower case alphabets.

Input format

The first line contains string s displaying her library.

Output format

Print only one string displaying Alice's library after rearrangement.

Constraints

2|s|103

Note

The first character of the string is '/' and the last character of the string is '\' indicating outermost walls of the shelf. 

Sample Input
/u/love\i\
Sample Output
iloveu
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

/u/love\i\

Here Katrina breaks the inner most shelf and reverse the order. So the library will be  /uevoli\ . 

Now she breaks the outermost wall and reverses the order. So the library will be iloveu.

Editor Image

?