\documentclass{article}
\usepackage{a4wide}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{automata}
\usepackage{datetime}
\lhead{./certificates/june1-june2/sim-28645.tex}
\rhead{09:11:48.607 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 = 19
\begin{tikzpicture}[rotate = 0]
%\begin{tikzpicture}[rotate = 90]
\tikzset{initial text=$ $}

\node[state] at (3,-2) (n1) {$p?$\,\ifntiny{\tiny 29311}\fi};
\node[accepting, state] at (4,-4) (n2n0) {$p?$\,\ifntiny{\tiny 28655}\fi};
\node[accepting, state] at (3,-12) (n1n0n0n1n0n0) {$p!$\,\ifntiny{\tiny 28734}\fi};
\node[accepting, state] at (1,-8) (n0n0n1n0) {$p?$\,\ifntiny{\tiny 29230}\fi};
\node[state] at (3,-4) (n1n0) {$p?$\,\ifntiny{\tiny 29310}\fi};
\node[accepting, state] at (1,-10) (n0n0n1n0n0) {$p!$\,\ifntiny{\tiny 29229}\fi};
\node[accepting, state] at (5,-6) (n3n0n0) {$p?$\,\ifntiny{\tiny 28670}\fi};
\node[accepting, state] at (5,-2) (n3) {$p?$\,\ifntiny{\tiny 28669}\fi};
\node[initial, state] at (3,0) (n) {$\cup$\,\ifntiny{\tiny 29316}\fi};
\node[accepting, state] at (5,-4) (n3n0) {$p!$\,\ifntiny{\tiny 28668}\fi};
\node[state] at (3,-6) (n1n0n0) {$\cup$\,\ifntiny{\tiny 29309}\fi};
\node[state] at (1,-2) (n0) {$p?$\,\ifntiny{\tiny 29315}\fi};
\node[accepting, state] at (4,-6) (n2n0n0) {$p!$\,\ifntiny{\tiny 28654}\fi};
\node[accepting, state] at (4,-2) (n2) {$p?$\,\ifntiny{\tiny 28656}\fi};
\node[accepting, state] at (3,-10) (n1n0n0n1n0) {$p?$\,\ifntiny{\tiny 28735}\fi};
\node[state] at (0,-6) (n0n0n0) {$p?$\,\ifntiny{\tiny 29312}\fi};
\node[state] at (1,-4) (n0n0) {$\cup$\,\ifntiny{\tiny 29314}\fi};
\node[accepting, state] at (3,-8) (n1n0n0n1) {$p?$\,\ifntiny{\tiny 28736}\fi};
\node[accepting, state] at (1,-6) (n0n0n1) {$p?$\,\ifntiny{\tiny 29231}\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] (n) edge [near start, left] node {} (n3);
\draw[->, thick] (n0) edge [near start, left] node {c} (n0n0);
\draw[->, thick] (n0n0) edge [near start, left] node {} (n0n0n0);
\draw[->, thick] (n0n0) edge [near start, left] node {} (n0n0n1);
\draw[->, thick] (n0n0n0) edge [near start, right, bend right] node {b} (n0);
\draw[->, thick] (n0n0n1) edge [near start, left] node {b} (n0n0n1n0);
\draw[->, thick] (n0n0n1n0) edge [near start, left] node {c} (n0n0n1n0n0);
\draw[->, thick] (n0n0n1n0n0) edge [near start, right, bend right] node {a} (n0n0n1);
\draw[->, thick] (n1) edge [near start, left] node {b} (n1n0);
\draw[->, thick] (n1n0) edge [near start, left] node {c} (n1n0n0);
\draw[->, thick] (n1n0n0) edge [near start, right, bend right] node {} (n1);
\draw[->, thick] (n1n0n0) edge [near start, left] node {} (n1n0n0n1);
\draw[->, thick] (n1n0n0n1) edge [near start, left] node {b} (n1n0n0n1n0);
\draw[->, thick] (n1n0n0n1n0) edge [near start, left] node {c} (n1n0n0n1n0n0);
\draw[->, thick] (n1n0n0n1n0n0) edge [near start, right, bend right] node {a} (n1n0n0n1);
\draw[->, thick] (n2) edge [near start, left] node {b} (n2n0);
\draw[->, thick] (n2n0) edge [near start, left] node {c} (n2n0n0);
\draw[->, thick] (n2n0n0) edge [near start, right, bend right] node {a} (n2);
\draw[->, thick] (n3) edge [near start, left] node {c} (n3n0);
\draw[->, thick] (n3n0) edge [near start, left] node {a} (n3n0n0);
\draw[->, thick] (n3n0n0) edge [near start, right, bend right] node {b} (n3);

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