Get parents of each element