A, B = map(int, input().split()) L = [] for a in range(A+1): for b in range(B+1): X = a + 5*b if not X in L: L += [X] print('\n'.join(map(str, sorted(L[1:]))))