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


fourSquare(1,7,true,true)
fourSquare(3,9,true,true)
fourSquare(0,9,false,false)
 
 
sub fourSquare(low, high, unique, prin)
    local count, a, b, c, d, e, f, g, fp
 
    if (prin) print "a b c d e f g"
 
    for a = low to high
        for b = low to high
            if (not valid(unique, a, b)) continue
 
            fp = a+b
            for c = low to high
                if (not valid(unique, c, a, b)) continue
                for d = low to high
                    if (not valid(unique, d, a, b, c)) continue
                    if (fp <> b+c+d) continue
 
                    for e = low to high
                        if (not valid(unique, e, a, b, c, d)) continue
                        for f = low to high
                            if (not valid(unique, f, a, b, c, d, e)) continue
                            if (fp <> d+e+f) continue
 
                            for g = low to high
                                if (not valid(unique, g, a, b, c, d, e, f)) continue
                                if (fp <> f+g) continue
 
                                count = count + 1
                                if (prin) print a," ",b," ",c," ",d," ",e," ",f," ",g
                            next
                        next
                    next
                next
            next
        next
    next
    if (unique) then
        print "There are ", count, " unique solutions in [",low,",",high,"]"
    else
        print "There are ", count, " non-unique solutions in [",low,",",high,"]"
    end if
end sub
 
sub valid(unique, needle, n1, n2, n3, n4, n5, n6)
    local i
 
    if (unique) then
        for i = 1 to numparams - 2
            switch i
                case 1: if needle = n1 return false : break
                case 2: if needle = n2 return false : break
                case 3: if needle = n3 return false : break
                case 4: if needle = n4 return false : break
                case 5: if needle = n5 return false : break
                case 6: if needle = n6 return false : break
            end switch
        next
    end if
    return true
end sub