Finding pairwise sum