/*
 * function TreeNode(x) {
 *   this.val = x;
 *   this.left = null;
 *   this.right = null;
 * }
 */

/**
 * 
 * @param root TreeNode类 the root of binary tree
 * @return int整型二维数组
 */
function threeOrders( root ) {
    // write code here
    const res = [[],[],[]];
    const dfs = (node) => {
        if(!node) return;
        res[0].push(node.val);
        dfs(node.left);
        res[1].push(node.val);
        dfs(node.right);
        res[2].push(node.val);
    }
    dfs(root);
    return res;
}
module.exports = {
    threeOrders : threeOrders
};