import java.io.*; import java.util.*; /** * Try each offset of 7 as the possible starting point for the cycle of 7. * * @author Finn Lidbetter */ public class tetris_finn { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); while(t-- > 0) { char[] seq = br.readLine().toCharArray(); boolean valid = false; for (int start=0; start<7; start++) { boolean validStart = true; if (start>=seq.length) { break; } HashSet tetrominoSet = new HashSet<>(); for (int j=0; j