Andriy and Olesya take turns (Andriy starts) in a $2 \times 1$ rectangle, drawing horizontal segments of length $2$ or vertical segments of length $1$, as shown in the figure below. After each move, the value $P$ is calculated - the total perimeter of all small rectangles that are formed (i.e., those inside which no other segment passes). The winner is the one after whose move $P$ is divisible by $2021$ for the first time. Who has a winning strategy? Proposed by Bogdan Rublov
Problem
Source: Kyiv City MO 2021 Round 1, Problem 7.2
Tags: game, combinatorics, cutting, geometry, rectangle