compiler shows wrong answer even though program works [JAVA]

/* package codechef; // don’t place package name! */

import java.util.;
import java.lang.
;
import java.io.*;

class Codechef
{
public static void main (String[] args) throws IOException
{

    Scanner s = new Scanner(System.in);

    int t = s.nextInt();

    for (int i = 1; i <= t ; i++) {

        int[] tcases = new int[30];
        for (int j = 0; j < 30 ; j++) {
            tcases[j] = s.nextInt();
        }
        int count = 0;
        for (int j = 0; j < 30; j++) {

            if (tcases[j] == 1){
                count++;
            }
            else{
                count = 0;
            }
            if (count > 5){
                break;
            }

        }

        if (count > 5){
            System.out.println("#coderlifemattters");
        }
        else {
            System.out.println("#allcodersarefun");
        }
    }

}

}

//