def mineach(x,y):
    """
    Return a dictionary with min for each key
    """
    # output dictionary, intially empty
    o = {}
    # complete set of keys
    ks = set(list(x.keys()) + list(y.keys()))
    # iterate over each key
    for k in ks:
        # if in both, take the min of the two
        if k in x.keys() and k in y.keys():
            o[k] = min(x[k],y[k])
        # otherwise, take from which dict it's in
        elif k in x.keys():
            o[k] = x[k]
        else:
            o[k] = y[k]
    return o