The affine classification of cubic curves