input_money = list(map(int, input().split())) money = [] ichiyen_list = [] goyen_list = [] for i in range(1, input_money[0]+1): ichiyen_list.append(i) i += 1 for i in range(1, input_money[1]+1): goyen_list.append(5 * i) i += 1 for i in ichiyen_list: for j in goyen_list: money.append(i + j) money = ichiyen_list + goyen_list + money money = sorted(list(set(money))) for i in money: print(i)