Solved @UVA 1229 - Sub-dictionary