I cannot find a mistake. Can anyone help?
package pl.codegym.task.task07.task0727;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Zmiana funkcjonalności
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> lista = new ArrayList<String>();
while (true) {
String s = reader.readLine();
if (s.isEmpty()) break;
lista.add(s);
}
ArrayList<String[]> lista2 = new ArrayList<>();
for (int i = 0; i < lista.size(); i++) {
String s = lista.get(i);
if(lista.get(i).length() % 2 == 0) {
String[] s2 = {s, s};
lista2.add(s2);
}
else {
String[] s3 = {s, s, s};
lista2.add(s3);
}
}
for (int i = 0; i < lista2.size(); i++) {
for (int j = 0; j < lista2.get(i).length; j++) {
System.out.println(lista2.get(i)[j]);
}
}
}
}