Emergence of hierarchical organization in memory for random material