Compute the set X of the 2^26 possible sums of the first 26 pairs. And the set Y of the 2^25 possible sums of the last 25 pairs. You're looking for the minimum magnitude sum x+y with x in X and y in Y. That's equivalent to finding the closest pair x and -y. See Closest pair of points problem for various approaches and references. That article is about a single set of points, but you can adapt the approaches to two sets.