tools/smaz: partially genericize Print_Dictionary