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