SPOJ Email Id parsing solution