Input format confusion

I am not understand how to convert input *dg *eg *fg
*dh *eh *fh
*di *ei *fi
that combinations, if my input is 26 then what combination come

Just iterate through all the strings in the array and check if a particular substring of that string can be generated by your numeric str.