package aoc21;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Day18 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        List<Pair> pairs = new ArrayList<>();
        while (in.hasNextLine()) {
            pairs.add(parsePair(in.nextLine()));

        }

    }

    private static Pair parsePair(String nextLine) {
        int commaIndex = nextLine.indexOf(',');
        if (nextLine.charAt(0) == '[') {

        }
    }

    static class Pair {
        int leftVal;
        Pair leftPair;
        int rightVal;
        Pair rightPair;

        @Override
        public String toString() {
            return String.format("[%s, %s]", (leftPair != null) ? leftPair.toString() : leftVal, (rightPair != null) ? rightPair.toString() : rightVal);
        }
    }

}

@@ -496,24 +496,45 @@
 %0A%0A        %7D%0A
+        return null;%0A
     %7D%0A%0A    s

fix compilation