4-rings or 4-squares puzzle

You are encouraged to solve this task according to the task description, using any language you may know.
Task

Replace       a, b, c, d, e, f,   and
  g        with the decimal
digits   LOW   ───►   HIGH

such that the sum of the letters inside of each of the four large squares add up to
the same sum.

            ╔══════════════╗      ╔══════════════╗
            ║              ║      ║              ║
            ║      a       ║      ║      e       ║
            ║              ║      ║              ║
            ║          ┌───╫──────╫───┐      ┌───╫─────────┐
            ║          │   ║      ║   │      │   ║         │
            ║          │ b ║      ║ d │      │ f ║         │
            ║          │   ║      ║   │      │   ║         │
            ║          │   ║      ║   │      │   ║         │
            ╚══════════╪═══╝      ╚═══╪══════╪═══╝         │
                       │       c      │      │      g      │
                       │              │      │             │
                       │              │      │             │
                       └──────────────┘      └─────────────┘

Show all output here.



   Show all solutions for each letter being unique with
        LOW=1     HIGH=7

   Show all solutions for each letter being unique with
        LOW=3     HIGH=9

   Show only the   number   of solutions when each letter can be non-unique
        LOW=0     HIGH=9



Related task

 Solve the no connection puzzle


def check(list)
  a, b, c, d, e, f, g = list
  first = a + b
  {b + c + d, d + e + f, f + g}.all? &.==(first)
end
 
def four_squares(low, high, unique = true, show = unique)
  solutions = [] of Array(Int32)
  if unique
    uniq = "unique"
    (low..high).to_a.each_permutation(7, true) { |ary| solutions << ary.clone if check(ary) }
  else
    uniq = "non-unique"
    (low..high).to_a.each_repeated_permutation(7, true) { |ary| solutions << ary.clone if check(ary) }
  end
  if show
    puts " " + ("a".."g").join("  ")
    solutions.each { |ary| p ary }
  end
  puts "#{solutions.size} #{uniq} solutions in #{low} to #{high}"
  puts
end
 
{ {1, 7}, {3, 9} }.each do |(low, high)|
  four_squares(low, high)
end
four_squares(0, 9, false)