This page is still under construction.

Parts of this page are still being built. What you see may change.

All Friends

Time limit1sMemory limit128 MB

Summary
Count the maximal cliques of an undirected graph with up to 128 vertices, reporting "Too many" when the count exceeds 1000.
Level

Hard8 of 10

Topics
Graph, Backtracking, Brute force, Combinatorics
Solved
No attempts yet

Problem

Sociologists are interested in the phenomenon of "friendship". To study it, they analyze various groups of people. For every two persons in a group they record whether or not the two are friends. Friendship is assumed to be symmetric: if aa is a friend of bb, then bb is also a friend of aa.

The sociologists focus on sets of friends. A set SS of people is a set of friends if every two persons in SS are friends with each other. Because there can be far too many such sets, they study only the maximal ones. A set of friends SS is maximal if no further person can be added to SS while keeping it a set of friends; equivalently, every person not in SS fails to be a friend of at least one member of SS.

For each group, determine the number of maximal sets of friends. If this number is greater than 10001000, the group is too complicated to study and you only need to report that fact.

Input

The input consists of several groups (test instances), separated by single blank lines.

The first line of each group contains two integers nn and mm (1≤n≤1281 \le n \le 128): the number of persons in the group and the number of friendship relations. Persons are numbered from 11 to nn. Each of the next mm lines contains two integers aia_i and bib_i (1≤ai,bi≤n1 \le a_i, b_i \le n, ai≠bia_i \ne b_i), meaning that persons aia_i and bib_i are friends. Each friendship is listed at most once.

Output

For each group, output on its own line the number of maximal sets of friends in that group. If this number is greater than 10001000, output the line Too many maximal sets of friends. instead.

Examples1

  1. Example 1

    Input
    5 4
    1 2
    3 4
    2 3
    4 5
    
    Expected output
    4