Ternary numeral system