perl -nale '@F=reverse @F if($F[0]>$F[1]); $x=$F[0]." ".$F[1]; if(!$h{$x}){print $x;$h{$x}=1;}'
1 2 2 1 1 2 2 3 3 2 2 3 2 4
1 2 2 3 2 4
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!