Search and identification of scalar and vector leptoquarks at HERA with polarization