from itertools import product
solutions = [(j, b) for j, b in product(range(0, 5+1), range(0, 8+1)) if j < b]
formatString = "{0:^6}|{1:^12}|{2:^12}"
print(formatString.format("nr", "jabłek", "brzoskwiń"))
for i, (j, b) in enumerate(solutions, 1):
print(formatString.format(i, j, b))
ZnJvbSBpdGVydG9vbHMgaW1wb3J0IHByb2R1Y3QKc29sdXRpb25zID0gWyhqLCBiKSBmb3IgaiwgYiBpbiBwcm9kdWN0KHJhbmdlKDAsIDUrMSksIHJhbmdlKDAsIDgrMSkpIGlmIGogPCBiXQpmb3JtYXRTdHJpbmcgPSAiezA6XjZ9fHsxOl4xMn18ezI6XjEyfSIKcHJpbnQoZm9ybWF0U3RyaW5nLmZvcm1hdCgibnIiLCAiamFixYJlayIsICJicnpvc2t3acWEIikpCmZvciBpLCAoaiwgYikgaW4gZW51bWVyYXRlKHNvbHV0aW9ucywgMSk6CglwcmludChmb3JtYXRTdHJpbmcuZm9ybWF0KGksIGosIGIpKQ==