\documentclass{article}
\usepackage{a4wide}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{automata}
\usepackage{datetime}
\lhead{./certificates/march3testa1-march3testa2/sim-508.tex}
\rhead{09:48:10.580 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 = 16
\begin{tikzpicture}[rotate = 0]
%\begin{tikzpicture}[rotate = 90]
\tikzset{initial text=$ $}

\node[state] at (5,-2) (n1) {$p?$\,\ifntiny{\tiny 4210}\fi};
\node[accepting, state] at (12,-4) (n2n0) {$p?$\,\ifntiny{\tiny 1801}\fi};
\node[accepting, state] at (13,-6) (n2n0n1) {$p?$\,\ifntiny{\tiny 1800}\fi};
\node[accepting, state] at (5,-6) (n1n0n1) {$p?$\,\ifntiny{\tiny 1987}\fi};
\node[state] at (4,-4) (n1n0) {$\cup$\,\ifntiny{\tiny 4209}\fi};
\node[accepting, state] at (5,-8) (n1n0n1n0) {$p?$\,\ifntiny{\tiny 1986}\fi};
\node[accepting, state] at (6,-10) (n1n0n1n0n1) {$p?$\,\ifntiny{\tiny 1985}\fi};
\node[initial, state] at (7,0) (n) {$\cup$\,\ifntiny{\tiny 4211}\fi};
\node[state] at (8,-4) (n1n1) {$p?$\,\ifntiny{\tiny 4212}\fi};
\node[state] at (1,-6) (n1n0n0) {$p?$\,\ifntiny{\tiny 4208}\fi};
\node[state] at (0,-2) (n0) {$p?$\,\ifntiny{\tiny 4206}\fi};
\node[accepting, state] at (10,-6) (n2n0n0) {$p!$\,\ifntiny{\tiny 1788}\fi};
\node[accepting, state] at (3,-10) (n1n0n1n0n0) {$p!$\,\ifntiny{\tiny 1968}\fi};
\node[accepting, state] at (6,-12) (n1n0n1n0n1n0) {$p!$\,\ifntiny{\tiny 1984}\fi};
\node[accepting, state] at (13,-8) (n2n0n1n0) {$p!$\,\ifntiny{\tiny 1799}\fi};
\node[accepting, state] at (12,-2) (n2) {$p?$\,\ifntiny{\tiny 1802}\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, right, bend right] node {a} (n);
\draw[->, thick] (n1) edge [near start, left] node {a} (n1n0);
\draw[->, thick] (n1) edge [near start, left] node {b} (n1n1);
\draw[->, thick] (n1n0) edge [near start, left] node {} (n1n0n0);
\draw[->, thick] (n1n0) edge [near start, left] node {} (n1n0n1);
\draw[->, thick] (n1n0n0) edge [near start, right, bend right] node {a} (n);
\draw[->, thick] (n1n0n1) edge [near start, left] node {a} (n1n0n1n0);
\draw[->, thick] (n1n0n1n0) edge [near start, left] node {a} (n1n0n1n0n0);
\draw[->, thick] (n1n0n1n0) edge [near start, left] node {b} (n1n0n1n0n1);
\draw[->, thick] (n1n0n1n0n0) edge [near start, right, bend right] node {x1} (n1n0n1);
\draw[->, thick] (n1n0n1n0n0) edge [near start, right, bend right] node {x2} (n1n0n1);
\draw[->, thick] (n1n0n1n0n0) edge [near start, right, bend right] node {x3} (n1n0n1);
\draw[->, thick] (n1n0n1n0n1) edge [near start, left] node {a} (n1n0n1n0n1n0);
\draw[->, thick] (n1n0n1n0n1n0) edge [near start, left, bend left] node {x1} (n1n0n1);
\draw[->, thick] (n1n0n1n0n1n0) edge [near start, left, bend left] node {x2} (n1n0n1);
\draw[->, thick] (n1n0n1n0n1n0) edge [near start, left, bend left] node {x3} (n1n0n1);
\draw[->, thick] (n1n1) edge [near start, left, bend left] node {a} (n);
\draw[->, thick] (n2) edge [near start, left] node {a} (n2n0);
\draw[->, thick] (n2n0) edge [near start, left] node {a} (n2n0n0);
\draw[->, thick] (n2n0) edge [near start, left] node {b} (n2n0n1);
\draw[->, thick] (n2n0n0) edge [near start, right, bend right] node {x1} (n2);
\draw[->, thick] (n2n0n0) edge [near start, right, bend right] node {x2} (n2);
\draw[->, thick] (n2n0n0) edge [near start, right, bend right] node {x3} (n2);
\draw[->, thick] (n2n0n1) edge [near start, left] node {a} (n2n0n1n0);
\draw[->, thick] (n2n0n1n0) edge [near start, left, bend left] node {x1} (n2);
\draw[->, thick] (n2n0n1n0) edge [near start, left, bend left] node {x2} (n2);
\draw[->, thick] (n2n0n1n0) edge [near start, left, bend left] node {x3} (n2);

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