def jiance(k):
global bu,chi,a,s
for i in chi:
if a[k][0]==i[0] and a[k][1]==i[1]:
return 1
return 0
def zou(k):
global bu,chi,a,s,m,n
if k==n+m+1 and a[k-1][0]==5 and a[k-1][1]==5 :
print(a)
s+=1
else:
for i in bu:
a[k]=(a[k-1][0]+i[0],a[k-1][1]+i[1])
if not jiance(k):
zou(k+1)