Suppose you want to fill the edges of an $n \times n$ square grid using the following shapes:

Here is an example for $n=3$:
The problem was to prove that the number of $B$'s is equal to $C$'s.
While trying to prove this, I observed that in every diagonal with slope $-1$, (diagonals that pass through $\{3\}, \{2, 6\}, \{1 ,5 , 9\}, \{4, 8\}, \{7\}$) number of $B$'s and $C$'s are equal.
Even more surprising, their order of appearance (starting from the top) always makes a valid parentheses syntax. for example, in $\{1,5,9\}$, black $B$, green $C$, brown $B$ and blue $C$, form $$\Large ()()$$
I also observed that the same is true for $A$'s and $D$'s in diagonals with slope $1$.
I solved the original problem, however, was unable to prove any of my further observations. I would appreciate any suggestions.
