It's my first time traveling to Europe, so I don't know very well all the process with immigration. I have a Type D Visa (Study) for France, and I'm planning to go to Geneva as my final destination (near the city in France I'm going to), with a stopover in Madrid.
So the question is the following: Where do I have to get the passport stamped? Madrid or Geneva? And will I have any problems with the fact that the stamp will be a Spanish or Swiss one? Will French immigration give me headaches with that? Does it have to be a French stamp?