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

\node[state] at (3,-2) (n1) {$p?$\,\ifntiny{\tiny 38276}\fi};
\node[accepting, state] at (2,-16) (n0n0n1n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 37746}\fi};
\node[accepting, state] at (2,-18) (n0n0n1n0n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 37745}\fi};
\node[accepting, state] at (2,-10) (n0n0n1n0n0) {$p?$\,\ifntiny{\tiny 37749}\fi};
\node[initial, state] at (2,0) (n) {$\cup$\,\ifntiny{\tiny 38277}\fi};
\node[accepting, state] at (2,-6) (n0n0n1) {$p?$\,\ifntiny{\tiny 37751}\fi};
\node[state] at (1,-2) (n0) {$p?$\,\ifntiny{\tiny 38275}\fi};
\node[accepting, state] at (2,-8) (n0n0n1n0) {$p?$\,\ifntiny{\tiny 37750}\fi};
\node[accepting, state] at (2,-12) (n0n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 37748}\fi};
\node[accepting, state] at (2,-14) (n0n0n1n0n0n0n0) {$p?$\,\ifntiny{\tiny 37747}\fi};
\node[accepting, state] at (2,-20) (n0n0n1n0n0n0n0n0n0n0) {$p!$\,\ifntiny{\tiny 37744}\fi};
\node[state] at (0,-6) (n0n0n0) {$p?$\,\ifntiny{\tiny 38273}\fi};
\node[state] at (1,-4) (n0n0) {$\cup$\,\ifntiny{\tiny 38274}\fi};

\draw[->, thick] (n) edge [near start, left] node {} (n0);
\draw[->, thick] (n) edge [near start, left] node {} (n1);
\draw[->, thick] (n0) edge [near start, left] node {b} (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 {a} (n);
\draw[->, thick] (n0n0n1) edge [near start, left] node {a} (n0n0n1n0);
\draw[->, thick] (n0n0n1n0) edge [near start, left] node {b} (n0n0n1n0n0);
\draw[->, thick] (n0n0n1n0n0) edge [near start, left] node {a} (n0n0n1n0n0n0);
\draw[->, thick] (n0n0n1n0n0n0) edge [near start, left] node {b} (n0n0n1n0n0n0n0);
\draw[->, thick] (n0n0n1n0n0n0n0) edge [near start, left] node {a} (n0n0n1n0n0n0n0n0);
\draw[->, thick] (n0n0n1n0n0n0n0n0) edge [near start, left] node {a} (n0n0n1n0n0n0n0n0n0);
\draw[->, thick] (n0n0n1n0n0n0n0n0n0) edge [near start, left] node {b} (n0n0n1n0n0n0n0n0n0n0);
\draw[->, thick] (n0n0n1n0n0n0n0n0n0n0) edge [near start, right, bend right] node {x} (n0n0n1);
\draw[->, thick] (n0n0n1n0n0n0n0n0n0n0) edge [near start, right, bend right] node {y} (n0n0n1);
\draw[->, thick] (n1) edge [near start, left, bend left] node {a} (n);

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