Find all positive integer $n\ge 3$ such that it is possible to mark the vertices of a regular $n$- gon with the number from 1 to n so that for any three vertices $A, B$ and $C$ with $AB = AC$, the number in $A$ is greater or smaller than both numbers in $B, C$.
Problem
Source: 2021 Saudi Arabia Training Lists p28 https://artofproblemsolving.com/community/c2758131_2021_saudi_arabia_training_tests
Tags: combinatorics, regular polygon