Poland's population was ethnically non-Polish and many felt their own nationhood aspirations thwarted specifically by Poland, large segments of this population resisted to varying extents the policies intended to assimilate them. Part of the country's leadership emphasized the need for the ethnic and cultural homogeneity of the state in the long term. However, the promotion of the Polish language in administration, public life and especially education, were perceived by some as an attempt at forcible homogenization. In areas inhabited by ethnic Ukrainians for example, actions of the Polish authorities seen as aiming at restricting the influence of the Orthodox and the Ukrainian Greek Catholic Church caused additional resentment and were considered to be closely tied to religious Polonization. Medieval Poland Between the 12th and the 14th centuries, many towns in Poland adopted the so-called Magdeburg rights that promoted the towns' development and trade. The rights were usually granted by the king on the occasion of the arrival of migrants. Some integrated with the larger community, such as merchants who settled there, especially Greeks and Armenians. They adopted most aspects of Polish culture but kept their Orthodox faith. Since the Middle Ages, Polish culture, influenced by the West, in turn radiated East, beginning the long process of cultural assimilation. Polish–Lithuanian Union (1385–1795) Grand Duchy of Lithuania Poles reached Lithuania long before the union of the two countries. In a letter to the German Franciscans, Grand Duke Gediminas asked them to send monks who spoke Samogitian, Ruthenian or Polish. Other sources mention Polish slave carers and educators of children. This indicates the presence of Poles, probably prisoners of war or their descendants. Polish influence increased considerably after the Union of Krewo (1386). The Lithuanian Grand Duke Jogaila was offered the Polish crown and became Władysław II Jagiełło (reigned 1386–1434). This marked the beginning of the gradual, voluntary Polonization of the Lithuanian nobility. Jagiełło built many churches in pagan Lithuanian land and provided them generously with estates, gave out the lands and positions to the Catholics, settled the cities and villages and granted the biggest cities and towns Magdeburg rights in their Polish variant. Lithuanian nobles were granted privileges modeled on those held by the Polish nobility. 47 families of Lithuanian families were adopted by 45 Polish families and endowed with Polish coats of arms. Lithuania adopted Polish political solutions and institutions. The offices of voivodes and castellans appeared, and the country was