h3,
h3 ~ *:not(a),
h1 ~ h3,
h1 ~ h3 ~ *:not(h1):not(h2):not(a) {
  margin-left: 100px;
  margin-right: 20px;
}

h2,
h2 ~ *:not(a),
h1 ~ h2,
h1 ~ h2 ~ *:not(h1):not(h3):not(a) {
  margin-left: 60px;
  margin-right: 20px;
}

h1,
h1 ~ *:not(a),
h2 ~ h1,
h2 ~ h1 ~ *:not(a),
h3 ~ h1,
h3 ~ h1 ~ *:not(a) {
  margin-left: 20px;
  margin-right: 20px;
}

h2 {
  text-align: center;
}

h3, h4, h5, h6 {
  text-align: right;
}

body {
  width: 1000px;
  margin: auto;
}