import java.util.*; public class No543 { public static void main(String[] args) { try (final Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); int m = sc.nextInt(); Set set = new TreeSet<>(); for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { set.add(i*5+j*1); } } set.remove(0); set.stream().forEach(System.out::println); } } static long gcd(long n, long r) { return r == 0 ? n : gcd(r, n % r); } static long lcm(long n, long r) { return n/gcd(n,r)*r; } static void dump(Object... objects) { System.err.println(Arrays.deepToString(objects)); } }