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