public static ArrayList<ArrayList<Integer>> fourSum(int[] numbers, int target) {     
        //write your code here
        int[]A=numbers;
        int t=target, n=A.length;
        Arrays.sort(A);
        ArrayList<ArrayList<Integer>> rel=new ArrayList<>();
        for (int i=0;i<n;) {
            for (int j=i+1;j<n;) {
                for (int l=j+1, r=n-1;l<r;) {
                    int nl=l+1, nr=r-1;
                    while (nl<r&&A[nl]==A[l])
                        ++nl;
                    while (nr>l&&A[nr]==A[r])
                        --nr;
                    int sum=A[i]+A[j]+A[l]+A[r];
                    if (sum==t) {
                        rel.add(new ArrayList<>(Arrays.asList(A[i],A[j],A[l],A[r])));
                        l=nl;
                        r=nr;
                    } else if (sum<t) {
                        l=nl;
                    } else {
                        r=nr;
                    }
                }
                int nj=j+1;
                while (nj<n&&A[j]==A[nj])
                    ++nj;
                j=nj;
            }
            int ni=i+1;
            while (ni<n&&A[ni]==A[i])
                ++ni;
            i=ni;
        }
        return rel;
    }