#!/usr/bin/env python3 import sys def main(): a, b = map(int, input().split()) l = set() for i in range(a + 1): for j in range(b + 1): l.add(i + 5 * j) for ll in sorted(list(l))[1:]: print(ll) return if __name__ == '__main__': main()