program prob1
    implicit none
    character(len=3)::S,T
    integer::l
    read(*,*) S
    l = len_trim(S)
    if(l == 2) then
        write(*,'(a)') trim(S)
    else
        T(1:1) = S(3:3)
        T(2:2) = S(2:2)
        T(3:3) = S(1:1)
        write(*,'(a)') trim(T)
    end if
    stop
end program