input: Write a Python function that accepts a list of integers called 'nums,' a list of integers named 'queries,' and an integer 'x.' 
  
  The function should determine the index of the x-th occurrence of 'x' within the 'nums' list for each element in 'queries.' If 'x' appears fewer times than the value specified in 'queries,' return -1 for that query. 
  
  The function should return a list of integers containing the results of all queries.
  
  Examples:
  >>> nums = [1,3,1,7], queries = [1,3,2,4], x = 1
  [0,-1,2,-1]
  >>> nums = [1,2,3], queries = [10], x = 5
  [-1]
  
  Constraints:
  1 <= nums.length, queries.length <= 10^5
  1 <= queries[i] <= 10^5
  1 <= nums[i], x <= 10^4
output: def find_occurrences(nums, queries, x):
      indices = []
      occurrence_map = {}
      for i, num in enumerate(nums):
          if num == x:
              if num in occurrence_map:
                  occurrence_map[num].append(i)
              else:
                  occurrence_map[num] = [i]
  
      for query in queries:
          if x in occurrence_map and len(occurrence_map[x]) >= query:
              indices.append(occurrence_map[x][query - 1])
          else:
              indices.append(-1)
      
      return indices