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

\node[accepting, state] at (14,-4) (n1n0) {$p!$\,\ifntiny{\tiny 41506}\fi};
\node[state] at (2,-10) (n0n0n0n1n0) {$p?$\,\ifntiny{\tiny 41521}\fi};
\node[state] at (10,-4) (n0n1) {$\cup$\,\ifntiny{\tiny 41518}\fi};
\node[accepting, state] at (10,-10) (n0n1n0n0n1) {$p?$\,\ifntiny{\tiny 41367}\fi};
\node[state] at (8,-10) (n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 41515}\fi};
\node[accepting, state] at (15,-2) (n1) {$p?$\,\ifntiny{\tiny 41510}\fi};
\node[accepting, state] at (10,-12) (n0n1n0n0n1n1) {$p!$\,\ifntiny{\tiny 41366}\fi};
\node[accepting, state] at (4,-12) (n0n0n0n1n1n1) {$p!$\,\ifntiny{\tiny 41458}\fi};
\node[accepting, state] at (5,-8) (n0n0n1n0) {$p!$\,\ifntiny{\tiny 41474}\fi};
\node[accepting, state] at (6,-8) (n0n0n1n1) {$p!$\,\ifntiny{\tiny 41481}\fi};
\node[state] at (9,-6) (n0n1n0) {$p?$\,\ifntiny{\tiny 41517}\fi};
\node[accepting, state] at (13,-6) (n0n1n1) {$p?$\,\ifntiny{\tiny 41500}\fi};
\node[accepting, state] at (3,-12) (n0n0n0n1n1n0) {$p!$\,\ifntiny{\tiny 41447}\fi};
\node[initial, state] at (8,0) (n) {$\cup$\,\ifntiny{\tiny 41526}\fi};
\node[state] at (2,-6) (n0n0n0) {$p?$\,\ifntiny{\tiny 41523}\fi};
\node[state] at (3,-4) (n0n0) {$\cup$\,\ifntiny{\tiny 41524}\fi};
\node[accepting, state] at (12,-8) (n0n1n1n0) {$p!$\,\ifntiny{\tiny 41492}\fi};
\node[accepting, state] at (4,-10) (n0n0n0n1n1) {$p?$\,\ifntiny{\tiny 41459}\fi};
\node[accepting, state] at (13,-8) (n0n1n1n1) {$p!$\,\ifntiny{\tiny 41499}\fi};
\node[accepting, state] at (6,-6) (n0n0n1) {$p?$\,\ifntiny{\tiny 41482}\fi};
\node[accepting, state] at (15,-4) (n1n1) {$p!$\,\ifntiny{\tiny 41509}\fi};
\node[state] at (9,-8) (n0n1n0n0) {$\cup$\,\ifntiny{\tiny 41516}\fi};
\node[state] at (3,-8) (n0n0n0n1) {$\cup$\,\ifntiny{\tiny 41522}\fi};
\node[accepting, state] at (9,-12) (n0n1n0n0n1n0) {$p!$\,\ifntiny{\tiny 41355}\fi};
\node[state] at (7,-2) (n0) {$p?$\,\ifntiny{\tiny 41525}\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 {d} (n0n0);
\draw[->, thick] (n0) edge [near start, left] node {x} (n0n1);
\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 {d} (n0n0);
\draw[->, thick] (n0n0n0) edge [near start, left] node {x} (n0n0n0n1);
\draw[->, thick] (n0n0n0n1) edge [near start, left] node {} (n0n0n0n1n0);
\draw[->, thick] (n0n0n0n1) edge [near start, left] node {} (n0n0n0n1n1);
\draw[->, thick] (n0n0n0n1n0) edge [near start, right, bend right] node {d} (n0n0);
\draw[->, thick] (n0n0n0n1n0) edge [near start, right, bend right] node {x} (n0n0n0n1);
\draw[->, thick] (n0n0n0n1n1) edge [near start, left] node {d} (n0n0n0n1n1n0);
\draw[->, thick] (n0n0n0n1n1) edge [near start, left] node {x} (n0n0n0n1n1n1);
\draw[->, thick] (n0n0n0n1n1n0) edge [near start, right, bend right] node {a} (n0n0n0n1n1);
\draw[->, thick] (n0n0n0n1n1n1) edge [near start, right, bend right] node {a} (n0n0n0n1n1);
\draw[->, thick] (n0n0n1) edge [near start, left] node {d} (n0n0n1n0);
\draw[->, thick] (n0n0n1) edge [near start, left] node {x} (n0n0n1n1);
\draw[->, thick] (n0n0n1n0) edge [near start, right, bend right] node {a} (n0n0n1);
\draw[->, thick] (n0n0n1n1) edge [near start, right, bend right] node {a} (n0n0n1);
\draw[->, thick] (n0n1) edge [near start, left] node {} (n0n1n0);
\draw[->, thick] (n0n1) edge [near start, left] node {} (n0n1n1);
\draw[->, thick] (n0n1n0) edge [near start, left] node {d} (n0n1n0n0);
\draw[->, thick] (n0n1n0) edge [near start, right, bend right] node {x} (n0n1);
\draw[->, thick] (n0n1n0n0) edge [near start, left] node {} (n0n1n0n0n0);
\draw[->, thick] (n0n1n0n0) edge [near start, left] node {} (n0n1n0n0n1);
\draw[->, thick] (n0n1n0n0n0) edge [near start, right, bend right] node {d} (n0n1n0n0);
\draw[->, thick] (n0n1n0n0n0) edge [near start, right, bend right] node {x} (n0n1);
\draw[->, thick] (n0n1n0n0n1) edge [near start, left] node {d} (n0n1n0n0n1n0);
\draw[->, thick] (n0n1n0n0n1) edge [near start, left] node {x} (n0n1n0n0n1n1);
\draw[->, thick] (n0n1n0n0n1n0) edge [near start, right, bend right] node {a} (n0n1n0n0n1);
\draw[->, thick] (n0n1n0n0n1n1) edge [near start, right, bend right] node {a} (n0n1n0n0n1);
\draw[->, thick] (n0n1n1) edge [near start, left] node {d} (n0n1n1n0);
\draw[->, thick] (n0n1n1) edge [near start, left] node {x} (n0n1n1n1);
\draw[->, thick] (n0n1n1n0) edge [near start, right, bend right] node {a} (n0n1n1);
\draw[->, thick] (n0n1n1n1) edge [near start, right, bend right] node {a} (n0n1n1);
\draw[->, thick] (n1) edge [near start, left] node {d} (n1n0);
\draw[->, thick] (n1) edge [near start, left] node {x} (n1n1);
\draw[->, thick] (n1n0) edge [near start, right, bend right] node {a} (n1);
\draw[->, thick] (n1n1) edge [near start, right, bend right] node {a} (n1);

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