\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-13677.tex}
\rhead{08:49:43.137 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 = 28
\begin{tikzpicture}[rotate = 0]
%\begin{tikzpicture}[rotate = 90]
\tikzset{initial text=$ $}

\node[state] at (5,-12) (n1n0n0n1n0n0) {$\cup$\,\ifntiny{\tiny 14765}\fi};
\node[state] at (4,-4) (n1n0) {$p?$\,\ifntiny{\tiny 14769}\fi};
\node[state] at (5,-24) (n1n0n0n1n0n0n1n0n0n0n0n1) {$p?$\,\ifntiny{\tiny 14758}\fi};
\node[state] at (3,-24) (n1n0n0n1n0n0n1n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 14754}\fi};
\node[state] at (4,-28) (n1n0n0n1n0n0n1n0n0n0n0n1n0n0) {$p?$\,\ifntiny{\tiny 14756}\fi};
\node[state] at (4,-6) (n1n0n0) {$\cup$\,\ifntiny{\tiny 14768}\fi};
\node[accepting, state] at (6,-42) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0n0) {$p!$\,\ifntiny{\tiny 14617}\fi};
\node[state] at (0,-2) (n0) {$p?$\,\ifntiny{\tiny 14744}\fi};
\node[state] at (4,-2) (n1) {$p?$\,\ifntiny{\tiny 14770}\fi};
\node[state] at (5,-22) (n1n0n0n1n0n0n1n0n0n0n0) {$\cup$\,\ifntiny{\tiny 14759}\fi};
\node[state] at (2,-14) (n1n0n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 14750}\fi};
\node[accepting, state] at (6,-32) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0) {$p?$\,\ifntiny{\tiny 14622}\fi};
\node[state] at (7,-20) (n1n0n0n1n0n0n1n0n0n1) {$p?$\,\ifntiny{\tiny 14761}\fi};
\node[accepting, state] at (6,-36) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0) {$p?$\,\ifntiny{\tiny 14620}\fi};
\node[state] at (5,-16) (n1n0n0n1n0n0n1n0) {$p?$\,\ifntiny{\tiny 14763}\fi};
\node[state] at (5,-14) (n1n0n0n1n0n0n1) {$p?$\,\ifntiny{\tiny 14764}\fi};
\node[accepting, state] at (6,-34) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 14621}\fi};
\node[initial, state] at (4,0) (n) {$\cup$\,\ifntiny{\tiny 14771}\fi};
\node[accepting, state] at (6,-28) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1) {$p?$\,\ifntiny{\tiny 14624}\fi};
\node[accepting, state] at (6,-30) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0) {$p?$\,\ifntiny{\tiny 14623}\fi};
\node[state] at (5,-26) (n1n0n0n1n0n0n1n0n0n0n0n1n0) {$\cup$\,\ifntiny{\tiny 14757}\fi};
\node[state] at (5,-8) (n1n0n0n1) {$p?$\,\ifntiny{\tiny 14767}\fi};
\node[state] at (5,-20) (n1n0n0n1n0n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 14760}\fi};
\node[accepting, state] at (6,-40) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 14618}\fi};
\node[state] at (5,-18) (n1n0n0n1n0n0n1n0n0) {$\cup$\,\ifntiny{\tiny 14762}\fi};
\node[accepting, state] at (6,-38) (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 14619}\fi};
\node[state] at (1,-8) (n1n0n0n0) {$p?$\,\ifntiny{\tiny 14747}\fi};
\node[state] at (5,-10) (n1n0n0n1n0) {$p?$\,\ifntiny{\tiny 14766}\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, right, bend right] node {a} (n);
\draw[->, thick] (n1) edge [near start, left] node {b} (n1n0);
\draw[->, thick] (n1n0) edge [near start, left] node {a} (n1n0n0);
\draw[->, thick] (n1n0n0) edge [near start, left] node {} (n1n0n0n0);
\draw[->, thick] (n1n0n0) edge [near start, left] node {} (n1n0n0n1);
\draw[->, thick] (n1n0n0n0) edge [near start, right, bend right] node {a} (n);
\draw[->, thick] (n1n0n0n1) edge [near start, left] node {b} (n1n0n0n1n0);
\draw[->, thick] (n1n0n0n1n0) edge [near start, left] node {a} (n1n0n0n1n0n0);
\draw[->, thick] (n1n0n0n1n0n0) edge [near start, left] node {} (n1n0n0n1n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0) edge [near start, left] node {} (n1n0n0n1n0n0n1);
\draw[->, thick] (n1n0n0n1n0n0n0) edge [near start, right, bend right] node {a} (n);
\draw[->, thick] (n1n0n0n1n0n0n1) edge [near start, left] node {b} (n1n0n0n1n0n0n1n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0) edge [near start, left] node {a} (n1n0n0n1n0n0n1n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0) edge [near start, left] node {} (n1n0n0n1n0n0n1n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0) edge [near start, left] node {} (n1n0n0n1n0n0n1n0n0n1);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0) edge [near start, left] node {a} (n1n0n0n1n0n0n1n0n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0) edge [near start, left] node {} (n1n0n0n1n0n0n1n0n0n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0) edge [near start, left] node {} (n1n0n0n1n0n0n1n0n0n0n0n1);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n0) edge [near start, right, bend right] node {a} (n);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1) edge [near start, left] node {b} (n1n0n0n1n0n0n1n0n0n0n0n1n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0) edge [near start, left] node {} (n1n0n0n1n0n0n1n0n0n0n0n1n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0) edge [near start, left] node {} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n0) edge [near start, right, bend right] node {a} (n1n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1) edge [near start, left] node {a} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0) edge [near start, left] node {b} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0) edge [near start, left] node {a} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0) edge [near start, left] node {b} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0) edge [near start, left] node {a} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0) edge [near start, left] node {a} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0) edge [near start, left] node {b} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0n0);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0n0) edge [near start, right, bend right] node {x} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n0n0n1n0n1n0n0n0n0n0n0n0) edge [near start, right, bend right] node {y} (n1n0n0n1n0n0n1n0n0n0n0n1n0n1);
\draw[->, thick] (n1n0n0n1n0n0n1n0n0n1) edge [near start, left, bend left] node {b} (n1n0n0n1n0n0n1n0);

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