подскажите почему не проходят условия :
Добавить в первый дополнительный список все числа из главного, которые нацело делятся на 3.
Добавить во второй дополнительный список все числа из главного, которые нацело делятся на 2.
остальные условия проходят
package com.javarush.task.task07.task0713;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Играем в Jолушку
*/
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader( new InputStreamReader(System.in));
ArrayList<Integer> MainList = new ArrayList<Integer>();
ArrayList<Integer> x2 = new ArrayList<Integer>();
ArrayList<Integer> x3 = new ArrayList<Integer>();
ArrayList<Integer> other = new ArrayList<Integer>();
for(int i = 0 ; i <20; i++){
MainList.add(Integer.parseInt(reader.readLine()));
}
for(int i = 0; i< MainList.size(); i++){
if (MainList.get(i) %3 ==0 && MainList.get(i) %2 ==0){
x3.add(MainList.get(i));
x2.add(MainList.get(i));
}
else if(MainList.get(i) %3 ==0 && MainList.get(i) %2 !=0 ){
x3.add(MainList.get(i));
}
else if(MainList.get(i) %2 ==0 && MainList.get(i) %3 !=0 ){
x2.add(MainList.get(i));
}
else{
other.add(MainList.get(i));
}
}
printList(x2);
printList(x3);
printList(other);
}
public static void printList(ArrayList<Integer> list) {
//напишите тут ваш код
for(int i = 0 ; i<list.size(); i++){
System.out.println(list.get(i));
}
}
}