\documentclass{article}
\usepackage{a4wide}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{automata}
\usepackage{datetime}
\lhead{./certificates/ex1-ok-loop-ex2-ok-loop/sim-13671.tex}
\rhead{08:49:43.142 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 18756}\fi};
\node[accepting, state] at (2,-16) (n0n0n1n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 14694}\fi};
\node[accepting, state] at (2,-18) (n0n0n1n0n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 14693}\fi};
\node[accepting, state] at (2,-10) (n0n0n1n0n0) {$p?$\,\ifntiny{\tiny 14697}\fi};
\node[initial, state] at (2,0) (n) {$\cup$\,\ifntiny{\tiny 18757}\fi};
\node[accepting, state] at (2,-6) (n0n0n1) {$p?$\,\ifntiny{\tiny 14699}\fi};
\node[state] at (1,-2) (n0) {$p?$\,\ifntiny{\tiny 18755}\fi};
\node[accepting, state] at (2,-8) (n0n0n1n0) {$p?$\,\ifntiny{\tiny 14698}\fi};
\node[accepting, state] at (2,-12) (n0n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 14696}\fi};
\node[accepting, state] at (2,-14) (n0n0n1n0n0n0n0) {$p?$\,\ifntiny{\tiny 14695}\fi};
\node[accepting, state] at (2,-20) (n0n0n1n0n0n0n0n0n0n0) {$p!$\,\ifntiny{\tiny 14692}\fi};
\node[state] at (0,-6) (n0n0n0) {$p?$\,\ifntiny{\tiny 18753}\fi};
\node[state] at (1,-4) (n0n0) {$\cup$\,\ifntiny{\tiny 18754}\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}
