3481: Apply Substitutions

Problem Statement