NL for ternary