#include <bits/stdc++.h>
using namespace std;
int n, m, k, p, q, i, j, u, v;
vector<int> *g;
vector<int> d;
vector<int> sn;
vector<int> a, b;
vector<int> *inc;
void bfs() {
  queue<int> q;
  q.push(1);
  d[1] = 0;
  sn[1] = true;
  while (!q.empty()) {
    u = q.front(), q.pop();
    for (auto v : g[u]) {
      if (!sn[v]) {
        d[v] = d[u] + 1;
        sn[v] = true;
        q.push(v);
      }
    }
  }
}
void init() {
  sn.assign(n + 1, false);
  d.assign(n + 1, 0);
}
void generate_inc_graph() {
  for (int i = 0; i < m; i++) {
    if (d[a[i]] + 1 == d[b[i]]) {
      inc[b[i]].push_back(i);
    }
    if (d[b[i]] + 1 == d[a[i]]) {
      inc[a[i]].push_back(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  g = new vector<int>[n + 1];
  a.assign(m + 1, 0);
  b.assign(m + 1, 0);
  for (int i = 0; i < m; i++)
    cin >> a[i] >> b[i], g[a[i]].push_back(b[i]), g[b[i]].push_back(a[i]);
  init();
  bfs();
  inc = new vector<int>[n + 1];
  generate_inc_graph();
  vector<int> pos(n + 1);
  vector<string> res;
  while (k--) {
    string s(m, '0');
    for (int i = 2; i <= n; i++) {
      s[inc[i][pos[i]]] = '1';
    }
    res.push_back(s);
    bool ok = false;
    for (int i = 2; i <= n; i++) {
      if (pos[i] + 1 < inc[i].size()) {
        ok = true;
        pos[i]++;
        break;
      } else
        pos[i] = 0;
    }
    if (!ok) break;
  }
  cout << res.size() << "\n";
  for (int i = 0; i < res.size(); i++) cout << res[i] << "\n";
}
