def rank_transform(nums):
    rank = {value: i + 1 for i, value in enumerate(sorted(set(nums)))}
    return [rank[value] for value in nums]
