package yukicoder; import java.util.LinkedList; import java.util.Scanner; public class No542 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); LinkedList list = new LinkedList<>(); int a = sc.nextInt(); int b = sc.nextInt(); for(int i = 1; i <= a; i++) { list.add(i); for(int j = 5; j <= b * 5; j++) { list.add(i + j); } } for(int i = 5; i <= b * 5; i += 5) { list.add(i); } list.stream().sorted().distinct().forEach(i -> System.out.println(i)); } }