#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long n, m, k;
vector<long long> adj[200005];
vector<string> ans;
vector<vector<long long> > inc;
void solve(long long index, string &s) {
  if (index > n) {
    if (k) {
      ans.push_back(s);
      k--;
    }
    return;
  }
  for (long long j = 0; j < inc[index].size(); j++) {
    s[inc[index][j]] = '1';
    if (k) solve(index + 1, s);
    s[inc[index][j]] = '0';
  }
}
int32_t main() {
  fast();
  cin >> n >> m >> k;
  vector<pair<long long, long long> > edges;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    edges.push_back({u, v});
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  queue<long long> q;
  vector<bool> vis(n + 1, false);
  vector<long long> dis(n + 1);
  vis[1] = true;
  q.push(1);
  dis[1] = 0;
  while (!q.empty()) {
    long long curr = q.front();
    q.pop();
    for (auto child : adj[curr]) {
      if (!vis[child]) {
        dis[child] = dis[curr] + 1;
        vis[child] = true;
        q.push(child);
      }
    }
  }
  inc.resize(n + 1);
  for (long long e = 0; e < edges.size(); e++) {
    if (dis[edges[e].first] + 1 == dis[edges[e].second])
      inc[edges[e].second].push_back(e);
    else if (dis[edges[e].second] + 1 == dis[edges[e].first])
      inc[edges[e].first].push_back(e);
  }
  string b;
  for (long long i = 0; i < m; i++) b.push_back('0');
  solve(2, b);
  cout << ans.size() << "\n";
  for (long long i = 0; i < ans.size(); i++) cout << ans[i] << "\n";
  return 0;
}
