program measure
  implicit none
  character(3) :: s
  read(*,*) s
  if (len_trim(s) == 2) then
    write(*,'(a)') trim(s)
    stop
  end if
  write(*,'(a,a,a)') s(3:3), s(2:2), s(1:1)
end program measure