Group substitution rules by first letter for speedup. This strongly reduces the number of applied rules.