original_query: What were the Mahājanapadas and how many of them existed in ancient Northern India?
query: What were the Mahājanapadas and how many existed in ancient Northern India?
answer: The Mahājanapadas were sixteen kingdoms or oligarchic republics in ancient Northern India from the 6th to 4th centuries BCE.  They included both monarchies and republics.