description: A string is called square if it is some string written twice in a row. For example, the strings "aa", "abcabc", "abab" and "baabaa" are square. But the strings "aaa", "abaaab" and "abcdabc" are not square.
  
  For a given string s determine if it is square.
  
  Input
  
  The first line of input data contains an integer t (1 ≤ t ≤ 100) —the number of test cases.
  
  This is followed by t lines, each containing a description of one test case. The given strings consist only of lowercase Latin letters and have lengths between 1 and 100 inclusive.
  
  Output
  
  For each test case, output on a separate line:
  
    * YES if the string in the corresponding test case is square, 
    * NO otherwise. 
  
  
  
  You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response).
  
  Example
  
  Input
  
  
  10
  a
  aa
  aaa
  aaaa
  abab
  abcabc
  abacaba
  xxyy
  xyyx
  xyxy
  
  
  Output
  
  
  NO
  YES
  NO
  YES
  YES
  YES
  NO
  NO
  NO
  YES
solution: import java.io.*;
  import java.util.*;
  
  public class Main {
  
      public static void main(String[] args) throws IOException {
          // br = new BufferedReader(new FileReader("input.txt"));
          // out = new PrintWriter("output.txt");
          int  t = nextInt();
          for (int i = 0; i < t; i++) {
              char[] v= nextToken().toCharArray();
              if(v.length%2==0){
                  int z = 0 ;
                  int h = 0 ;
                  for (int j = v.length/2; j < v.length; j++) {
                      if(v[j]!=v[z]){
                          out.println("NO");
                          h++;
                          break;
                      }
                      z++;
                  }
                  if(h==0) {
                      out.println("YES");
                  }
              }
              else{
                  out.println("NO");
              }
          }
          out.close();
      }
  
      static long a = 0;
      static long ans = -1;
      static long alenght = 7;
  
      public static void rec(long sum, String s, int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8, int c9, int c0) {
          if ((sum >= a && s != "") || (s.length() > alenght && s != "") || c1 > 1 || c2 > 1 || c3 > 1 || c4 > 1 || c5 > 1 || c6 > 1 || c7 > 1 || c8 > 1 || c9 > 1 || c0 > 1) {
              if (sum == a) {
                  char c41[] = s.toCharArray();
                  Arrays.sort(c41);
                  int p = 0;
                  for (int i = 1; i < s.length(); i++) {
                      if (c41[i] == c41[i - 1]) {
                          p++;
                          break;
                      }
                  }
                  if (p == 0) {
                      String anss = "";
                      for (int i = s.length() - 1; i >= 0; i--) {
                          anss = anss + "" + c41[i];
                      }
                      long ansss = Long.parseLong(anss);
                      if (ansss > ans) {
                          ans = ansss;
                          alenght = s.length();
                      }
                  }
              }
              return;
          }
          if (c1 < 1) rec(sum * 1, s + "" + 1, c1 + 1, c2, c3, c4, c5, c6, c7, c8, c9, c0);
          if (c2 < 1) rec(sum * 2, s + "" + 2, c1, c2 + 1, c3, c4, c5, c6, c7, c8, c9, c0);
          if (c3 < 1) rec(sum * 3, s + "" + 3, c1, c2, c3 + 1, c4, c5, c6, c7, c8, c9, c0);
          if (c4 < 1) rec(sum * 4, s + "" + 4, c1, c2, c3, c4 + 1, c5, c6, c7, c8, c9, c0);
          if (c5 < 1) rec(sum * 5, s + "" + 5, c1, c2, c3, c4, c5 + 1, c6, c7, c8, c9, c0);
          if (c6 < 1) rec(sum * 6, s + "" + 6, c1, c2, c3, c4, c5, c6 + 1, c7, c8, c9, c0);
          if (c7 < 1) rec(sum * 7, s + "" + 7, c1, c2, c3, c4, c5, c6, c7 + 1, c8, c9, c0);
          if (c8 < 1) rec(sum * 8, s + "" + 8, c1, c2, c3, c4, c5, c6, c7, c8 + 1, c9, c0);
          if (c9 < 1) rec(sum * 9, s + "" + 9, c1, c2, c3, c4, c5, c6, c7, c8, c9 + 1, c0);
          if (c0 < 1) rec(sum * 0, s + "" + 0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c0 + 1);
      }
  
      static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      static PrintWriter out = new PrintWriter(System.out);
      static StringTokenizer in = new StringTokenizer("");
  
  
      public static boolean hasNext() throws IOException {
          if (in.hasMoreTokens()) return true;
          String s;
          while ((s = br.readLine()) != null) {
              in = new StringTokenizer(s);
              if (in.hasMoreTokens()) return true;
          }
          return false;
      }
  
      public static String nextToken() throws IOException {
          while (!in.hasMoreTokens()) {
              in = new StringTokenizer(br.readLine());
          }
          return in.nextToken();
      }
  
      public static int nextInt() throws IOException {
          return Integer.parseInt(nextToken());
      }
  
      public static double nextDouble() throws IOException {
          return Double.parseDouble(nextToken());
      }
  
      public static long nextLong() throws IOException {
          return Long.parseLong(nextToken());
      }
  
      static class Pair implements Comparable<Pair> {
          int x, sosed;
  
          public Pair(int x, int sosed) {
              this.x = x;
              this.sosed = sosed;
          }
  
          @Override
          public int compareTo(Pair o) {
              return Integer.compare(x, o.x);
          }
      }
  }