A,B=map(int,input().split()) Z=set([0]) for a in [1]*A: Y=[] for z in Z: # print('debug1',z+a) Y.append(z+a) Z.update(Y) for b in [5]*B: Y=[] for z in Z: # print('debug1',z+b) Y.append(z+b) Z.update(Y) Z.remove(0) #print(Z) for i in sorted(list(Z)): print(i)