
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Graphical Calculus Program GRCALC2.STY
% by B. Pareigis 
% use only with LATEX2E
% last update: 16. Sep. 1998
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 \newcount\grcalca
 \newcount\grcalcb
 \newcount\grcalcc
 \newcount\grcalcd
 \newcount\grcalce
 \newcount\grcalcf
 \newcount\grcalcg
 \newcount\grcalch
 \newcount\grcalci
 \newcount\grrow
 \newcount\grcolumn
 \newcount\grwidth
 \newcount\factor
 \newcount\hfactor
 \newcount\qfactor
 \newcount\tfactor
 \newcount\sfactor
 \newcount\dfactor
 \factor  = 12
 \hfactor = \factor
 \divide    \hfactor by 2
 \qfactor = \hfactor
 \divide    \qfactor by 2
 \tfactor = \factor
 \divide    \tfactor by 3
 \sfactor = \factor
 \divide    \sfactor by 6
 \dfactor = \factor
 \divide    \dfactor by 12

 \newcommand{\gbeg}[2]{
   \unitlength=1pt
   \grrow = #2
   \grcolumn = 0
   \grcalca = #1
   \grcalcb = #2
   \multiply \grcalca by \factor
   \grwidth = \grcalca
   \multiply \grcalcb by \factor
   \begin{minipage}{\grcalca pt}
   \begin{picture}(\grcalca,\grcalcb)
   \advance \grcalcb by -\factor
   \put(0, \grcalcb){\line(1,0){\grwidth}} }


 \newcommand{\gend}{
   \put(0, \factor){\line(1,0){\grwidth}}
   \end{picture}
   {\vskip2.5ex}
   \end{minipage} }

 \newcommand{\gnl}{
   \advance \grrow by -1
   \grcolumn = 0}

 \newcommand{\gvac}[1]{       
   \advance \grcolumn by #1}

 \newcommand{\gcl}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = #1
   \multiply \grcalcc by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\gcn}[4]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalci = #3
   \multiply \grcalci by \hfactor
   \advance \grcalca by \grcalci
   \grcalcb = \grcolumn
   \multiply \grcalcb by \factor 
   \grcalci = #3
   \advance \grcalci by #4
   \multiply \grcalci by \qfactor
   \advance \grcalcb by \grcalci
   \grcalcc = \grcolumn
   \multiply \grcalcc by \factor
   \grcalci = #4
   \multiply \grcalci by \hfactor
   \advance \grcalcc by \grcalci
   \grcalcd = \grrow
   \multiply \grcalcd by \factor 
   \grcalce = \grrow
   \multiply \grcalce by \factor 
   \grcalci = #2
   \multiply \grcalci by \tfactor
   \advance \grcalce by -\grcalci
   \grcalcf = \grrow
   \multiply \grcalcf by \factor 
   \grcalci = #2
   \multiply \grcalci by \hfactor
   \advance \grcalcf by -\grcalci
   \grcalcg = \grrow
   \multiply \grcalcg by \factor 
   \grcalci = #2
   \multiply \grcalci by \tfactor
   \multiply \grcalci by 2
   \advance \grcalcg by -\grcalci
   \grcalch = \grrow
   \advance \grcalch by -#2
   \multiply \grcalch by \factor 
   \qbezier(\grcalca,\grcalcd)(\grcalca,\grcalce)(\grcalcb,\grcalcf) 
   \qbezier(\grcalcb,\grcalcf)(\grcalcc,\grcalcg)(\grcalcc,\grcalch) 
   \advance \grcolumn by #1}

 \newcommand{\gnot}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\hfactor
   \put(\grcalca,\grcalcb) {\makebox(0,0){$\scriptstyle #1$}} }

 \newcommand{\got}[2]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcc = #1
   \multiply \grcalcc by \hfactor
   \advance \grcalca by \grcalcc
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\tfactor
   \advance \grcalcb by -\tfactor
   \put(\grcalca,\grcalcb){\makebox(0,0)[b]{$#2$}}
   \advance \grcolumn by #1}

 \newcommand{\gob}[2]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcc = #1
   \multiply \grcalcc by \hfactor
   \advance \grcalca by \grcalcc
   \put(\grcalca,0){\makebox(0,0)[b]{$#2$}}
   \advance \grcolumn by #1}

 \newcommand{\gmu}{  
   \grcalca = \grcolumn
   \advance \grcalca by 1
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \put(\grcalca,\grcalcb){\oval(\factor,\grcalcc)[b]}
   \advance \grcalcb by -\hfactor
   \advance \grcalcb by -\qfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by 2}

 \newcommand{\gcmu}{   
   \grcalca = \grcolumn
   \advance \grcalca by 1
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \advance \grcalcb by -1
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \put(\grcalca,\grcalcb){\oval(\factor,\grcalcc)[t]}
   \advance \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by 2}

 \newcommand{\glm}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grcalca
   \advance \grcalcb by \factor
   \grcalcc = \grrow
   \multiply \grcalcc by \factor
   \grcalcd = \grcalcc
   \advance \grcalcd by -\tfactor
   \grcalce = \grcalcd
   \advance \grcalce by -\tfactor
   \put(\grcalca, \grcalcc){\line(0,-1){\tfactor}}
   \put(\grcalca, \grcalcd){\line(1,0){\factor}}
   \put(\grcalca, \grcalcd){\line(3,-1){\factor}}
   \put(\grcalcb, \grcalcc){\line(0,-1){\factor}}
   \advance \grcolumn by 2}

 \newcommand{\grm}{
   \grcalcb = \grcolumn
   \multiply \grcalcb by \factor
   \advance \grcalcb by \hfactor
   \grcalca = \grcalcb
   \advance \grcalca by \factor
   \grcalcc = \grrow
   \multiply \grcalcc by \factor
   \grcalcd = \grcalcc
   \advance \grcalcd by -\tfactor
   \grcalce = \grcalcd
   \advance \grcalce by -\tfactor
   \put(\grcalca, \grcalcc){\line(0,-1){\tfactor}}
   \put(\grcalca, \grcalcd){\line(-1,0){\factor}}
   \put(\grcalca, \grcalcd){\line(-3,-1){\factor}}
   \put(\grcalcb, \grcalcc){\line(0,-1){\factor}}
   \advance \grcolumn by 2}

 \newcommand{\glcm}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grcalca
   \advance \grcalcb by \factor
   \grcalcc = \grrow
   \advance \grcalcc by -1
   \multiply \grcalcc by \factor
   \grcalcd = \grcalcc
   \advance \grcalcd by \tfactor
   \grcalce = \grcalcd
   \advance \grcalce by \tfactor
   \put(\grcalca, \grcalcc){\line(0,1){\tfactor}}
   \put(\grcalca, \grcalcd){\line(1,0){\factor}}
   \put(\grcalca, \grcalcd){\line(3,1){\factor}}
   \put(\grcalcb, \grcalcc){\line(0,1){\factor}}
   \advance \grcolumn by 2}

 \newcommand{\grcm}{
   \grcalcb = \grcolumn
   \multiply \grcalcb by \factor
   \advance \grcalcb by \hfactor
   \grcalca = \grcalcb
   \advance \grcalca by \factor
   \grcalcc = \grrow
   \advance \grcalcc by -1
   \multiply \grcalcc by \factor
   \grcalcd = \grcalcc
   \advance \grcalcd by \tfactor
   \grcalce = \grcalcd
   \advance \grcalce by \tfactor
   \put(\grcalca, \grcalcc){\line(0,1){\tfactor}}
   \put(\grcalca, \grcalcd){\line(-1,0){\factor}}
   \put(\grcalca, \grcalcd){\line(-3,1){\factor}}
   \put(\grcalcb, \grcalcc){\line(0,1){\factor}}
   \advance \grcolumn by 2}

 \newcommand{\gwmu}[1]{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \factor
   \put(\grcalca,\grcalcb){\oval(\grcalcd,\grcalcc)[b]}
   \advance \grcalcb by -\hfactor
   \advance \grcalcb by -\qfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by #1}

 \newcommand{\gwcm}[1]{   
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcb = \grrow
   \advance \grcalcb by -1
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \factor
   \put(\grcalca,\grcalcb){\oval(\grcalcd,\grcalcc)[t]}
   \advance \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by #1}

 \newcommand{\gwmuc}[1]{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = #1
   \advance \grcalcc by -1
   \multiply \grcalcc by \factor
   \put(\grcalca,\grcalcb){\line(1,0){\grcalcc}}
   \advance \grcalca by -\hfactor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \factor
   \put(\grcalca,\grcalcb){\oval(\grcalcd,\grcalcc)[b]}
   \advance \grcalcb by -\hfactor
   \advance \grcalcb by -\qfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by #1}

 \newcommand{\gwcmc}[1]{   
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\factor
   \grcalcc = #1
   \advance \grcalcc by -1
   \multiply \grcalcc by \factor
   \put(\grcalca,\grcalcb){\line(1,0){\grcalcc}}
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \hfactor
   \advance \grcalca by \grcalcd
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \factor
   \put(\grcalca,\grcalcb){\oval(\grcalcd,\grcalcc)[t]}
   \advance \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by #1}

 \newcommand{\gev}{  
   \grcalca = \grcolumn
   \advance \grcalca by 1
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \put(\grcalca,\grcalcb){\oval(\factor,\grcalcc)[b]}
   \advance \grcolumn by 2}

 \newcommand{\gdb}{   
   \grcalca = \grcolumn
   \advance \grcalca by 1
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \advance \grcalcb by -1
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \put(\grcalca,\grcalcb){\oval(\factor,\grcalcc)[t]}
   \advance \grcolumn by 2}

 \newcommand{\gwev}[1]{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \factor
   \put(\grcalca,\grcalcb){\oval(\grcalcd,\grcalcc)[b]}
   \advance \grcolumn by #1}

 \newcommand{\gwdb}[1]{   
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcb = \grrow
   \advance \grcalcb by -1
   \multiply \grcalcb by \factor
   \grcalcc = \factor
   \advance \grcalcc by \hfactor
   \grcalcd = #1
   \advance \grcalcd by -1
   \multiply \grcalcd by \factor
   \put(\grcalca,\grcalcb){\oval(\grcalcd,\grcalcc)[t]}
   \advance \grcolumn by #1}

 \newcommand{\gbr}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grcalca
   \advance \grcalcb by \hfactor
   \grcalcc = \grcalca
   \advance \grcalcc by \factor
   \grcalcd = \grrow
   \multiply \grcalcd by \factor
   \grcalce = \grcalcd
   \advance \grcalce by -\tfactor
   \grcalcf = \grcalcd
   \advance \grcalcf by -\hfactor
   \grcalcg = \grcalce
   \advance \grcalcg by -\tfactor
   \grcalch = \grcalcd
   \advance \grcalch by -\factor
   \qbezier(\grcalca,\grcalcd)(\grcalca,\grcalce)(\grcalcb,\grcalcf) 
   \qbezier(\grcalcb,\grcalcf)(\grcalcc,\grcalcg)(\grcalcc,\grcalch) 
   \advance \grcalcf by -\dfactor
   \advance \grcalcb by -\sfactor
   \qbezier(\grcalca,\grcalch)(\grcalca,\grcalcg)(\grcalcb,\grcalcf) 
   \advance \grcalcf by \sfactor
   \advance \grcalcb by \tfactor
   \qbezier(\grcalcc,\grcalcd)(\grcalcc,\grcalce)(\grcalcb,\grcalcf) 
   \advance \grcolumn by 2}

 \newcommand{\gibr}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grcalca
   \advance \grcalcb by \hfactor
   \grcalcc = \grcalca
   \advance \grcalcc by \factor
   \grcalcd = \grrow
   \multiply \grcalcd by \factor
   \grcalce = \grcalcd
   \advance \grcalce by -\tfactor
   \grcalcf = \grcalcd
   \advance \grcalcf by -\hfactor
   \grcalcg = \grcalce
   \advance \grcalcg by -\tfactor
   \grcalch = \grcalcd
   \advance \grcalch by -\factor
   \qbezier(\grcalcc,\grcalcd)(\grcalcc,\grcalce)(\grcalcb,\grcalcf) 
   \qbezier(\grcalcb,\grcalcf)(\grcalca,\grcalcg)(\grcalca,\grcalch) 
   \advance \grcalcf by -\dfactor
   \advance \grcalcb by \sfactor
   \qbezier(\grcalcc,\grcalch)(\grcalcc,\grcalcg)(\grcalcb,\grcalcf) 
   \advance \grcalcf by \sfactor
   \advance \grcalcb by -\tfactor
   \qbezier(\grcalca,\grcalcd)(\grcalca,\grcalce)(\grcalcb,\grcalcf) 
   \advance \grcolumn by 2}

 \newcommand{\gbrc}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grcalca
   \advance \grcalcb by \hfactor
   \grcalcc = \grcalca
   \advance \grcalcc by \factor
   \grcalcd = \grrow
   \multiply \grcalcd by \factor
   \grcalce = \grcalcd
   \advance \grcalce by -\tfactor
   \grcalcf = \grcalcd
   \advance \grcalcf by -\hfactor
   \grcalcg = \grcalce
   \advance \grcalcg by -\tfactor
   \grcalch = \grcalcd
   \advance \grcalch by -\factor
   \put(\grcalcb,\grcalcf){\circle{\hfactor}}
   \qbezier(\grcalca,\grcalcd)(\grcalca,\grcalce)(\grcalcb,\grcalcf) 
   \qbezier(\grcalcb,\grcalcf)(\grcalcc,\grcalcg)(\grcalcc,\grcalch) 
   \advance \grcalcf by -\dfactor
   \advance \grcalcb by -\sfactor
   \qbezier(\grcalca,\grcalch)(\grcalca,\grcalcg)(\grcalcb,\grcalcf) 
   \advance \grcalcf by \sfactor
   \advance \grcalcb by \tfactor
   \qbezier(\grcalcc,\grcalcd)(\grcalcc,\grcalce)(\grcalcb,\grcalcf) 
   \advance \grcolumn by 2}

 \newcommand{\gibrc}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grcalca
   \advance \grcalcb by \hfactor
   \grcalcc = \grcalca
   \advance \grcalcc by \factor
   \grcalcd = \grrow
   \multiply \grcalcd by \factor
   \grcalce = \grcalcd
   \advance \grcalce by -\tfactor
   \grcalcf = \grcalcd
   \advance \grcalcf by -\hfactor
   \grcalcg = \grcalce
   \advance \grcalcg by -\tfactor
   \grcalch = \grcalcd
   \advance \grcalch by -\factor
   \put(\grcalcb,\grcalcf){\circle{\hfactor}}
   \qbezier(\grcalcc,\grcalcd)(\grcalcc,\grcalce)(\grcalcb,\grcalcf) 
   \qbezier(\grcalcb,\grcalcf)(\grcalca,\grcalcg)(\grcalca,\grcalch) 
   \advance \grcalcf by -\dfactor
   \advance \grcalcb by \sfactor
   \qbezier(\grcalcc,\grcalch)(\grcalcc,\grcalcg)(\grcalcb,\grcalcf) 
   \advance \grcalcf by \sfactor
   \advance \grcalcb by -\tfactor
   \qbezier(\grcalca,\grcalcd)(\grcalca,\grcalce)(\grcalcb,\grcalcf) 
   \advance \grcolumn by 2}

 \newcommand{\gu}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcb = \grrow
   \advance \grcalcb by -1
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,1){\hfactor}} 
   \advance \grcalcb by \hfactor
   \put(\grcalca,\grcalcb) {\circle*{3}}
   \advance \grcolumn by #1}

 \newcommand{\gcu}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcd = \hfactor
   \multiply \grcalcd by #1
   \advance \grcalca by \grcalcd
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\hfactor}} 
   \advance \grcalcb by -\hfactor
   \put(\grcalca,\grcalcb) {\circle*{3}}
   \advance \grcolumn by #1}

 \newcommand{\gmp}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalcb by \hfactor
   \grcalcc = \factor
   \advance \grcalcc by -\qfactor
   \put(\grcalca,\grcalcb) {\circle{\grcalcc}}
   \put(\grcalca,\grcalcb) {\makebox(0,0){$\scriptstyle #1$}}
   \advance \grcolumn by 1}

 \newcommand{\gbmp}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by \dfactor
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\framebox(\grcalcc,\grcalcc){$\scriptstyle #1$}}
   \advance \grcolumn by 1}

 \newcommand{\gbmpt}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
%   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by \dfactor
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\framebox(\grcalcc,\grcalcc){$\scriptstyle #1$}}
   \advance \grcolumn by 1}

 \newcommand{\gbmpb}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
%   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by \dfactor
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\framebox(\grcalcc,\grcalcc){$\scriptstyle #1$}}
   \advance \grcolumn by 1}

 \newcommand{\gbmpn}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
%   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
%   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by \dfactor
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\framebox(\grcalcc,\grcalcc){$\scriptstyle #1$}}
   \advance \grcolumn by 1}

 \newcommand{\glmptb}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\glmpt}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by -\dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by -\factor
   \advance \grcalcb by \sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\glmpb}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalca by \dfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\glmp}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \dfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by -\factor
   \advance \grcalcb by \sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\gcmptb}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcolumn by 1}

 \newcommand{\gcmpt}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \advance \grcalca by -\hfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcolumn by 1}

 \newcommand{\gcmpb}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by -\hfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcolumn by 1}

 \newcommand{\gcmp}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\factor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(1,0){\factor}} 
   \advance \grcolumn by 1}

 \newcommand{\grmptb}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by \hfactor
   \advance \grcalca by -\dfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\grmpt}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\dfactor}} 
   \advance \grcalca by \hfactor
   \advance \grcalca by -\dfactor
   \advance \grcalcb by -\dfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \advance \grcalcb by -\factor
   \advance \grcalcb by \sfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\grmpb}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \hfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\factor
   \put(\grcalca,\grcalcb) {\line(0,1){\dfactor}} 
   \advance \grcalca by \hfactor
   \advance \grcalca by -\dfactor
   \advance \grcalcb by \dfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \advance \grcalcb by \factor
   \advance \grcalcb by -\sfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\grcalcc}} 
   \advance \grcolumn by 1}

 \newcommand{\grmp}{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \advance \grcalca by \factor
   \advance \grcalca by -\dfactor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\dfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \advance \grcalcb by -\factor
   \advance \grcalcb by \sfactor
   \put(\grcalca,\grcalcb) {\line(-1,0){\factor}} 
   \grcalcc = \factor
   \advance \grcalcc by -\sfactor
   \put(\grcalca,\grcalcb) {\line(0,1){\grcalcc}} 
   \advance \grcolumn by 1}


 \newcommand{\gwmuh}[3]{    
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcb = #2
   \advance \grcalcb by #3
   \multiply \grcalcb by \qfactor
   \advance \grcalca by \grcalcb
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = #3
   \advance \grcalcc by -#2
   \multiply \grcalcc by \hfactor
   \grcalcd = \factor
   \advance \grcalcd by \hfactor
   \put(\grcalca,\grcalcb){\oval(\grcalcc,\grcalcd)[b]}
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcc = #1
   \multiply \grcalcc by \hfactor
   \advance \grcalca by \grcalcc
   \advance \grcalcb by -\hfactor
   \advance \grcalcb by -\qfactor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by #1}

 \newcommand{\gwcmh}[3]{   
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcb = #2
   \advance \grcalcb by #3
   \multiply \grcalcb by \qfactor
   \advance \grcalca by \grcalcb
   \grcalcb = \grrow
   \advance \grcalcb by -1
   \multiply \grcalcb by \factor
   \grcalcc = #3
   \advance \grcalcc by -#2
   \multiply \grcalcc by \hfactor
   \grcalcd = \factor
   \advance \grcalcd by \hfactor
   \put(\grcalca,\grcalcb){\oval(\grcalcc,\grcalcd)[t]}
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcc = #1
   \multiply \grcalcc by \hfactor
   \advance \grcalca by \grcalcc
   \advance \grcalcb by \factor
   \put(\grcalca,\grcalcb) {\line(0,-1){\qfactor}} 
   \advance \grcolumn by #1}

 \newcommand{\gsbox}[1]{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \advance \grcalcb by -\factor
   \grcalcc = #1
   \multiply \grcalcc by \factor
   \grcalcd = \factor
   \put(\grcalca,\grcalcb){\framebox(\grcalcc,\grcalcd){}}}

 \newcommand{\ghline}[1]{
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \grcalcc = #1
   \multiply \grcalcc by \factor
   \put(0, \grcalcb){\line(1,0){\grcalcc}} }

 \newcommand{\gvline}{
   \grcalca = \grcolumn
   \multiply \grcalca by \factor
   \grcalcb = \grrow
   \multiply \grcalcb by \factor
   \thicklines
   \put(\grcalca, \grcalcb){\line(0,-1){\factor}}
   \thinlines }


