import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): A, B = getlist() DP = [0] * 1000 DP[0] = 1 for i in range(B): for j in range(999, -1, -1): if DP[j] == 1: DP[j + 5] = 1 for i in range(A): for j in range(999, -1, -1): if DP[j] == 1: DP[j + 1] = 1 DP[0] = 0 for i in range(1000): if DP[i] == 1: print(i) if __name__ == '__main__': main()