#P7606. [THUPC 2021] 混乱邪恶

[THUPC 2021] 混乱邪恶

Description

Each problem setter has a Lawfulness index LL and a Goodness index GG. For an idea, from the perspective of the statement, samples, or constraints, you must choose exactly one of the 66 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 nn ideas. You know how your LL index and GG index change when you assign a certain style to each idea. Specifically, for the ii-th idea, there are 1212 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 LL becomes L+tli,lL+tl_{i,l}, and GG becomes G+tli,gG+tl_{i,g}.

If you choose “ordinary and useless samples”, then LL becomes L+li,lL+l_{i,l}, and GG becomes G+li,gG+l_{i,g}.

If you choose “loose constraints”, then LL becomes L+bli,lL+bl_{i,l}, and GG becomes G+bli,gG+bl_{i,g}.

If you choose “a complex statement”, then LL becomes L+bri,lL+br_{i,l}, and GG becomes G+bri,gG+br_{i,g}.

If you choose “selfless gifted samples”, then LL becomes L+ri,lL+r_{i,l}, and GG becomes G+ri,gG+r_{i,g}.

If you choose “super super super loose constraints”, then LL becomes L+tri,lL+tr_{i,l}, and GG becomes G+tri,gG+tr_{i,g}.

All additions here are performed modulo pp.

The requirements to enter the Chaotic Evil alignment are very strict: LL must be exactly equal to LL^* and GG must be exactly equal to GG^*.

Initially, both your LL index and GG index are 00. Determine whether there exists a way to assign styles such that after assigning styles to all nn 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,pn,p.

The next nn lines each contain 1212 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,GL^*,G^*.

Output Format

If possible, output one line Chaotic Evil.

If not possible, output one line Not a true problem setter.

3 10
3 5 1 4 9 3 0 0 0 0 0 0
0 0 0 0 0 0 3 5 1 4 9 3
3 5 1 4 9 3 3 5 1 4 9 3
3 2

Chaotic Evil

Hint

Sample Explanation

Assign the style “a concise statement” to the 11-st idea. Then your Lawfulness index becomes 0+3=30+3=3 and your Goodness index becomes 0+5=50+5=5. You move one step to the upper-left.

Assign the style “loose constraints” to the 33-rd idea. Then your Lawfulness index becomes 3+9=23+9=2 and your Goodness index becomes 5+3=85+3=8. You move one step to the lower-left.

Assign the style “selfless gifted samples” to the 22-nd idea. Then your Lawfulness index becomes 2+1=32+1=3 and your Goodness index becomes 8+4=28+4=2. You move one step to the right. Now you are back at the origin, and your Lawfulness index is 33 and your Goodness index is 22. Therefore, you can enter the Chaotic Evil alignment.

Constraints

It is guaranteed that 1n1001 \le n \le 100 and 1p1001 \le p \le 100.

It is guaranteed that all other input data are between 00 and p1p-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.

Translated by ChatGPT 5