Tree-structured algorithm for long weak motif discovery