Remove the spaces from the following sentence: Originally, it was a Mosque, but it was rebuilt to a church which an earthquake destroyed in 1522.
Originally,itwasaMosque,butitwasrebuilttoachurchwhichanearthquakedestroyedin1522.