def init_dict_flat_to_init_dict(init_dict_flat):
    """Converts flattened init dict to init dict structure
    as in the init file"""

    init_dict = dict()

    init_dict["GENERAL"] = dict()
    init_dict["GENERAL"]["num_periods"] = init_dict_flat["num_periods"]

    init_dict["CONSTANTS"] = dict()
    init_dict["CONSTANTS"]["delta"] = init_dict_flat["delta"]
    init_dict["CONSTANTS"]["mu"] = init_dict_flat["mu"]

    init_dict["EDUC"] = dict()
    init_dict["EDUC"]["educ_years"] = init_dict_flat["educ_years"]
    init_dict["EXPERIENCE"] = dict()
    init_dict["EXPERIENCE"]["exp_cap"] = init_dict_flat["exp_cap"]

    init_dict["SIMULATION"] = dict()
    init_dict["SIMULATION"]["seed_sim"] = init_dict_flat["seed_sim"]
    init_dict["SIMULATION"]["num_agents_sim"] = init_dict_flat["num_agents_sim"]

    init_dict["SOLUTION"] = dict()
    init_dict["SOLUTION"]["seed_emax"] = init_dict_flat["seed_emax"]
    init_dict["SOLUTION"]["num_draws_emax"] = init_dict_flat["num_draws_emax"]

    init_dict["TAXES_TRANSFERS"] = dict()
    init_dict["TAXES_TRANSFERS"]["alg1_replacement_no_child"] = init_dict_flat[
        "alg1_replacement_no_child"
    ]
    init_dict["TAXES_TRANSFERS"]["alg1_replacement_child"] = init_dict_flat[
        "alg1_replacement_child"
    ]
    init_dict["TAXES_TRANSFERS"]["child_benefits"] = init_dict_flat["child_benefits"]
    init_dict["TAXES_TRANSFERS"]["regelsatz_single"] = init_dict_flat[
        "regelsatz_single"
    ]
    init_dict["TAXES_TRANSFERS"]["regelsatz_partner"] = init_dict_flat[
        "regelsatz_partner"
    ]
    init_dict["TAXES_TRANSFERS"]["regelsatz_child"] = init_dict_flat["regelsatz_child"]
    init_dict["TAXES_TRANSFERS"]["motherhood_replacement"] = init_dict_flat[
        "motherhood_replacement"
    ]
    init_dict["TAXES_TRANSFERS"]["addition_child_single"] = init_dict_flat[
        "addition_child_single"
    ]
    init_dict["TAXES_TRANSFERS"]["housing"] = init_dict_flat["housing"]
    init_dict["TAXES_TRANSFERS"]["deductions"] = init_dict_flat["deductions"]
    init_dict["TAXES_TRANSFERS"]["income_tax"] = init_dict_flat["income_tax"]

    init_dict["INITIAL_CONDITIONS"] = dict()
    init_dict["INITIAL_CONDITIONS"]["child_age_init_max"] = init_dict_flat[
        "child_age_init_max"
    ]
    init_dict["INITIAL_CONDITIONS"]["init_exp_max"] = init_dict_flat["init_exp_max"]

    init_dict["EXOG_PROC"] = dict()
    init_dict["EXOG_PROC"]["child_age_max"] = init_dict_flat["child_age_max"]
    init_dict["EXOG_PROC"]["last_child_bearing_period"] = init_dict_flat[
        "last_child_bearing_period"
    ]

    return init_dict