Given an array of job listings, find the top K most relevant ones based on a specific criteria.
Implement top_k_relevant(listings, k). Each listing is a dictionary with a string id and integer relevance; return up to k listing IDs ordered by descending relevance, preserving original array order when relevance scores tie.
Input: a list of listing dictionaries and an integer k. Output: a list of IDs.
def top_k_relevant(listings, k):