from functools import reduce


def fuseDotAl(dotAl):
    """Given input [ (2, "3"), (4, "5"), (2,"6") ],
       d will be  a dict  { 2: {"3","6"}, 4: {"5"} }
       and return value   { 2: {"3 \n 6"}, 4: {"5"} }
    """
    d = dict([(x, {y for (z,y) in dotAl if z==x}) for (x,w) in dotAl])  # sets of y for the same x
    return [(a, reduce(lambda x,y: x + " \n " + y, b)) for (a,b) in d.items()]