input = 3188 res = (0, input) for i in range(1, input//13): j = (input-i*13)//7 if i*13+j*7==input: if abs(i-j)