Cocke-Younger-Kasami (CYK) algorithem for the word $baabb$ With the context-free grammar in Chomsky's form:$$S\to BA|AC|b\\A\to AA|AB|CC|a\\B\to AS|BB|CA\\C\to AB|SS|b$$   

I need to:


  
  run the CYK (Cocke-Younger-Kasami) algorithm and decide if I can derive the word $baabb$ from the context.
  write the left derivation. 
  


My try:

$1.$

$$
\begin{array}{c|lcr}
i\bigg/j &amp;  1 &amp; 2 &amp; 3 &amp;  4 &amp; 5 \\
\hline
1 &amp; \text{C,S} &amp; \text{B} &amp; \square&amp; \square &amp;\square \\
2 &amp; \quad\blacksquare &amp; \text{A} &amp; \text{A} &amp; \square &amp; \square \\
3 &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \text{A} &amp; \text{S,B} &amp; \square \\
4 &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \text{C,S} &amp; \text{A,C} \\
5 &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \text{C,S} \\
\end{array}
$$


$S\Longrightarrow BA \Longrightarrow CAA \Longrightarrow bAA\Longrightarrow bAACC\Longrightarrow baabb$


I'm stuck here in the table construction. How should I fill in the empty squares?
Watch this video and you should get:

$$
\begin{array}{c|lcr}
i\bigg/j &amp;  1 &amp; 2 &amp; 3 &amp;  4 &amp; 5 \\
\hline
1 &amp; \text{C,S} &amp; \text{B} &amp; \text{B,S} &amp; \text{A,B,C} &amp; \text{B,C,$\color{red}{\text{S}}$,A} \\
2 &amp; \quad\blacksquare &amp; \text{A} &amp; \text{A} &amp; \text{B,C,A,S} &amp; \text{A,B,C} \\
3 &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \text{A} &amp; \text{S,B} &amp; \text{A,S,C} \\
4 &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \text{C,S} &amp; \text{A,C} \\
5 &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \quad\blacksquare &amp; \text{C,S} \\
\end{array}
$$

Since S is in the left and higher corner so we can derivate the word $baabb$ from the context