A, B = map(int, input().split()) s = set() for i in range(A+1): for j in range(B+1): s.add(i+j*5) s.discard(0) for a in sorted(list(s)): print(a)