\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-8.tex}
\rhead{11:11:14.064 on 2025-03-31}
\fancyfoot{}
\begin{document}
\newif\ifntiny
%\ntinyfalse
\ntinytrue
\thispagestyle{fancy}
\begin{center}
\maxsizebox{!}{0.475\textheight}{
\minsizebox{\textwidth}{!}{
\begin{tabular}{@{}c@{}}
% node count = 34
\begin{tikzpicture}[rotate = 0]
%\begin{tikzpicture}[rotate = 90]
\tikzset{initial text=$ $}

\node[accepting, state] at (7,-36) (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 950}\fi};
\node[accepting, state] at (7,-24) (n0n1n0n0n0n0n0n1n0n1n0n1) {$p?$\,\ifntiny{\tiny 956}\fi};
\node[state] at (8,-14) (n0n1n0n0n1n0n0) {$p?$\,\ifntiny{\tiny 5693}\fi};
\node[state] at (4,-20) (n0n1n0n0n0n0n0n1n0n0) {$p?$\,\ifntiny{\tiny 5676}\fi};
\node[accepting, state] at (7,-34) (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 951}\fi};
\node[accepting, state] at (7,-26) (n0n1n0n0n0n0n0n1n0n1n0n1n0) {$p?$\,\ifntiny{\tiny 955}\fi};
\node[state] at (9,-10) (n0n1n0n0n1) {$p?$\,\ifntiny{\tiny 5698}\fi};
\node[accepting, state] at (7,-32) (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0) {$p?$\,\ifntiny{\tiny 952}\fi};
\node[state] at (5,-16) (n0n1n0n0n0n0n0n1) {$p?$\,\ifntiny{\tiny 5685}\fi};
\node[accepting, state] at (7,-38) (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0n0) {$p!$\,\ifntiny{\tiny 949}\fi};
\node[state] at (5,-14) (n0n1n0n0n0n0n0) {$\cup$\,\ifntiny{\tiny 5686}\fi};
\node[accepting, state] at (7,-30) (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 953}\fi};
\node[state] at (4,-24) (n0n1n0n0n0n0n0n1n0n0n0n1) {$p?$\,\ifntiny{\tiny 5674}\fi};
\node[state] at (2,-16) (n0n1n0n0n0n0n0n0) {$p?$\,\ifntiny{\tiny 5663}\fi};
\node[state] at (6,-6) (n0n1n0) {$p?$\,\ifntiny{\tiny 5700}\fi};
\node[state] at (5,-12) (n0n1n0n0n0n0) {$p?$\,\ifntiny{\tiny 5687}\fi};
\node[state] at (4,-22) (n0n1n0n0n0n0n0n1n0n0n0) {$\cup$\,\ifntiny{\tiny 5675}\fi};
\node[accepting, state] at (7,-28) (n0n1n0n0n0n0n0n1n0n1n0n1n0n0) {$p?$\,\ifntiny{\tiny 954}\fi};
\node[initial, state] at (5,0) (n) {$p?$\,\ifntiny{\tiny 5703}\fi};
\node[state] at (0,-8) (n0n0n0n0) {$p?$\,\ifntiny{\tiny 5646}\fi};
\node[state] at (1,-6) (n0n0n0) {$\cup$\,\ifntiny{\tiny 5650}\fi};
\node[state] at (1,-4) (n0n0) {$p?$\,\ifntiny{\tiny 5651}\fi};
\node[state] at (6,-4) (n0n1) {$p?$\,\ifntiny{\tiny 5701}\fi};
\node[state] at (3,-24) (n0n1n0n0n0n0n0n1n0n0n0n0) {$p?$\,\ifntiny{\tiny 5671}\fi};
\node[state] at (5,-24) (n0n1n0n0n0n0n0n1n0n1n0n0) {$p?$\,\ifntiny{\tiny 5681}\fi};
\node[state] at (5,-18) (n0n1n0n0n0n0n0n1n0) {$\cup$\,\ifntiny{\tiny 5684}\fi};
\node[state] at (6,-8) (n0n1n0n0) {$\cup$\,\ifntiny{\tiny 5699}\fi};
\node[state] at (1,-8) (n0n0n0n1) {$p?$\,\ifntiny{\tiny 5649}\fi};
\node[state] at (9,-12) (n0n1n0n0n1n0) {$\cup$\,\ifntiny{\tiny 5697}\fi};
\node[state] at (5,-2) (n0) {$\cup$\,\ifntiny{\tiny 5702}\fi};
\node[state] at (9,-14) (n0n1n0n0n1n0n1) {$p?$\,\ifntiny{\tiny 5696}\fi};
\node[state] at (6,-20) (n0n1n0n0n0n0n0n1n0n1) {$p?$\,\ifntiny{\tiny 5683}\fi};
\node[state] at (6,-22) (n0n1n0n0n0n0n0n1n0n1n0) {$\cup$\,\ifntiny{\tiny 5682}\fi};
\node[state] at (5,-10) (n0n1n0n0n0) {$p?$\,\ifntiny{\tiny 5688}\fi};

\draw[->, thick] (n) edge [near start, left] node {a} (n0);
\draw[->, thick] (n0) edge [near start, left] node {} (n0n0);
\draw[->, thick] (n0) edge [near start, left] node {} (n0n1);
\draw[->, thick] (n0n0) edge [near start, left] node {a} (n0n0n0);
\draw[->, thick] (n0n0n0) edge [near start, left] node {} (n0n0n0n0);
\draw[->, thick] (n0n0n0) edge [near start, left] node {} (n0n0n0n1);
\draw[->, thick] (n0n0n0n0) edge [near start, right, bend right] node {a} (n0n0n0);
\draw[->, thick] (n0n0n0n1) edge [near start, right, bend right] node {b} (n);
\draw[->, thick] (n0n1) edge [near start, left] node {b} (n0n1n0);
\draw[->, thick] (n0n1n0) edge [near start, left] node {a} (n0n1n0n0);
\draw[->, thick] (n0n1n0n0) edge [near start, left] node {} (n0n1n0n0n0);
\draw[->, thick] (n0n1n0n0) edge [near start, left] node {} (n0n1n0n0n1);
\draw[->, thick] (n0n1n0n0n0) edge [near start, left] node {b} (n0n1n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0) edge [near start, left] node {a} (n0n1n0n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1);
\draw[->, thick] (n0n1n0n0n0n0n0n0) edge [near start, right, bend right] node {b} (n0n1n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1) edge [near start, left] node {a} (n0n1n0n0n0n0n0n1n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1n0n1);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n0) edge [near start, left] node {a} (n0n1n0n0n0n0n0n1n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n0n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n0n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1n0n0n0n1);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n0n0n0) edge [near start, right, bend right] node {a} (n0n1n0n0n0n0n0n1n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n0n0n1) edge [near start, right, bend right] node {b} (n);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1) edge [near start, left] node {b} (n0n1n0n0n0n0n0n1n0n1n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1n0n1n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0) edge [near start, left] node {} (n0n1n0n0n0n0n0n1n0n1n0n1);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n0) edge [near start, right, bend right] node {a} (n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1) edge [near start, left] node {a} (n0n1n0n0n0n0n0n1n0n1n0n1n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0) edge [near start, left] node {b} (n0n1n0n0n0n0n0n1n0n1n0n1n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0) edge [near start, left] node {a} (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0) edge [near start, left] node {b} (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0) edge [near start, left] node {a} (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0) edge [near start, left] node {a} (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0) edge [near start, left] node {b} (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0n0);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0n0) edge [near start, right, bend right] node {x} (n0n1n0n0n0n0n0n1n0n1n0n1);
\draw[->, thick] (n0n1n0n0n0n0n0n1n0n1n0n1n0n0n0n0n0n0n0) edge [near start, right, bend right] node {y} (n0n1n0n0n0n0n0n1n0n1n0n1);
\draw[->, thick] (n0n1n0n0n1) edge [near start, left] node {a} (n0n1n0n0n1n0);
\draw[->, thick] (n0n1n0n0n1n0) edge [near start, left] node {} (n0n1n0n0n1n0n0);
\draw[->, thick] (n0n1n0n0n1n0) edge [near start, left] node {} (n0n1n0n0n1n0n1);
\draw[->, thick] (n0n1n0n0n1n0n0) edge [near start, right, bend right] node {a} (n0n1n0n0n1n0);
\draw[->, thick] (n0n1n0n0n1n0n1) edge [near start, left, bend left] node {b} (n);

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