Solved it with permutation method