package nyagami; import java.util.Scanner; import java.util.TreeSet; import java.util.HashSet; public class test{ static boolean has(int[] a, int n, int x){ for(int i=0;i h = new TreeSet<>(); HashSet a = new HashSet<>(); HashSet b = new HashSet<>(); int n = sc.nextInt(), m = sc.nextInt(); for(int i=0;i h.add(k)); b.forEach(k -> h.add(k)); h.forEach((k)->{ System.out.printf("%d ", k); }); sc.close(); } }