\node[] (i0j0) at (-1, -1) {x};
\node[] (i1j0) at (1, -1)  {y};
\node[] (i0j1) at (-1, 1)  {x};
\node[] (i1j1) at (1, 1)   {z};

\node (in) at (0, 0) {};

\draw[->]        (i0j0) -- (i0j1) node [midway] {$a$};
\draw[->]        (i0j0) -- (i1j0) node [midway, below] {$p(i)$};
\draw[->,dashed] (i0j1) -- (i1j1) node [midway] {};
\draw[->]        (i1j0) -- (i1j1) node [midway, right] {$q(j)$};