Let matrices $\mathbf{F}_1 \in \mathbb{R}^{n \times n}$, $\mathbf{G}_1 \in \mathbb{R}^{n\times n}$, $\mathbf{C}_1 \in \mathbb{R}^{n \times n}$, $\mathbf{D}_1 \in \mathbb{R}^{n \times n}$, $\mathbf{F}_2 \in \mathbb{R}^{n\times n}$, $\mathbf{G}_2 \in \mathbb{R}^{n\times n}$, $\mathbf{C}_2 \in \mathbb{R}^{n\times n}$ and $\mathbf{D}_2 \in \mathbb{R}^{n\times n}$ be building blocks of two larger matrices \begin{equation} \mathbf{A} = \left[\begin{array}{ccc} \mathbf{F}_1 & \mathbf{0} & \mathbf{G}_1\\ \mathbf{G}_2\mathbf{C}_1 & \mathbf{F}_2 & \mathbf{G}_2\mathbf{D}_1\\ \mathbf{D}_2\mathbf{C}_1 & \mathbf{C}_2 & \mathbf{D}_2\mathbf{D}_1 \end{array}\right] \end{equation} and \begin{equation} \mathbf{B} = \left[\begin{array}{ccc} \mathbf{F}_1 & \mathbf{G}_1\mathbf{C}_2 & \mathbf{G}_1\mathbf{D}_2\\ \mathbf{0} & \mathbf{F}_2 & \mathbf{G}_2\\ \mathbf{C}_1 & \mathbf{D}_1\mathbf{C}_2 & \mathbf{D}_1\mathbf{D}_2 \end{array}\right] \end{equation} Let $p_{\mathbf{A}(\lambda)} = \det(\lambda\mathbf{I} - \mathbf{A})$ and $p_{\mathbf{B}(\lambda)} = \det(\lambda\mathbf{I} - \mathbf{B})$ be characteristic polynomials of matrices $\mathbf{A}$ and $\mathbf{B}$, respectively. I would like to know whether the two characteristic polynomials are equal $p_{\mathbf{A}(\lambda)} = p_{\mathbf{B}(\lambda)}$.
For $n = 1$ the component matrices are scalars and $\mathbf{A},\mathbf{B} \in \mathbb{R}^{3\times 3}$. With this condition characteristic polynomials of two matrices are equal. This can be verified by the definition of the characteristic polynomial.
I don't know how to generalize this statement for $n > 1$. Any help would be appreciated.