The early repayment represents an economic turnaround for Brazil , which in 2002 obtained an unprecedented loan from the IMF to avoid a massive default on its debt .