program prob42
    implicit none
    character(3) :: s
    read(*,*) s
    if(len_trim(s) == 3)then
        write(*,'(a)') s(3:1:-1) 
    else
        write(*,'(a)') s
    end if

    stop
contains
end program prob42