What dynasty had the first written records?