2014 Mock CCC by Alex and Timothy
Alice's love potion failed because Bob overdosed. Now, her new tactic is
to impress Bob. Bob is a computer scientist who specializes in ropes. In
computer science, a rope is a data structure used for efficiently
manipulating strings. Bob has a rope of characters. However, it's too
long to fit in his pocket, so he folds it into ABRACADABRA
, when folded
AB|RACA|DAB|RA
, yields:
AR
DAB
ACAR
AB
Alice notices that Bob often gets a headache pulling the rope out of his pocket and spending a long time untangling it. She concludes that if she finds a way to unfold it for Bob, Bob will be so impressed that he can't help but fall madly in love with her. You must write a program to help Alice!
Input Specification
The first line of input will contain the positive integer
The entire unfolded rope will be no greater than A
to Z
.
Output Specification
The output should contain one line — the unfolded rope.
Sample Input 1
4
AR
DAB
ACAR
AB
Sample Output 1
ABRACADABRA
Sample Input 2
5
D
LRO
W
OL
HEL
Sample Output 2
HELLOWORLD
Comments