#!/usr/bin/env tclsh8.6

set max 9999
set idx 1
set data {}
while {$idx <= $max} {
    puts $idx
    lappend data $idx
    lsort -integer $data
    incr idx
}

