Exchange-inversion transitions between ferroelectric and antiferroelectric states in ceramics