1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env ruby uniq = false uniq = true if ARGV[0] while line = STDIN.gets a = line.strip.split a.uniq! if uniq a.sort! puts a.join " " end