Back
Close

Redivider

Statement
Reorder the [[phrase]] to form a <<palindrome>> which reads the same forward and backward.

Input description
<<Line 1:>> The [[number]] of words. <<Line 2:>> Every [[word]], separated by spaces.

Output description
<<Line 1:>> The reordered [[phrase]].

Constraints
1 < [[number]] of words < 10 Each [[word]] in the [[phrase]] is unique. Lowercase letters only, no punctuation.

Game modes
Fastest, Shortest

Test cases
Test 1 Test
Input
4 geese god see do
Output
do geese see god

Validator 1 Validator
Input
4 ussgs gss ucr rc
Output
rc ussgs gss ucr

Test 2 Test
Input
6 ate owl metal mr my worm
Output
mr owl ate my metal worm

Validator 2 Validator
Input
6 af am ashoz ckz kcfa ohs
Output
af ckz ohs am ashoz kcfa

Test 3 Test
Input
7 de des iamais lame mal nuse uns
Output
lame des uns iamais nuse de mal

Validator 3 Validator
Input
7 crdv drc eljv lej uv uvj zrdrzj
Output
crdv uvj lej zrdrzj eljv uv drc

Test 4 Test
Input
7 da dama jezom jutro moze ta tortu
Output
moze jutro ta dama da tortu jezom

Validator 4 Validator
Input
7 dk dybde nk nkwk tojyw tedby wyjo
Output
wyjo tedby dk nkwk nk dybde tojyw

Test 5 Test
Input
4 even odd or never
Output
never odd or even

Validator 5 Validator
Input
4 fwfo ofwfs pee ps
Output
ofwfs pee ps fwfo

Test 6 Test
Input
5 interpret memos men nine some
Output
some men interpret nine memos

Validator 6 Validator
Input
5 nsyjwuwjy rjrtx rjs xtrj snsj
Output
xtrj rjs nsyjwuwjy snsj rjrtx

Solution language

Solution

Stub generator input