import sys sys.setrecursionlimit(10**6) a,b = map(int,input().split()) ans=set() def cal(o,f,cnt): if cnt in ans: return ans.add(cnt) for i in [1,5]: if i == 1 and o < a: cal(o+1,f,(cnt[0]+1,cnt[1])) elif i == 5 and f < b: cal(o,f+1,(cnt[0],cnt[1]+1)) cal(0,0,(0,0)) ans=sorted([i + j*5 for i , j in ans]) for i in ans: if i > 0: print(i)