P6994 [NEERC 2014] Joke with permutation
Description
Joey had saved a permutation of integers from $1$ to $n$ in a text file. All the numbers were written as decimal numbers without leading spaces.
Then Joe made a practical joke on her: he removed all the spaces in the file.
Help Joey to restore the original permutation after the Joe's joke!
Input Format
The input file contains a single line with a single string -- the Joey's permutation without spaces.
The Joey's permutation had at least $1$ and at most $50$ numbers.
Output Format
Write a line to the output file with the restored permutation. Don’t forget the spaces!
If there are several possible original permutations, write any one of them.
Explanation/Hint
Time limit: 1 s, Memory limit: 256 MB.
Thanks to checker provider:@[Arcturus1350
](/user/57699).