def next_tzolkin_haab(tzolkin, haab, jd):
<EOL>haabcount = _haab_count(*to_haab(jd))<EOL>haab_desired_count = _haab_count(*haab)<EOL>haab_days = (haab_desired_count - haabcount) % <NUM_LIT><EOL>possible_haab = set(h + haab_days for h in range(<NUM_LIT:0>, <NUM_LIT>, <NUM_LIT>))<EOL>tzcount = _tzolkin_count(*to_tzolkin(jd))<EOL>tz_desired_count = _tzolkin_count(*tzolkin)<EOL>tzolkin_days = (tz_desired_count - tzcount) % <NUM_LIT><EOL>possible_tz = set(t + tzolkin_days for t in range(<NUM_LIT:0>, <NUM_LIT>, <NUM_LIT>))<EOL>try:<EOL><INDENT>return possible_tz.intersection(possible_haab).pop() + jd<EOL><DEDENT>except KeyError:<EOL><INDENT>raise IndexError("<STR_LIT>")<EOL><DEDENT>
For a given haab-tzolk'in combination, and a Julian day count, find the next occurrance of the combination after the date