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

\node[accepting, state] at (2,-6) (n0n1n0) {$p?$\,\ifntiny{\tiny 54541}\fi};
\node[initial, state] at (2,0) (n) {$p?$\,\ifntiny{\tiny 54757}\fi};
\node[accepting, state] at (2,-4) (n0n1) {$p?$\,\ifntiny{\tiny 54542}\fi};
\node[accepting, state] at (2,-8) (n0n1n0n0) {$p!$\,\ifntiny{\tiny 54540}\fi};
\node[state] at (2,-2) (n0) {$\cup$\,\ifntiny{\tiny 54756}\fi};

\draw[->, thick] (n) edge [near start, left] node {a} (n0);
\draw[->, thick] (n0) edge [near start, right, bend right] node {} (n);
\draw[->, thick] (n0) edge [near start, left] node {} (n0n1);
\draw[->, thick] (n0n1) edge [near start, left] node {a} (n0n1n0);
\draw[->, thick] (n0n1n0) edge [near start, left] node {a} (n0n1n0n0);
\draw[->, thick] (n0n1n0n0) edge [near start, right, bend right] node {x} (n0n1);
\draw[->, thick] (n0n1n0n0) edge [near start, right, bend right] node {y} (n0n1);
\draw[->, thick] (n0n1n0n0) edge [near start, right, bend right] node {z} (n0n1);

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