using sed to grep

I have a file that contains many instances of double dollar signs. I want to use sed to get the first occurrence. for example, given the following data.

#Beginning of file

AB
34
$$
AB
$$
AB
98
$$

I only want to pull out:

AB
34
$$

It seems there should be a way to do this for only the first occurrence, and then for each occurrence there after separetly, 2nd, 3rd, 4th, not all at once. The word directly after the double will be the same each time, so in theory you could do something like. sed -n -e '/AB/,/\$/p', and then somehow indicate you only want the first occurrence.

Maybe...

$ awk -v n=1 'C==n-1,C<=n;/\$\$/{++C}' file1
AB
34
$$

$ awk -v n=2 'C==n-1,C<=n;/\$\$/{++C}' file1
AB
$$

$ awk -v n=3 'C==n-1,C<=n;/\$\$/{++C}' file1
AB
98
$$