After Vitaly was expelled from the university, he became interested in the graph theory.

Vitaly especially liked the cycles of an odd length in which each vertex occurs at most once.

Vitaly was wondering how to solve the following problem. You are given an undirected graph consisting of n vertices and m edges, not necessarily connected, without parallel edges and loops. You need to find t — the minimum number of edges that must be added to the given graph in order to form a simple cycle of an odd length, consisting of more than one vertex. Moreover, he must find w — the number of ways to add t edges in order to form a cycle of an odd length (consisting of more than one vertex). It is prohibited to add loops or parallel edges.

Two ways to add edges to the graph are considered equal if they have the same sets of added edges.

Since Vitaly does not study at the university, he asked you to help him with this task.

Input

The first line of the input contains two integers n and m (<image> — the number of vertices in the graph and the number of edges in the graph.

Next m lines contain the descriptions of the edges of the graph, one edge per line. Each edge is given by a pair of integers ai, bi (1 ≤ ai, bi ≤ n) — the vertices that are connected by the i-th edge. All numbers in the lines are separated by a single space.

It is guaranteed that the given graph doesn't contain any loops and parallel edges. The graph isn't necessarily connected.

Output

Print in the first line of the output two space-separated integers t and w — the minimum number of edges that should be added to the graph to form a simple cycle of an odd length consisting of more than one vertex where each vertex occurs at most once, and the number of ways to do this.

Examples

Input

4 4
1 2
1 3
4 2
4 3


Output

1 2


Input

3 3
1 2
2 3
3 1


Output

0 1


Input

3 0


Output

3 1

Note

The simple cycle is a cycle that doesn't contain any vertex twice.
    //package codeforcesround311;
    import java.io.*;
    import java.util.*;
    public class q2 {
        static ArrayList<Integer> g[];
        static boolean[] a;
        static int[] depth;
        static int[] count;
        public static void main(String[] args) throws Exception
        {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            PrintWriter pw=new PrintWriter(System.out);
            StringTokenizer st=new StringTokenizer(br.readLine());
            int n=ip(st.nextToken());
            int m=ip(st.nextToken());
            g=new ArrayList[n];
            for(int i=0;i<n;i++)
            {
                g[i]=new ArrayList<Integer>();
            }
            for(int i=0;i<m;i++)
            {
                st=new StringTokenizer(br.readLine());
                int u=ip(st.nextToken())-1;
                int v=ip(st.nextToken())-1;
                g[u].add(v);
                g[v].add(u);
            }
            a=new boolean[n];
            depth=new int[n];
            count=new int[2];
            Arrays.fill(depth, -1);
            long ans=0;
            if(m==0)
            {
                System.out.println(3+" "+(n*1L*(n-1)*(n-2))/6);
                System.exit(0);
            }
            boolean aa=true;
            int cc=0;
            for(int i=0;i<n;i++)
            {
                if(!a[i])
                {
                    //System.out.println("dfs for"+i);
                    a[i]=true;
                    depth[i]=0;
                    count[depth[i]]++;
                    dfs(i);
                    ans+=(count[0]*1L*(count[0]-1))/2;
                    ans+=count[1]*1L*(count[1]-1)/2;
                    if(count[0]+count[1]!=2 && count[0]+count[1]>2)
                    {
                        aa=false;
                    }
                    else if(count[0]+count[1]==2)
                    {
                        cc++;
                    }
                    count[0]=0;
                    count[1]=0;
                }
                
            }
            if(aa)
            {
            pw.println("2 "+cc*1L*(n-2));   
            }
            else
            {
            pw.println("1 "+ans);
            }
            pw.close();
        }
        public static int ip(String s)
        {
            return Integer.parseInt(s);
        }
        public static long lp(String s)
        {
            return Long.parseLong(s);
        }
        public static void dfs(int x)
        {
            int size=g[x].size();
            for(int i=0;i<size;i++)
            {
                int temp=g[x].get(i);
                if(a[temp] && depth[temp]==depth[x])
                {
                    System.out.println("0 1");
                    System.exit(0);
                }
                else if(!a[temp])
                {
                    depth[temp]=(depth[x]+1)%2;
                    a[temp]=true;
                    count[depth[temp]]++;
                    dfs(temp);
                }
            }
        }
    
    }
