o, f = map(int, input().split()) p = [] o_pattern = [] f_pattern = [] for i in range(1, o+1): o_pattern.append(i) for i in range(1,f+1): f_pattern.append(i * 5) if o >= 1 and f >= 1: for i in o_pattern: if not i in p: p.append(i) for j in f_pattern: if not j in p: p.append(j) if not i + j in p: p.append(i + j) elif o == 0: for j in f_pattern: p.append(j) elif f == 0: for i in o_pattern: p.append(i) for i in sorted(p): print(i)