// File: /workspace/github_cpp_makefile_star2_O1/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 $0x148, %rsp            # imm = 0x148
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
movq 0x3c65(%rip), %rax      # 0x4fd0
movq (%rax), %rdx
leaq 0x1d3a(%rip), %rsi      # 0x30af
callq 0x10e0
testq %rax, %rax
je 0x1a9b
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
xorl %r14d, %r14d
movq %r14, 0x50(%rsp)
movq %r14, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
leaq 0x1d1f(%rip), %rdi      # 0x30c6
leaq 0xc(%rsp), %rsi
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x10f0
cmpl $0x2, %eax
jne 0x1a6e
movl $0x1, %r15d
xorl %r12d, %r12d
movslq 0xc(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x1e32
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r13
cmpq %r13, %rbx
je 0x13fc
leaq 0x8(%rbx), %rdi
movslq 0xc(%rsp), %rsi
callq 0x1ea6
addq $0x20, %rbx
jmp 0x13e3
cmpl $0x0, 0xc(%rsp)
jle 0x1470
testb $0x1, %r12b
jne 0x1470
movl $0x1, %r13d
xorl %ebp, %ebp
movq $0x0, 0xe8(%rsp)
leaq 0x1ca8(%rip), %rdi      # 0x30cc
leaq 0xe8(%rsp), %rsi
xorl %eax, %eax
callq 0x10f0
movb $0x1, %bl
cmpl $0x1, %eax
jne 0x1450
movsd 0xe8(%rsp), %xmm0
movq 0x40(%rsp), %rcx
movsd %xmm0, (%rcx,%rbp)
movl %r12d, %ebx
cmpl $0x1, %eax
jne 0x1473
movslq 0xc(%rsp), %rax
cmpq %rax, %r13
jge 0x1473
addq $0x20, %rbp
incq %r13
movl %ebx, %r12d
testb $0x1, %bl
je 0x1411
jmp 0x1473
movl %r12d, %ebx
cmpl $0x0, 0x14(%rsp)
jle 0x157c
testb $0x1, %bl
leaq 0x60(%rsp), %rdx
leaq 0xe8(%rsp), %rbp
jne 0x1577
movl $0x1, %r13d
leaq 0x1c25(%rip), %rdi      # 0x30c6
movq %rbp, %rsi
xorl %eax, %eax
callq 0x10f0
movl %eax, %ebp
movb $0x1, %r12b
cmpl $0x2, %eax
jne 0x154c
movslq 0xe8(%rsp), %rcx
decq %rcx
movl %ecx, 0xe8(%rsp)
movl 0x60(%rsp), %eax
decl %eax
movl %eax, 0x60(%rsp)
movq 0x40(%rsp), %rdx
shlq $0x5, %rcx
leaq (%rdx,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x14fc
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x1506
leaq 0x60(%rsp), %rdx
callq 0x210c
movslq 0x60(%rsp), %rax
movq 0x40(%rsp), %rcx
shlq $0x5, %rax
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x153c
movl 0xe8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
movl %ebx, %r12d
jmp 0x154c
leaq 0xe8(%rsp), %rdx
callq 0x210c
movl %ebx, %r12d
cmpl $0x2, %ebp
jne 0x157f
cmpl 0x14(%rsp), %r13d
leaq 0x60(%rsp), %rdx
leaq 0xe8(%rsp), %rbp
jge 0x1587
incl %r13d
movl %r12d, %ebx
testb $0x1, %r12b
je 0x149a
jmp 0x1587
movl %ebx, %r12d
jmp 0x1587
movl %ebx, %r12d
leaq 0xe8(%rsp), %rbp
testb $0x1, %r12b
jne 0x1a64
leaq 0x1bf6(%rip), %rdi      # 0x318e
callq 0x1150
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
shrq $0x5, %rax
movl %eax, 0x18(%rsp)
movq 0x20(%rsp), %rcx
cmpq %rcx, 0x28(%rsp)
je 0x15c0
movq %rcx, 0x28(%rsp)
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
movq %rcx, 0xe0(%rsp)
movq $0x0, 0x128(%rsp)
leaq 0x118(%rsp), %rcx
movq %rcx, 0xe8(%rsp)
movq $0x1, 0xf0(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, -0x20(%rcx)
movl $0x3f800000, 0x108(%rsp) # imm = 0x3F800000
movupd %xmm0, -0x8(%rcx)
movslq %eax, %rsi
movb $0x0, 0xb8(%rsp)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
leaq 0xb8(%rsp), %rdx
leaq 0x90(%rsp), %rcx
callq 0x2224
leaq 0x1f(%rsp), %rax
movq %rax, 0x130(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x138(%rsp)
movq %rbp, 0x140(%rsp)
movq %rbx, 0xb8(%rsp)
movq %rbp, 0xc0(%rsp)
leaq 0x128(%rsp), %r13
movq %r13, 0xc8(%rsp)
leaq 0x1e(%rsp), %rcx
movq %rcx, 0xd0(%rsp)
movq %rax, 0xd8(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movl $0x48, %edi
callq 0x10d0
leaq 0x18(%rsp), %rcx
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x130(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0xb8(%rsp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x90(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq %rbp, 0x28(%rax)
leaq 0x20(%rsp), %rcx
movq %rcx, 0x30(%rax)
movq %r13, 0x38(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x40(%rax)
movq %rax, 0x90(%rsp)
leaq 0x55a(%rip), %rax       # 0x1c68
movq %rax, 0xa8(%rsp)
leaq 0x6b1(%rip), %rax       # 0x1dce
movq %rax, 0xa0(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x1897
xorl %ebp, %ebp
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %r13
movl 0x78(%rsp), %ebx
cmpq %r13, %rdi
je 0x1754
movq %r13, %rdx
subq %rdi, %rdx
xorl %esi, %esi
callq 0x1090
jmp 0x1757
movq %rdi, %r13
testl %ebx, %ebx
je 0x1770
negb %bl
movq $-0x1, %rax
movl %ebx, %ecx
shrq %cl, %rax
notq %rax
andq %rax, (%r13)
movl %ebp, 0x10(%rsp)
movq 0xb8(%rsp), %rax
movq (%rax), %rax
movq %rbp, %rdx
shrq $0x6, %rdx
movl $0x1, %esi
movl %ebp, %ecx
shlq %cl, %rsi
orq %rsi, (%rax,%rdx,8)
movq 0xc0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2398
movq 0xc8(%rsp), %rax
movq 0xd8(%rsp), %rcx
movslq 0x10(%rsp), %rdx
movq (%rcx), %rcx
movq %rdx, %rsi
shlq $0x5, %rsi
movsd (%rcx,%rsi), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl %edx, 0x8c(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x1aa9
leaq 0x90(%rsp), %rdi
leaq 0x8c(%rsp), %rsi
callq *0xa8(%rsp)
movq 0xb8(%rsp), %rax
movslq 0x10(%rsp), %rcx
leaq 0x3f(%rcx), %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq (%rax), %rdx
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
leaq 0x3f(%rdi), %rax
andq %rcx, %rax
xorl %esi, %esi
cmpq %rdi, %rax
setbe %sil
movq $-0x2, %rax
rolq %cl, %rax
andq %rax, -0x8(%rdx,%rsi,8)
movq 0xc0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x263e
movq 0xc8(%rsp), %rax
movq 0xd8(%rsp), %rcx
movslq 0x10(%rsp), %rdx
movq (%rcx), %rcx
shlq $0x5, %rdx
movsd (%rax), %xmm0
subsd (%rcx,%rdx), %xmm0
movsd %xmm0, (%rax)
incq %rbp
movslq 0x18(%rsp), %rax
cmpq %rax, %rbp
jl 0x1732
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x120(%rsp)
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0x18c8
leaq 0x90(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
leaq 0xe8(%rsp), %rbx
je 0x18fb
callq 0x10c0
movq %r14, 0x60(%rsp)
movl %r14d, 0x68(%rsp)
movq %r14, 0x70(%rsp)
movl %r14d, 0x78(%rsp)
movq %r14, 0x80(%rsp)
movq %rbx, %rdi
callq 0x2720
leaq 0x17dc(%rip), %rdi      # 0x30e6
xorl %eax, %eax
callq 0x1030
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
leaq 0x17d4(%rip), %rdi      # 0x30f6
subq %rax, %rcx
je 0x19c0
sarq $0x2, %rcx
movq 0x40(%rsp), %rsi
movb $0x1, %dl
xorl %r8d, %r8d
leaq 0x1(%r8), %rdi
cmpq %rcx, %rdi
jae 0x199e
movq %rdi, %r9
movslq (%rax,%r9,4), %r10
shlq $0x5, %r10
movq 0x8(%rsi,%r10), %rbx
movq 0x10(%rsi,%r10), %r11
cmpq %r11, %rbx
je 0x1982
movl (%rax,%r8,4), %ebp
addq $0x4, %rbx
xorl %r10d, %r10d
movzbl %r10b, %r10d
cmpl %ebp, -0x4(%rbx)
cmovel %r15d, %r10d
je 0x1985
leaq 0x4(%rbx), %r13
cmpq %r11, %rbx
movq %r13, %rbx
jne 0x1967
jmp 0x1985
xorl %r10d, %r10d
movzbl %dl, %edx
testb $0x1, %r10b
cmovnel %r14d, %edx
incq %r9
cmpq %rcx, %r9
jae 0x199e
testb $0x1, %r10b
je 0x1945
cmpq %rcx, %rdi
je 0x19ab
movq %rdi, %r8
testb $0x1, %dl
jne 0x1939
testb $0x1, %dl
leaq 0x1747(%rip), %rdi      # 0x30fc
leaq 0x173a(%rip), %rax      # 0x30f6
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x1030
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
sarq $0x2, %rsi
leaq 0x1726(%rip), %rdi      # 0x3102
movsd 0x120(%rsp), %xmm0
movb $0x1, %al
callq 0x1030
leaq 0x1748(%rip), %rdi      # 0x313b
xorl %eax, %eax
callq 0x1030
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
leaq 0x16bd(%rip), %r13      # 0x30c8
je 0x1a37
xorl %ebx, %ebx
movl (%rax,%rbx,4), %esi
incl %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1030
incq %rbx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %rbx
jb 0x1a0f
movl $0xa, %edi
callq 0x1110
leaq 0x167e(%rip), %rdi      # 0x30c6
leaq 0xc(%rsp), %rsi
leaq 0x14(%rsp), %rdx
xorl %eax, %eax
callq 0x10f0
cmpl $0x2, %eax
je 0x13ca
jmp 0x1a6e
callq 0x11b0
xorl %r12d, %r12d
jmp 0x1a41
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7d
callq 0x10c0
leaq 0x40(%rsp), %rdi
callq 0x1f34
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x11d2
jmp 0x1a87
callq 0x1060
jmp 0x1b43
movq %rax, %rbx
jmp 0x1b15
movq %rax, %rbx
jmp 0x1aea
jmp 0x1ac3
jmp 0x1ac3
jmp 0x1ac8
movq %rax, %rbx
jmp 0x1b22
movq %rax, %rbx
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0x1aea
leaq 0x90(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1b15
callq 0x10c0
xorl %eax, %eax
movq %rax, 0x60(%rsp)
movl %eax, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movl %eax, 0x78(%rsp)
movq %rax, 0x80(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x2720
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b31
callq 0x10c0
leaq 0x40(%rsp), %rdi
callq 0x1f34
movq %rbx, %rdi
callq 0x1180
movq %rax, %rdi
callq 0x1f74
nop