What existed as early as the Shang dynasty