Аргументы метода подчеркнуты красным
public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<Integer> list = new ArrayList();
        ArrayList<Integer> other = new ArrayList();
        ArrayList<Integer> even = new ArrayList();
        ArrayList<Integer> odd = new ArrayList();
        for (int i = 0; i < 5; i++) {
            String s = reader.readLine();
            if (s.isEmpty()) break;
            list.add(Integer.parseInt(s));

        }
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i) % 3 == 0 && list.get(i) % 2 == 0) {
                even.add(list.get(i));
                odd.add(list.get(i));

            } else if (list.get(i) % 3 == 0) {
                odd.add(list.get(i));

            } else if (list.get(i) % 2 == 0) {
                even.add(list.get(i));
            } else other.add(list.get(i));
        }
        printList(other);
        public static void printList (ArrayList < Integer > list) {
            //напишите тут ваш код
        }
    }
}