@each $chl, $child in $children-list {
  @each $prp, $property in $property-list {
    @each $amt, $amount in $amount-list {
      @each $dir, $direction in $direction-map {
        .#{$chl}-#{$prp}#{nth($direction, 1)}#{$amt}, .#{$chl}-#{$prp}#{nth($direction, 2)}#{$amt}, .#{$chl}-#{$prp}#{nth($direction, 3)}#{$amt} {
          >:#{$chl}-child {
            #{$property}-#{$dir}: $amount;
          }
        }
      }
    }
  }
}

@each $prp, $property in $property-list {
  @each $amt, $amount in $amount-list {
    @each $dir, $direction in $direction-map {
      .sub-#{$prp}#{nth($direction, 1)}#{$amt}, .sub-#{$prp}#{nth($direction, 2)}#{$amt}, .sub-#{$prp}#{nth($direction, 3)}#{$amt} {
        * {
          #{$property}-#{$dir}: $amount;
        }
      }
    }
  }
}

@each $prp, $property in $property-list {
  @each $amt, $amount in $amount-list {
    @each $dir, $direction in $direction-map {
      .child-#{$prp}#{nth($direction, 1)}#{$amt}, .child-#{$prp}#{nth($direction, 2)}#{$amt}, .child-#{$prp}#{nth($direction, 3)}#{$amt} {
        > * {
          #{$property}-#{$dir}: $amount;
        }
      }
    }
  }
}