The middle ages in Europe were pretty terrible. Politically, kings ruled directly over groups of people, or over whole countries. The kings answered to the Pope generally. Economically, the kings and their nobles owned most of the profits of hard labor, while the townspeople after were treated to low wages. A sizable gap between classes was seen economically, and there was little room for changes in a persons economic class. Socially, the structure went like this: beggars and thieves, serfs (or non land owning peasants), knights, nobles and bishops, kings, the Pope.
I'll first explain what the non-aggression pact was. It was an agreement that the Soviet Union and Germany would take no military action against each other. To answer your question it is B. The pact was to make sure he could safely attack Poland.