Basic formula for winning is:

m*AAA+n*ABC+DD

DD=Pair

ABC=Sequence

AAA=Triplet

m+n=4

NEXT