Parrying initial losses, rupee gained 31 paise following a weak greenback against major crosses overseas and a decline in US treasury yields