friends and family algorithm

X