<>;@a=sort map/ /*$'-$`,<>;print$a[0]-$a[-1]?-1:$a[0]