I know that my code looks like spaghetti, but it works with the presented file content. But the solution is not accepted. I change my code after advice, but it is still not accepted. Probably there are some conditions which are not included in the presented file content which my code does not fulfill.
package pl.codegym.task.task19.task1924;

import java.io.*;
import java.util.HashMap;
import java.util.Map;

/*
Zastępowanie liczb
*/

public class Solution {
    public static Map<Integer, String> map = new HashMap<Integer, String>();

    static {
        map.put(0 , "zero");
        map.put(1, "one");
        map.put(2, "two");
        map.put(3, "three");
        map.put(4, "four");
        map.put(5, "five");
        map.put(6, "six");
        map.put(7, "seven");
        map.put(8, "eight");
        map.put(9, "nine");
        map.put(10, "ten");
        map.put(11, "eleven");
        map.put(12, "twelve");
    }
    public static void main(String[] args) throws IOException, FileNotFoundException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String fileName = reader.readLine();
        FileReader fileReader = new FileReader(fileName);
        BufferedReader reader1 = new BufferedReader(fileReader);
        String line= reader1.readLine();
        String add = "";
        String lineToPrint = "";
        while (line!= null){

            char[] charLine = line.toCharArray();

            for(int i = 0; i < charLine.length ; i++){
if(( i+2 < charLine.length && ((int)charLine[i] >=48 && (int)charLine[i] <=57 ) && ((int)charLine[i+1] >=48 && (int)charLine[i+1] <=57 ) ) && ((int)charLine[i+2] >=48 && (int)charLine[i+2] <=57 ) ){
                    add = Character.toString(charLine[i]) + Character.toString(charLine[i +1]) + Character.toString(charLine[i+2]);
                    i +=2;
                }else if( i+1 < charLine.length && ((int)charLine[i] >=48 && (int)charLine[i] <=57 ) && ((int)charLine[i+1] >=48 && (int)charLine[i+1] <=57 ) ){

                    char firstDigit = charLine[i];
                    char secondDigit = charLine[i+1];
                    String numerString = Character.toString(firstDigit) + Character.toString(secondDigit);
                    int numer = Integer.parseInt(numerString);
                    add =  map.get(numer);
                    i +=1;
                }else if (i>1 && (int)charLine[i] >=48 && (int)charLine[i] <=57 && (int)charLine[i-1] != 32){
                    add = Character.toString(charLine[i]);

}
else if(i+1 < charLine.length && ((int)charLine[i] >=48 && (int)charLine[i] <=57 ) && ((int)charLine[i+1] == 44 || (int)charLine[i+1] == 46)){
    char firstDigit = charLine[i];

    String numerString = Character.toString(firstDigit);
    int numer = Integer.parseInt(numerString);
    add = map.get(numer);
}

else if(i+1 < charLine.length && ((int)charLine[i] >=48 && (int)charLine[i] <=57 ) && ((int)charLine[i+1] <48 || (int)charLine[i+1] >57 )){
    add = Character.toString(charLine[i]);
}else if((int)charLine[i] >=48 && (int)charLine[i] <=57){
                    char firstDigit = charLine[i];

                    String numerString = Character.toString(firstDigit);
                    int numer = Integer.parseInt(numerString);
                    add = map.get(numer);
                }
                else{
                    add = Character.toString(charLine[i]);
                }
                lineToPrint += add;
            }

            System.out.println(lineToPrint);
            lineToPrint ="";
            line= reader1.readLine();
        }
        reader.close();
        reader1.close();
        fileReader.close();
    }
}