How order a data matrix using awk?

is it possible to order the following row clusters from ascending to descending. thanx in advance

input

1       2       4       0
1       2       4       0
3       3       3       3
1       5       1       0
1       5       1       0
6       0       0      0
5       1      1       1
1       6       1      1

output

6       0       0      0
5       1      1       1
1       6       1      1
1       5       1       0
1       5       1       0
1       2       4       0
1       2       4       0
3       3       3       3

What have you tried?

I did some thing like this (at least to get the top clusters that I wanted).

awk '{if ($1> $2&&$3&&$4) print $0}'
awk '{if ($2> $1&&$3&&$4) print $0}'
awk '{if ($3> $2&&$1&&$4) print $0}'
awk '{if ($4> $2&&$3&&$1) print $0}'

Hi,

Could be easily done using sort.

sort -nr 

Sould be fine.

Your code in #3 and you output specification seems to suggest you first would like to print the line that have the last maximum in the first column, then the second column, etc..
For starters you could try something like this, where the output is grouped but not sorted.

awk '
  {
    m=1
    for(i=1; i<=NF; i++) if($m<=$i)m=i
    A[m]=A[m] $0 ORS
  } 
  END{
    for(i=1; i<=4; i++) printf "%s",A
  }
' file

Output:

6       0       0      0
5       1      1       1
1       5       1       0
1       5       1       0
1       6       1      1
1       2       4       0
1       2       4       0
3       3       3       3