def dict_to_str_sorted(d):
    """Return a str containing each key and value in dict d.
    Keys and values are separated by a comma. Key-value
    pairs are separated by a newline character from each
    other, and are sorted in ascending order by key.
    For example, dict_to_str_sorted({1:2, 0:3, 10:5}) should
    return "0, 3\n1, 2\n10, 5". The keys in the string must
    be sorted in ascending order."""
    c = ""
    L = []
    for key, value in d.items():
        a = str(key) + ", " + str(value) + "\n"
        L.append(a)
    b = sorted(L)
    for i in range(len(L)):
        c += str(b[i])
    return c