Structured Input Classification Algorithm