program to reverse the strings