package algospot_quadtree;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    public static int C;

    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("input.txt");
        System.setIn(fis);

        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        StringTokenizer st = new StringTokenizer(br.readLine());

        C = Integer.parseInt(st.nextToken());
        for (int i = 0; i < C; i++) {
            st = new StringTokenizer(br.readLine());
            String str = st.nextToken();
            solve(str);
        }
    }

    private static void solve(String str) {
        // TODO
    }

}

@@ -153,16 +153,33 @@
 nizer;%0A%0A
+// O(n)%0A// 144ms%0A
 public c
@@ -215,16 +215,45 @@
 c int C;
+%0A    public static int INDEX;
 %0A%0A    pu
@@ -775,16 +775,59 @@
         
+INDEX = -1;%0A            System.out.println(
 solve(st
@@ -828,16 +828,17 @@
 lve(str)
+)
 ;%0A      
@@ -848,16 +848,117 @@
 %0A    %7D%0A%0A
+    // not quad(!x) = return char%0A    // if quad(x) = 1 -%3E 3, 2 -%3E 4%0A    // 1, 2, 3, 4 -%3E 3, 4, 1, 2%0A
     priv
@@ -968,20 +968,22 @@
  static 
-void
+String
  solve(S
@@ -1007,15 +1007,390 @@
     
-// TODO
+INDEX++;%0A        char c = str.charAt(INDEX);%0A        if (c == 'w' %7C%7C c == 'b') %7B%0A            return String.valueOf(c);%0A        %7D else if (c == 'x') %7B%0A            String str1 = solve(str);%0A            String str2 = solve(str);%0A            String str3 = solve(str);%0A            String str4 = solve(str);%0A            return %22x%22 + str3 + str4 + str1 + str2;%0A        %7D%0A        return %22%22;
 %0A   

Implement for algospot quadtree problem