soundChanges=()
while read inputLine; do
    test "$inputLine" = ';' && break || soundChanges+=("$inputLine")
done
soundChangeSedExpressions=()
for soundChangeIdx in "${!soundChanges[@]}"; do
    soundChange="${soundChanges[$soundChangeIdx]}"
    soundToChange="${soundChange%% >*}"
    soundToChangeTo="${soundChange##$soundToChange > }"
    soundToChangeTo="${soundToChangeTo%% / *}"
    if [[ "$soundChange" == *" / "* ]]; then
        conditionalChangeRule="${soundChange##$soundToChange > $soundToChangeTo / }"
    else
        conditionalChangeRule="__"
    fi
    soundConditional="${conditionalChangeRule//__/$soundToChange}"
    soundReplacement="${conditionalChangeRule//__/$soundToChangeTo}"
    soundChangeSedExpression="s/$soundConditional/$soundReplacement/g"
    soundChangeSedExpressions+=("$soundChangeSedExpression")
done
inputToRunReplacementsOn="$(cat)"
for soundChangeSedExpressionIdx in "${!soundChangeSedExpressions[@]}"; do
    soundChangeSedExpression="${soundChangeSedExpressions[$soundChangeSedExpressionIdx]}"
    inputToRunReplacementsOn=$(printf "%s" "$inputToRunReplacementsOn" | sed -e "$soundChangeSedExpression")
done
echo "$inputToRunReplacementsOn"