In the Middle Ages, how did society treat prostitution ?

In the Middle Ages, how did society treat prostitution ?

A. prostitution was considered problematic but legal
B. the Church opposed prostitution on moral grounds
C. prostitution was considered a solution to epidemics of rape
D. All of the Above