Medial Or Final Substitution Word Problem