Implicit function theorem over free groups and genus problem