Help me in solving JCF8A problem

My issue

In this problem there are some issue ,when I Write the same code in any other IDE it works and give proper output but here you can write anything it only give one output with every code. fix this bug as soon as possible.

My code

// Update the '_' to solve the problem
import java.util.*;

class Codechef {
    public static void main(String[] args) {
        Scanner read = new Scanner(;
        int size = read.nextInt();
        ArrayList<Integer> list1 = new ArrayList<>();
        for (int i = 0; i < size; i++) {
        ArrayList<Integer> list2 = new ArrayList<>();
        for (int i = 0; i < size; i++) {
        HashSet<Integer> union = new HashSet<>();
        for (int i = 0; i < list1.size(); i++) {
        for (int i = 0; i < list2.size(); i++) {
        System.out.println("Union of the lists: " + union);

Learning course: Learn Advance Java
Problem Link: CodeChef: Practical coding for everyone