Alice's library
Practice
3 (41 votes)
Data structures
Basics of stacks
Stack
Trees
Stacks
Problem
67% Success 8184 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code

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 \le |s| \le 10^3\)

Note

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

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
40 votes
Tags:
ApprovedData StructuresMathMediumStacks
Points:30
12 votes
Tags:
QueuesBasics of QueuesBasics of StacksC++Data StructuresStacks
Points:30
34 votes
Tags:
StacksBasics of StacksData StructuresC++