Reverse a linked list with keeping the special character intact

tough

#1

You have given a linked list
input
a->b->;->$->c->^->d or a->b->SP1->SP2->c->SP3->d

[SP1, SP2, SP3 are any unique special character ]

output
d->c->;->$->b->^->a or d->c->SP1->SP2->b->SP3->a