For the relationship (A AND B) :
AB
For the relationship (A OR B) :
AB
For the relationship A AND (B AND (M OR N) AND Z) AND (E OR (P AND Q) OR S) AND F AND (G OR H OR I) :
ABMNZEPQSFGHI