Answer:
Super ego
Explanation:
According to Freudian psychoanalytic theory, our mind has 3 main structures which have different functions:
In the example, Greg is feeling very hungry but he realizes that leaving would disrupt the class and perhaps insult the speaker so he decides to wait. Greg is acting based on the social norms he has learned (it is rude to leave in the middle of a lecture). Thus, he would be acting according to his super-ego.
Therefore, Greg's mind has a highly developed super-ego