A parenthesis relation is a binary relation where if (x,y) is in the relation, then (y,x) is also in the…