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


F foursquares(lo, hi, unique, show)
   V solutions = 0
   L(c) lo .. hi
      L(d) lo .. hi
         I !unique | (c != d)
            V a = c + d
            I a >= lo & a <= hi
               I !unique | (c != 0 & d != 0)
                  L(e) lo .. hi
                     I !unique | (e !C (a, c, d))
                        V g = d + e
                        I g >= lo & g <= hi
                           I !unique | (g !C (a, c, d, e))
                              L(f) lo .. hi
                                 I !unique | (f !C (a, c, d, g, e))
                                    V b = e + f - c
                                    I b >= lo & b <= hi
                                       I !unique | (b !C (a, c, d, g, e, f))
                                          solutions++
                                          I show
                                             print(String((a, b, c, d, e, f, g))[1 .< (len)-1])
 
   V uorn = I unique {‘unique’} E ‘non-unique’
 
   print(solutions‘ ’uorn‘ solutions in ’lo‘ to ’hi)
   print()
 
foursquares(1, 7, 1B, 1B)
foursquares(3, 9, 1B, 1B)
foursquares(0, 9, 0B, 0B)