@Override
    public Long solve() {

        final List<Node> all = new ArrayList<Node>();
        
        for (int i1 = 10; i1-- > 0; ) {
            for (int i2 = 10 - i1; i2-- > 0; ) {
                for (int i3 = 10 - (i1 + i2); i3-- > 0; ) {
                    all.add(new Node(i1, i2, i3));
                }
            }
        }
        for (int i = 0; i < all.size(); ++i) {
            all.get(i).connect(all.get(i));
            for (int j = i + 1; j < all.size(); ++j) {
                all.get(i).connect(all.get(j));
                all.get(j).connect(all.get(i));
            }
        }
        for (int i = 0; i < 17; ++i) {
            for (Node n : all) {
                n.count(i % 2);
            }
        }

        long sum = 0;
        for (Node n : all) {
            if (n.isStart()) sum += n.getCount(0);
        }
        
        return sum;
    }