I am trying to achieve the desired output as shown in the comment but what I get are:
(\'A\', \'B\')Z
Z(\'A\', \'B\')
(\'C\', \'B\')Z
Z(\'C\', \'B\')