A new characterization of complete Heyting and co-Heyting algebras (Logical Methods in Computer Science, 2017)