In medieval universities , the trivium comprised the three subjects that were taught first : grammar , logic and rhetoric .
These subjects were grammar , logic and rhetoric .