str = gets.chomp if str[-1] == "0" str[-1] = "1" else str[-1] = "0" end puts str