Right?! It's going to be hard to find a good way to resolve that for a happy ending for all of them. But as Lord Commander, maybe Edd can bend the rules, after all Gilly can be helpful
But yeah, he needs to become a Maester, it's the perfect position for Sam