P7606 [THUPC 2021] Chaotic Evil
Background
Problem setters are divided into $9$ alignments: Lawful Good, Lawful Neutral, Lawful Evil, Neutral Good, True Neutral, Neutral Evil, Chaotic Good, Chaotic Neutral, and Chaotic Evil. A true problem setter must be able to switch between alignments constantly without getting lost in the realm.
The realm is an infinitely large triangular grid. The grid is shown in the figure below. Each intersection point has $6$ adjacent intersection points. You start from some intersection point, and each time you assign a style to a problem-setting idea, you move one step in the realm.

Description
Each problem setter has a Lawfulness index $L$ and a Goodness index $G$. For an idea, from the perspective of the statement, samples, or constraints, you must choose exactly one of the $6$ directions as the unique style of the problem corresponding to this idea, and you will move one step in the realm along the selected arrow direction:

Now you have a total of $n$ ideas. You know how your $L$ index and $G$ index change when you assign a certain style to each idea. Specifically, for the $i$-th idea, there are $12$ parameters $tl_{i,l},tl_{i,g},l_{i,l},l_{i,g},bl_{i,l},bl_{i,g},br_{i,l},br_{i,g},r_{i,l},r_{i,g},tr_{i,l},tr_{i,g}$:
If you choose “a concise statement”, then $L$ becomes $L+tl_{i,l}$, and $G$ becomes $G+tl_{i,g}$.
If you choose “ordinary and useless samples”, then $L$ becomes $L+l_{i,l}$, and $G$ becomes $G+l_{i,g}$.
If you choose “loose constraints”, then $L$ becomes $L+bl_{i,l}$, and $G$ becomes $G+bl_{i,g}$.
If you choose “a complex statement”, then $L$ becomes $L+br_{i,l}$, and $G$ becomes $G+br_{i,g}$.
If you choose “selfless gifted samples”, then $L$ becomes $L+r_{i,l}$, and $G$ becomes $G+r_{i,g}$.
If you choose “super super super loose constraints”, then $L$ becomes $L+tr_{i,l}$, and $G$ becomes $G+tr_{i,g}$.
All additions here are performed modulo $p$.
The requirements to enter the Chaotic Evil alignment are very strict: $L$ must be exactly equal to $L^*$ and $G$ must be exactly equal to $G^*$.
Initially, both your $L$ index and $G$ index are $0$. Determine whether there exists a way to assign styles such that after assigning styles to all $n$ ideas, you are still at the original position in the realm, and you can enter the Chaotic Evil alignment.
Input Format
The first line contains two positive integers $n,p$.
The next $n$ lines each contain $12$ non-negative integers $tl_{i,l},tl_{i,g},l_{i,l},l_{i,g},bl_{i,l},bl_{i,g},br_{i,l},br_{i,g},r_{i,l},r_{i,g},tr_{i,l},tr_{i,g}$. The order of the parameters is the same as in the problem description, and no additional checking is needed.
The last line contains two non-negative integers $L^*,G^*$.
Output Format
If possible, output one line `Chaotic Evil`.
If not possible, output one line `Not a true problem setter`.
Explanation/Hint
**Sample Explanation**
Assign the style “a concise statement” to the $1$-st idea. Then your Lawfulness index becomes $0+3=3$ and your Goodness index becomes $0+5=5$. You move one step to the upper-left.
Assign the style “loose constraints” to the $3$-rd idea. Then your Lawfulness index becomes $3+9=2$ and your Goodness index becomes $5+3=8$. You move one step to the lower-left.
Assign the style “selfless gifted samples” to the $2$-nd idea. Then your Lawfulness index becomes $2+1=3$ and your Goodness index becomes $8+4=2$. You move one step to the right. Now you are back at the origin, and your Lawfulness index is $3$ and your Goodness index is $2$. Therefore, you can enter the Chaotic Evil alignment.
**Constraints**
It is guaranteed that $1 \le n \le 100$ and $1 \le p \le 100$.
It is guaranteed that all other input data are between $0$ and $p-1$.
**Source**
From the 2021 Tsinghua University Student Programming Contest and Collegiate Invitational (THUPC2021).
Resources such as editorials can be found at [https://github.com/yylidiw/thupc_1/tree/master](https://github.com/yylidiw/thupc_1/tree/master).
Translated by ChatGPT 5