Given a string, find all possible codes that string can generate