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

\node[accepting, state] at (7,-2) (n1) {$p?$\,\ifntiny{\tiny 16210}\fi};
\node[accepting, state] at (9,-4) (n2n0) {$p?$\,\ifntiny{\tiny 16184}\fi};
\node[accepting, state] at (6,-4) (n1n0) {$p!$\,\ifntiny{\tiny 16204}\fi};
\node[accepting, state] at (5,-6) (n0n1n1) {$p?$\,\ifntiny{\tiny 16327}\fi};
\node[initial, state] at (5,0) (n) {$\cup$\,\ifntiny{\tiny 16864}\fi};
\node[state] at (1,-4) (n0n0) {$\cup$\,\ifntiny{\tiny 16861}\fi};
\node[state] at (4,-4) (n0n1) {$\cup$\,\ifntiny{\tiny 16862}\fi};
\node[state] at (3,-2) (n0) {$p?$\,\ifntiny{\tiny 16863}\fi};
\node[accepting, state] at (9,-2) (n2) {$p!$\,\ifntiny{\tiny 16185}\fi};
\node[accepting, state] at (1,-8) (n0n0n1n0) {$p!$\,\ifntiny{\tiny 16294}\fi};
\node[accepting, state] at (2,-8) (n0n0n1n1) {$p!$\,\ifntiny{\tiny 16303}\fi};
\node[accepting, state] at (4,-8) (n0n1n1n0) {$p!$\,\ifntiny{\tiny 16317}\fi};
\node[accepting, state] at (5,-8) (n0n1n1n1) {$p!$\,\ifntiny{\tiny 16326}\fi};
\node[accepting, state] at (2,-6) (n0n0n1) {$p?$\,\ifntiny{\tiny 16304}\fi};
\node[accepting, state] at (7,-4) (n1n1) {$p!$\,\ifntiny{\tiny 16209}\fi};

\draw[->, thick] (n) edge [near start, left] node {} (n0);
\draw[->, thick] (n) edge [near start, left] node {} (n1);
\draw[->, thick] (n) edge [near start, left] node {} (n2);
\draw[->, thick] (n0) edge [near start, left] node {b} (n0n0);
\draw[->, thick] (n0) edge [near start, left] node {d} (n0n1);
\draw[->, thick] (n0n0) edge [near start, right, bend right] node {} (n0);
\draw[->, thick] (n0n0) edge [near start, left] node {} (n0n0n1);
\draw[->, thick] (n0n0n1) edge [near start, left] node {b} (n0n0n1n0);
\draw[->, thick] (n0n0n1) edge [near start, left] node {d} (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, bend left] node {} (n0);
\draw[->, thick] (n0n1) edge [near start, left] node {} (n0n1n1);
\draw[->, thick] (n0n1n1) edge [near start, left] node {b} (n0n1n1n0);
\draw[->, thick] (n0n1n1) edge [near start, left] node {d} (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 {b} (n1n0);
\draw[->, thick] (n1) edge [near start, left] node {d} (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);
\draw[->, thick] (n2) edge [near start, left] node {a} (n2n0);
\draw[->, thick] (n2n0) edge [near start, right, bend right] node {b} (n2);
\draw[->, thick] (n2n0) edge [near start, right, bend right] node {d} (n2);

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