completed ternary equations