可能形 => Potential form N4
終わる => to finish; to end N4
[終「お」]わる => To finish A; A ends N4
Secondary Verb
最中に => while; during; in the middle of ~ N3
〜がさいご(が最後) => if you do... negative result N1
Decisive (resolute decision)
[最中「さいちゅう」] => In the middle of A N3
Time, Situation
たが[最後「さいご」] => Once A occurs, B happens N1
Information, Report
[可能系「かのうけい」] => Can, be able to, be possible to N4
Can, Should, Must