What was a main purpose of monasteries built by the Catholic Church?

They replaced other churches in the European countryside.
They gave aid to travelers and sick or poor people.
They served as schools for all European children.
They provided housing for missionaries.