Structured Output Classification Algorithm