Operation with binary strings
Source: All-Russian MO 2023 Final stage 9.2
April 23, 2023
combinatorics
Problem Statement
Initially, a word of letters with letters and letters is written on a blackboard. In each operation, we may choose a contiguous string of any length with equal number of letters and equal number of letters , reverse those letters and then swap each with and each with (Example: after the operation becomes ). Decide if it possible to choose initial word, so that after some operations, it will become the same as the first word, but in reverse order.