get weights from user and return max path