head=35 foot=100 for i in range(1, head+1): if i*2+( head-i)*4== foot: print(i, head-i)