def main(): a,b=map(int,input().split()) s=set() for i in range(0,a+1): for j in range(0,b+1): s.add(i+j*5) ans=sorted(list(s)) for i in ans: if i!=0: print(i) if __name__ == "__main__": main()