Piast Poland, 966 to 1370