ex18: parse triangle nad invert
solve ex18