input = gets input.split('').reverse_each { |i| print i if i != "\n" } puts ""