#Ruby 75
Ruby 75
Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.
puts STDIN.read.split(" ").permutation.map{|x|x.join}.sort.values_at(0,-1)
I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.