Amazon Interview Question

Given a tree return all parents