What factors led to the territorial decline of the ottoman empire over the course of the 19th century? what territories were lost?