| STOCK REPURCHASE PROGRAM - Summary of Share Repurchase Transactions (Details) - USD ($) shares in Thousands, $ in Thousands | 12 Months Ended | ||
|---|---|---|---|
| Jun. 30, 2023 | Jun. 30, 2022 | Jun. 30, 2021 | |
| Equity [Abstract] | |||
| Number of shares of common stock repurchased (in shares) | 5,844 | 11,768 | 3,658 | 
| Total cost of repurchases | $ 1,329,714 | $ 3,962,267 | $ 944,607 | 
| X | ||||||||||
| 
- Definition Treasury Stock, Value, Acquired, Excluding Accelerated Share Repurchase Program Forward Contracts No definition available. 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Number of shares that have been repurchased during the period and are being held in treasury. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 |