read $_ t for i in {0..11};{ a= for j in $t;{((a+=(j-i+19)%12%7%2));} b[a?1:c++]=$i } echo $[c-1?-1:b]