#!/usr/bin/env tclsh if {[llength $argv]} { set pre [lindex $argv 0] } else { set pre 25 } while {[gets stdin line] >= 0} { if {$line eq ""} continue lappend list $line } proc check {list i} { global pre for {set j [expr {$i-$pre}]} {$j < $i-1} {incr j} { for {set k [expr {$j+1}]} {$k < $i} {incr k} { set a [lindex $list $j] set b [lindex $list $k] if {$a == $b} continue if {$a + $b == [lindex $list $i]} {return 1} } } return 0 } for {set i $pre} {$i < [llength $list]} {incr i} { if {! [check $list $i]} { puts [lindex $list $i] exit } }