Galliani thanks Genoa, exit Flamini