i have a list 

```
set num "20 10 40 50 25 15"

```

I want the outputs to be grouped such that sum of each group should not exceed 60.
In this case, outputting:

```
{20 40} {10 50} {25 15}

```

I've written the following snippet 

```
set num "20 10 40 50 25 15"
for {set i 0} {$i < 4} {incr i} {
    for {set j 0} {$j < 4} {incr j} {
        if {$i == $j} {continue}
        if {[expr  [lindex $num $i] + [lindex $num $j] ] == 60 } {
        puts "[lindex $num $i]  [lindex $num $j]"}
    }
}

```

Output: 

```
20  40
10  50
40  20
50  10

```

I am trying to remove the duplicates and trying to get the combination where the sum is less that 60