Frequency Problem (Hard Version)

Problem Name:
Frequency Problem (Hard Version)
Site:CodeForces
Links:
Tags:
Problem setters: