Buying in Nicaragua, Selling in Costa Rica

I have no idea how paper work or anything goes with this stuff. I want to buy a car in Nicaragua and sell it in Costa Rica.... Possible? Or would it be easier to buy it in Costa Rica and then re-sell it in Costa Rica. HELP and give me your information and knowledge!