Pension and Other Postretirement Benefits (Details) - USD ($)
$ in Thousands
3 Months Ended 9 Months Ended
Apr. 30, 2016
Apr. 30, 2015
Apr. 30, 2016
Apr. 30, 2015
Pension Plan        
Defined Benefit Plans and Other Postretirement Benefit Plans        
Service cost $ 370 $ 402 $ 1,126 $ 1,205
Interest cost 479 463 1,446 1,388
Expected return on plan assets (480) (470) (1,442) (1,409)
Amortization of Prior service costs 2 2 6 7
Amortization of Other actuarial loss 239 144 735 433
Net periodic benefit cost 610 541 1,871 1,624
Postretirement Health Plan        
Defined Benefit Plans and Other Postretirement Benefit Plans        
Service cost 27 33 70 100
Interest cost 21 26 62 79
Amortization of Net transition obligation 0 1 0 1
Amortization of Prior service costs (2) (2) (5) (5)
Amortization of Other actuarial loss 0 10 0 28
Net periodic benefit cost $ 46 $ 68 $ 127 $ 203