program yukicoder_2314 use, intrinsic :: iso_fortran_env implicit none integer(int32) :: n character(len=8) :: s read(input_unit, *) s n = len_trim(s) if (s(n:n) == "0") then s(n:n) = "1" else s(n:n) = "0" end if write(output_unit, '(a)') trim(s) end program yukicoder_2314