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