// File: /workspace/github_cpp_makefile_star2_O2/shininglion[P]find_max_independent_set/main.cpp
// Function: main
int main(const int argc, const char* argv[])
{
    using namespace std;
	
    if (freopen(argv[1],"r",stdin) == nullptr) {
		fprintf(stderr, "Cannot open file %s\n", argv[1]);
		return 0;
	}

#ifdef TEST_USE_NODE
    vector<Node> connect;
#else
    vector< vector<int> > connect;
#endif
    vector<int> set;

    int Vnum, Enum;
	bool fail_flag = false;
    while(scanf("%d %d", &Vnum, &Enum) == 2) {
        connect.resize(Vnum);
#ifdef TEST_USE_NODE
        for (auto& node : connect) { node.edge_list.reserve(Vnum); }
#else
        for (auto& node : connect) { node.reserve(Vnum); }
#endif

#ifdef TEST_COST
		for (int i = 0; (i < Vnum) && (!fail_flag); ++i) {
			double cost = 0;
			if (scanf("%lf", &cost) != 1) { fail_flag = true; break; }
			connect[i].cost = cost;
		}
#endif

        // set the edge connection by (a b) for convenience
        for(int i = 0; (i < Enum) && (!fail_flag); ++i){
			int from, to;
            if (scanf("%d %d", &from, &to) != 2) { fail_flag = true; break; }
            // set index start from 0
            --from;
            --to;
#ifdef TEST_USE_NODE
            connect[from].edge_list.push_back(to);
            connect[to].edge_list.push_back(from);
#else
            connect[from].push_back(to);
            connect[to].push_back(from);
#endif
        }
		if (fail_flag) {
			fail_flag = false;
			fprintf(stderr, "An incomplete input.\n");
			continue;
		}

#ifdef TEST_USE_NODE
#ifdef TEST_COST
#ifndef USE_NAIVE
		printf("use greedy heuristic...\n");
        const double cost = graph::findMinCostMIS(connect, set, [](const Node& node) -> const std::vector<int>& { return node.edge_list; }, [](const Node& node) -> double { return node.cost; } );
#else
		printf("use naive approach...\n");
        const double cost = graph::naiveMinCostMIS(connect, set, [](const Node& node) -> const std::vector<int>& { return node.edge_list; }, [](const Node& node) -> double { return node.cost; } );
#endif
#else
#ifndef USE_NAIVE
		graph::findMIS(connect, set, [](const Node& node) -> const std::vector<int>& { return node.edge_list; });
#else
		graph::naiveMIS(connect, set, [](const Node& node) -> const std::vector<int>& { return node.edge_list; });
#endif
#endif
#else
#ifndef USE_NAIVE
		graph::findMIS(connect, set);
#else
		graph::naiveMIS(connect, set);
#endif
#endif

		printf("Validate mis...");
#ifdef TEST_USE_NODE
		const bool legal = graph::validateMIS(connect, set, [](const Node& node) -> const std::vector<int>& { return node.edge_list; });
#else
		const bool legal = graph::validateMIS(connect, set);
#endif
		printf(legal ? "pass\n" : "fail\n");

#ifdef TEST_COST
        printf("Maximum independent set (MIS) size and cost: %lu, %.3lf\n", set.size(), cost);
#else
        printf("Maximum independent set (MIS) size: %lu\n", set.size());
#endif
		printf("MIS vertices: ");
        for(size_t j = 0; j < set.size(); ++j )
            printf(" %d", set[j] + 1);
		putchar('\n');
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
movq 0x4ce5(%rip), %rax      # 0x5fd0
movq (%rax), %rdx
leaq 0x1dba(%rip), %rsi      # 0x30af
callq 0x10e0
testq %rax, %rax
je 0x1787
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x1d9f(%rip), %r13      # 0x30c6
leaq 0x98(%rsp), %rbp
leaq 0xf8(%rsp), %r15
leaq 0xd0(%rsp), %r12
leaq 0x60(%rsp), %rbx
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
leaq 0x54(%rsp), %rdx
xorl %eax, %eax
callq 0x10f0
cmpl $0x2, %eax
jne 0x175f
movslq 0x4(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x1a08
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r13
cmpq %r13, %r14
je 0x1396
addq $0x8, %r14
movslq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1a38
addq $0x18, %r14
jmp 0x137a
xorl %r14d, %r14d
xorl %r13d, %r13d
movslq 0x4(%rsp), %rax
cmpq %rax, %r13
jge 0x13e6
andq $0x0, 0x98(%rsp)
leaq 0x1d16(%rip), %rdi      # 0x30cc
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10f0
cmpl $0x1, %eax
jne 0x1737
movsd 0x98(%rsp), %xmm0
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax,%r14)
incq %r13
addq $0x20, %r14
jmp 0x139c
xorl %r14d, %r14d
leaq 0x1cd6(%rip), %r13      # 0x30c6
cmpl 0x54(%rsp), %r14d
jge 0x1468
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x10f0
cmpl $0x2, %eax
jne 0x173e
movslq 0x98(%rsp), %rax
decq %rax
decl 0xf8(%rsp)
movl %eax, 0x98(%rsp)
movq 0x30(%rsp), %rcx
shlq $0x5, %rax
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x1ac8
movslq 0xf8(%rsp), %rax
movq 0x30(%rsp), %rcx
shlq $0x5, %rax
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq %rbp, %rsi
callq 0x1ac8
incl %r14d
jmp 0x13f0
leaq 0x1d1f(%rip), %rdi      # 0x318e
callq 0x1150
movq 0x38(%rsp), %r13
subq 0x30(%rsp), %r13
shrq $0x5, %r13
movl %r13d, 0xc(%rsp)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x1498
movq %rax, 0x18(%rsp)
andq $0x0, 0x90(%rsp)
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x58(%rsp)
leaq 0xc8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq $0x1, 0xa0(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, 0xb8(%rsp) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movslq %r13d, %rsi
movb $0x0, 0xd0(%rsp)
movq %r15, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1ec2
leaq 0x90(%rsp), %r14
leaq 0xb(%rsp), %rax
movq %rax, 0x120(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, 0x128(%rsp)
movq %rbp, 0x130(%rsp)
movq %r15, 0xd0(%rsp)
movq %rbp, 0xd8(%rsp)
movq %r14, 0xe0(%rsp)
leaq 0xa(%rsp), %rcx
movq %rcx, 0xe8(%rsp)
movq %rax, 0xf0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
pushq $0x48
popq %rdi
callq 0x10d0
leaq 0xc(%rsp), %rcx
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
leaq 0x120(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rbx, 0x20(%rax)
movq %rbp, 0x28(%rax)
leaq 0x10(%rsp), %rcx
movq %rcx, 0x30(%rax)
movq %r14, 0x38(%rax)
leaq 0x58(%rsp), %rcx
movq %rcx, 0x40(%rax)
movq %rax, 0x60(%rsp)
leaq 0x2ef(%rip), %rax       # 0x189c
movq %rax, 0x78(%rsp)
leaq 0x3f5(%rip), %rax       # 0x19ae
movq %rax, 0x70(%rsp)
xorl %r14d, %r14d
cmpl %r13d, %r14d
jge 0x1606
movq 0xf8(%rsp), %rdi
movq 0x108(%rsp), %rdx
movl 0x110(%rsp), %ecx
movb $0x0, 0x3(%rsp)
xorl %esi, %esi
leaq 0x3(%rsp), %r8
callq 0x2118
movq %r12, %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x17fa
incl %r14d
movl 0xc(%rsp), %r13d
jmp 0x15c1
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movq %rbx, %rdi
callq 0x1f26
movq %r15, %rdi
callq 0x1f42
movq %rbp, %rdi
callq 0x25f2
leaq 0x1ab2(%rip), %rdi      # 0x30e6
xorl %eax, %eax
callq 0x1030
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movb $0x1, %dil
movq 0x30(%rsp), %rdx
xorl %esi, %esi
leaq 0x1a69(%rip), %r13      # 0x30c6
testb $0x1, %dil
je 0x16a8
cmpq %rcx, %rsi
jae 0x16a8
leaq 0x1(%rsi), %r8
movq %r8, %r9
cmpq %rcx, %r9
setae %dil
jae 0x16a3
movslq (%rax,%r9,4), %r11
shlq $0x5, %r11
movq 0x8(%rdx,%r11), %r10
movq 0x10(%rdx,%r11), %r11
cmpq %r11, %r10
je 0x169e
movl (%r10), %r14d
addq $0x4, %r10
cmpl (%rax,%rsi,4), %r14d
jne 0x168a
jmp 0x16a3
incq %r9
jmp 0x166f
movq %r8, %rsi
jmp 0x165d
testb $0x1, %dil
leaq 0x1a49(%rip), %rdi      # 0x30fc
leaq 0x1a3c(%rip), %rax      # 0x30f6
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x1030
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x2, %rsi
leaq 0x1a28(%rip), %rdi      # 0x3102
movsd 0x88(%rsp), %xmm0
movb $0x1, %al
callq 0x1030
leaq 0x1a4a(%rip), %rdi      # 0x313b
xorl %eax, %eax
callq 0x1030
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r14
jae 0x172a
movl (%rax,%r14,4), %esi
incl %esi
leaq 0x19aa(%rip), %rdi      # 0x30c8
xorl %eax, %eax
callq 0x1030
incq %r14
jmp 0x16fb
pushq $0xa
popq %rdi
callq 0x1110
jmp 0x1344
leaq 0x1988(%rip), %r13      # 0x30c6
movq 0x4893(%rip), %rax      # 0x5fd8
movq (%rax), %rcx
leaq 0x1981(%rip), %rdi      # 0x30d0
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
jmp 0x1344
leaq 0x10(%rsp), %rdi
callq 0x1b46
leaq 0x30(%rsp), %rdi
callq 0x1ae6
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x484a(%rip), %rax      # 0x5fd8
movq (%rax), %rdi
movq 0x8(%rbx), %rdx
leaq 0x1915(%rip), %rsi      # 0x30b1
xorl %eax, %eax
callq 0x1120
jmp 0x1773
jmp 0x17b0
movq %rax, %rbx
jmp 0x17ca
jmp 0x17db
jmp 0x17b0
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x1f26
leaq 0xf8(%rsp), %rdi
callq 0x1f42
leaq 0x98(%rsp), %rdi
callq 0x25f2
jmp 0x17de
jmp 0x17db
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1b46
leaq 0x30(%rsp), %rdi
callq 0x1ae6
movq %rbx, %rdi
callq 0x1180