When atrial fibrillation occurs with pulmonary embolism, is it the chicken or the egg?

When atrial fibrillation occurs with pulmonary embolism, is it the chicken or the egg?