# -*- coding: utf-8 -*- B, A = map(int, input().split()) for i in range(A+1): for j in range(min(B+1,5)): pattern = 5*i + j if pattern != 0: print(pattern) if B>=5: for i in range(5, B+1): pattern = 5*A + i print(pattern)