Grammatical similarity of Q codes and UI/COI