public void traverse(TreeNode tr ,TreeNode tgt1,TreeNode tgt2, LinkedList<TreeNode> tgtParents){

        tgtParents.add(tr);
        if(tr.val == tgt1.val){
            //get target
            p1s = (LinkedList<TreeNode>) tgtParents.clone();
            if(log) {
                System.out.println("find node 1 " + tr.val);
            }
        }else if(tr.val == tgt2.val) {
            //get target
            p2s = (LinkedList<TreeNode>) tgtParents.clone();
            if (log) {
                System.out.println("find node 2 " + tr.val);
            }
        }

        if(log)
            System.out.println("push "+tr.val);

        if(tr.left!=null){
            traverse(tr.left,tgt1,tgt2,tgtParents);
        }

        if(tr.right!=null){
            traverse(tr.right,tgt1,tgt2,tgtParents);
        }

        if(!tgtParents.isEmpty()) {
            TreeNode pop = tgtParents.remove(tgtParents.size()-1);
            if(log)
                System.out.println("pop "+pop.val);
        }
    }