#[Pyth](http://pyth.herokuapp.com) - <strike>8</strike> 7 qShQSeQ Guess who is an idiot and forgot the end command. I am. :( Otherwise, very simple. q equals ShQ sorted first elment of input SeQ sorted last element of input