Let $F(p,d)$ denotes the set of all functions from $\{1,\cdots,p\}$ into $\{1,\cdots,d\}$.
Consider the following map $G:F(q,d)\times F(p,d) \to F(p+q,d): (f,h) \mapsto f \star h$, where $f\star h\in F(p+q,d)$ such that $(f\star h)(j) = f(j)$ for all $1\leq j\leq q$ and $(f\star h)(q+j)=h(j)$ for every $1\leq j\leq p$.
What is the inverse of G?