Hello! I have a problem. The code doesn't match the condition... I got " time out". But if I use this code it works. What's wrong then?
public class Solution {

        public static void main(String[] args) throws IOException {
            // write your code here
            BufferedReader BFileName = new BufferedReader(new InputStreamReader(System.in));
            String FileName = BFileName.readLine();

            BufferedReader linjka = new BufferedReader(new InputStreamReader(System.in));
            FileWriter wpis = new FileWriter(FileName);
            String napis = linjka.readLine();
                wpis.write(napis + "\n");
                napis = linjka.readLine();
            wpis.close(); // zamykamy wpisywanie do pliku !!
            BufferedReader buff = new BufferedReader(new FileReader(FileName));
            String tekst = buff.readLine();

            while(tekst != null){
                tekst = buff.readLine();