PROGRAMMING:Duty arrangement
There are seven doctors in the hospital: A, B, C, D, e, F and g. each doctor should take turns to be on duty for one day in a week (Monday to Sunday)
(1) Doctor a is on duty one day later than doctor C;
(2) Doctor D was on duty one day later than doctor E;
(3) Doctor e is on duty two days earlier than doctor B
(4) Doctor B was on duty four days earlier than doctor G;
(5) Doctor f is on duty one day later than doctor B;
(6) Doctor f was on duty one day earlier than doctor C;
(7) Doctor f is on duty on Thursday.
It can be determined that the personnel on duty from Monday to Sunday are e, D, B, F, C, a and G.
Write a program, according to the input conditions, output Monday to Sunday on duty.
###Input format:
First input an integer n, and then input n groups of conditions. It is required that the unique duty table can be determined according to the input conditions, and the association relationship between any two doctors can be obtained directly or indirectly from the input n groups of conditions. For example, the above condition (2) directly shows the relationship between D and E, and the relationship between a and B can be obtained indirectly through conditions (1), (6), (5).
There are two input formats for conditions
Format 1: number comparison operator number days
There are two kinds of comparison operators: > or <, which indicate "early" or "late" respectively
For example, a < C1 means that doctor a is on duty one day later than doctor C
Format 2: number = value
Doctor f is on duty on Thursday
###Output format:
Output the shift sequence from Monday to Sunday.
###Input example:
```in
seven
ADE>B2
B>G4
FF>C1
F=4
```
###Output example:
```out
EDBFCAG
```
answer:If there is no answer, please comment
(1) Doctor a is on duty one day later than doctor C;
(2) Doctor D was on duty one day later than doctor E;
(3) Doctor e is on duty two days earlier than doctor B
(4) Doctor B was on duty four days earlier than doctor G;
(5) Doctor f is on duty one day later than doctor B;
(6) Doctor f was on duty one day earlier than doctor C;
(7) Doctor f is on duty on Thursday.
It can be determined that the personnel on duty from Monday to Sunday are e, D, B, F, C, a and G.
Write a program, according to the input conditions, output Monday to Sunday on duty.
###Input format:
First input an integer n, and then input n groups of conditions. It is required that the unique duty table can be determined according to the input conditions, and the association relationship between any two doctors can be obtained directly or indirectly from the input n groups of conditions. For example, the above condition (2) directly shows the relationship between D and E, and the relationship between a and B can be obtained indirectly through conditions (1), (6), (5).
There are two input formats for conditions
Format 1: number comparison operator number days
There are two kinds of comparison operators: > or <, which indicate "early" or "late" respectively
For example, a < C1 means that doctor a is on duty one day later than doctor C
Format 2: number = value
Doctor f is on duty on Thursday
###Output format:
Output the shift sequence from Monday to Sunday.
###Input example:
```in
seven
A
B>G4
F
F=4
```
###Output example:
```out
EDBFCAG
```
answer:If there is no answer, please comment