Input (grade 8): The first was in the bakufu-domain system, which by the eighteenth century was in trouble.
Output (grade 8): The first was with the bakufu-domain system, which by the eighteenth century was in trouble.