\documentclass{article}
\usepackage{a4wide}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{automata}
\usepackage{datetime}
\lhead{./certificates/expensive1-expensive2/sim-12987.tex}
\rhead{09:11:48.332 on 2025-04-03}
\fancyfoot{}
\begin{document}
\newif\ifntiny
%\ntinyfalse
\ntinytrue
\thispagestyle{fancy}
\begin{center}
\maxsizebox{!}{0.475\textheight}{
\minsizebox{\textwidth}{!}{
\begin{tabular}{@{}c@{}}
% node count = 11
\begin{tikzpicture}[rotate = 0]
%\begin{tikzpicture}[rotate = 90]
\tikzset{initial text=$ $}

\node[accepting, state] at (2,-12) (n2n0n0n0n0n0) {$p!$\,\ifntiny{\tiny 13003}\fi};
\node[state] at (1,-2) (n1) {$p?$\,\ifntiny{\tiny 15241}\fi};
\node[accepting, state] at (3,-4) (n2n0) {$p?$\,\ifntiny{\tiny 13010}\fi};
\node[accepting, state] at (3,-10) (n2n0n0n0n0) {$p!$\,\ifntiny{\tiny 13007}\fi};
\node[state] at (1,-4) (n1n0) {$p?$\,\ifntiny{\tiny 15240}\fi};
\node[initial, state] at (2,0) (n) {$\cup$\,\ifntiny{\tiny 15242}\fi};
\node[accepting, state] at (3,-12) (n2n0n0n0n0n1) {$p!$\,\ifntiny{\tiny 13006}\fi};
\node[accepting, state] at (3,-8) (n2n0n0n0) {$p!$\,\ifntiny{\tiny 13008}\fi};
\node[state] at (0,-2) (n0) {$p?$\,\ifntiny{\tiny 15238}\fi};
\node[accepting, state] at (3,-6) (n2n0n0) {$p?$\,\ifntiny{\tiny 13009}\fi};
\node[accepting, state] at (3,-2) (n2) {$p?$\,\ifntiny{\tiny 13011}\fi};

\draw[->, thick] (n) edge [near start, left] node {} (n0);
\draw[->, thick] (n) edge [near start, left] node {} (n1);
\draw[->, thick] (n) edge [near start, left] node {} (n2);
\draw[->, thick] (n0) edge [near start, right, bend right] node {b} (n);
\draw[->, thick] (n1) edge [near start, left] node {a} (n1n0);
\draw[->, thick] (n1n0) edge [near start, right, bend right] node {b} (n);
\draw[->, thick] (n2) edge [near start, left] node {b} (n2n0);
\draw[->, thick] (n2n0) edge [near start, left] node {a} (n2n0n0);
\draw[->, thick] (n2n0n0) edge [near start, left] node {b} (n2n0n0n0);
\draw[->, thick] (n2n0n0n0) edge [near start, left] node {x} (n2n0n0n0n0);
\draw[->, thick] (n2n0n0n0n0) edge [near start, left] node {y} (n2n0n0n0n0n0);
\draw[->, thick] (n2n0n0n0n0) edge [near start, left] node {z} (n2n0n0n0n0n1);
\draw[->, thick] (n2n0n0n0n0n0) edge [near start, right, bend right] node {u} (n2);
\draw[->, thick] (n2n0n0n0n0n1) edge [near start, right, bend right] node {v} (n2);

\end{tikzpicture}
\end{tabular}}}
\end{center}
\end{document}
