%author: BB
\documentclass[11pt]{article} 
\input shared.texm 
\startfile
\psset{unit=1}
\begin{pspicture}(-5,-0.5)(5,2)
\def\xa{2}\def\xb{4}
\def\NN#1#2{\rput(#1,0){$q_{#2}$}\cnode(#1,0){0.4}{q#2}}
\NN{-\xb}{0}
\NN{-\xa}{1}
\NN{0}{2}
\NN{\xa}{3}
\NN{\xb}{4}
\psset{arrows=->}
\ncline{q0}{q1}\aput{0.5}{a}
\ncline{q1}{q2}\aput{0.5}{a}
\ncline{q2}{q3}\aput{0.5}{b}
\ncline{q3}{q4}\aput{0.5}{a}
\pscircle(4,0){0.5}
\psset{labelsep=0.1pt}
\nccircle[arcangleA=30,arcangleB=120]{q0}{0.6}\bput{0.5}{$a,b$}
\end{pspicture}\endfile
