A,B=map(int,input().split()) Z=set([0]) for x in [1]*A+[5]*B:Z.update([z+x for z in Z]) Z.remove(0) for i in sorted(list(Z)):print(i)