#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

typedef vector<vector<ll>> Graph;
bool bipartite_coloring(int now, int col, Graph &G, vector<int> &mark){
    //vector<int> mark(N, -1) を渡す！
    if(mark[now] != -1) return (mark[now] == col);
    mark[now] = col;
    bool ok = true;
    for(auto next: G[now]){
        ok &= bipartite_coloring(next, 1-col, G, mark);
    }
    return ok;
}

int main(){

    ll N, M;
    cin >> N >> M;
    V<ll> A(M), B(M);
    REP(i, M){
        cin >> A[i] >> B[i];
        A[i]--, B[i]--;
    }

    ll res = 0;
    REP(mask, 1ll<<N){
        Graph G(N);
        ll cnt = 1;
        V<int> mark(N, -1);
        REP(i, M){
            if((mask >> A[i] & 1) and (mask >> B[i] & 1)){
                goto HELL;
            }

            if((!(mask >> A[i] & 1)) and (!(mask >> B[i] & 1))){
                G[A[i]].push_back(B[i]);
                G[B[i]].push_back(A[i]);
            }
        }

        REP(i, N){
            if(!(mask >> i & 1)){
                if(mark[i] == -1){
                    if(bipartite_coloring(i, 0, G, mark)){
                        cnt *= 2;
                    }else{
                        cnt *= 0;
                    }
                }
            }
        }
        res += cnt;
        HELL:;
    }

    cout << res << endl;

    return 0;
}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1<<30;
const ll inf_l = 1LL<<61;
const int MAX = 1e5;

ll f(ll x, ll n) {
    ll sum = 0;
    for (int i = 1; i <= n; i++) {
        if (i + 2 > x) break;
        ll j = x - i;
        ll k = max<ll>(0, j - n);
        if (k > n) k = n;
        sum += n * k;
        ll l = (j - 1) - (k + 1) + 1;
        if (l >= 1) sum += l * (l + 1) / 2;
        if (n < j - 1) {
            l = j - 1 - n;
            sum -= l * (l + 1) / 2;
        }
        // debug(i);
        // debug(sum);
    }
    return sum;
}

map<ll, vvll> g(ll n) {
    map<ll, vvll> mp;
    REP(i,n+1)REP(j,n+1)REP(k,n+1) {
        mp[i + j + k].push_back(vll{i, j, k});
    }
    return mp;
}

int main() {
    ll n, k; cin >> n >> k;
    // debug(f(n * 3 - 1, n));
    // debug(f(14, n) - f(13, n));
    // debug(f(12, n));
    // auto res = g(n);
    // debug((int)res[14].size());
    // debug(f(n * 3, n));
    ll ok = 0, ng = 3 * n + 1;
    while (ng - ok > 1) {
        ll mid = (ok + ng) / 2;
        if (f(mid, n) < k) ok = mid;
        else ng = mid;
    }
    k -= f(ok, n);
    int first = -1;
    ll sum_1 = ng;
    // debug(sum_1);
    // debug(k);
    for (int i = 1; i <= n; i++) {
        // debug(i);
        ll tmp = sum_1 - i;
        ll l = max<ll>(1, tmp - n);
        ll r = min<ll>(n, tmp - 1);
        ll len = r - l + 1;
        if (len <= 0) continue;
        // debug(len);
        if (k <= len) {
            first = i;
            break;
        }
        else k -= len;
    }
    // debug(k);
    // debug(first);
    ll sum_2 = sum_1 - first;
    // debug(sum_2);
    int second = -1;
    for (int i = 1; i <= n; i++) {
        if (sum_2 - i <= 0 || sum_2 - i > n) continue;
        k--;
        if (k == 0) {
            second = i;
            break;
        }
    }
    cout << first << " " << second << " " << sum_2 - second << endl;
}