529 Qualified Withdrawal and Refund

Please help what numbers I should enter "Qualified Withdrawals From a MESP, MI 529 Advisor Plan and/or Michigan ABLE Account" in my situation.

 

I have two 529 accounts for me and my daughter. Both of us were in the same university and paid educational expense from 529 account. My daughter is claimed as my dependent, and I am a head of a household.

 

Here is my situation.

A. $ 20,000 was spend for my daughter's tuition and boarding cost in 2022.

B. $ 5,000 was sent to university as my tuition in 2022.

C. $ 2,500 was refunded from university to me in January 2023 since I dropped out one class that I was going to take in Winter.

D. Finally, I am going to recontribute exact same amount to my account within 60 days from C.

 

Here are my questions. Again what shall I enter as "Qualified Withdrawals From a MESP, MI 529 Advisor Plan and/or Michigan ABLE Account" in 2022?

 

1. do I report $22,500 (A+B-C) as qualified withdrawal in 2022?

2. Or, I report $ 25,000 (A+B) as I received the refund  in 2023 because also I am planning to recontribute to my account?

 

Please advice.