A,B = map(int,input().split()) ans = set() for i in range(A + 1): for j in range(B + 1): if i == 0 and j == 0: continue ans.add(i * 1 + j * 5) for a in sorted(ans): print(a)