Aleksey,
Sven is absolutely correct. This shows the integrated and circular nature of the processes described in the PMBOK Guide. The processes and their ITTOs interact in many ways that can simply not be shown in graphics and lists.
So the very first time that you will go through the process of Estimate Activity Resources you correctly realized that you will not yet have the full "activity cost estimates" as your input. But this is the moment when your brain will kick in. And your brain will tell you... "I know that both Susan and Joe can do this job well. Susan has an hourly rate of $110 and Joe is at $105. So which one of the two should I be using considering this...?"
So as you can see from this example, even though the processes are described separately in the PMBOK Guide, there are moments when you jump from one to the other and back again in an instant.
So to answer your question in the topic: "Resources, Costs... What is the first?". The answer for your particular case is... neither. They are happening at the same time to achieve the desired result.