Solution by Mauricio Wittenberg (mauricio@sd6.cl)