print((lambda x: x and "\n".join(y + ", " + str(sum(z[1] for z in x if z[0] == y)) + "kg." for y in sorted(set(list(zip(*x))[0]))) or "")((lambda x, y, z: x(x, y, z))(lambda x, y, z: y and (y != "q" and x(x, 0, z + [(y, int(input("Enter the weight in kg: ")))]) or z) or x(x, input("Enter a fruit type (q to quit): "), z), 0, [0])[1:]))