Printing an element of a non-numeric array as the node label

I want to retrieve a member of a non-numeric array passed to a TikZ pic as an argument, to use it as a node label. \foreach easily does it while iterating over the array, but I cannot do it for the individual elements. The following are my two attempts that fail miserably:

\documentclass[tikz]{standalone}

\begin{document}

\tikzset{
pics/mypic/.style n args={1}{
code={
\foreach \a [count=\i] in {#1}{
\node at (\i, 1) {$\a$};
}

% Attempt 1: Doesn't work
% \node at (1, 2) {$#1[0]$};

% Attempt 2: Doesn't compile
}
}
}

\tikz{\pic {mypic={\mathtt{a},\mathtt{b},\mathtt{c}};}}
\tikz{\pic {mypic={a,b,c};}}
\tikz{\pic {mypic={0,1,2};}}
\tikz{\pic {mypic={0,a,2};}}

\end{document}
`

Output: