Instruct: What average rank of the premier has NSW as the state, Liberalism as the party, and 22 March 1877 was the assumed office?
Output: SELECT AVG Rank: FROM table WHERE State: = nsw AND Party: = liberalism AND Assumed office: = 22 march 1877