nd distinct p