#include <bits/stdc++.h>
using namespace std;
void _out() { cerr << '\n'; }
template <typename H, typename... T>
void _out(H h, T... t) {
  cerr << ' ' << h;
  _out(t...);
}
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(m), b(m);
  vector<vector<int> > e(n);
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    a[i]--, b[i]--;
    e[a[i]].push_back(b[i]), e[b[i]].push_back(a[i]);
  }
  vector<int> dis(n, INT_MAX);
  queue<int> q;
  q.push(0);
  vector<vector<int> > in(n);
  dis[0] = 0;
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < e[u].size(); i++) {
      int v = e[u][i];
      if (dis[v] == INT_MAX) {
        dis[v] = dis[u] + 1;
        q.push(v);
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (dis[a[i]] + 1 == dis[b[i]]) in[b[i]].push_back(i);
    if (dis[b[i]] + 1 == dis[a[i]]) in[a[i]].push_back(i);
  }
  vector<string> res;
  vector<int> f(n);
  for (int i = 0; i < k; i++) {
    string now(m, '0');
    for (int j = 1; j < n; j++) {
      now[in[j][f[j]]] = '1';
    }
    res.push_back(now);
    bool find = false;
    for (int j = 1; j < n; j++) {
      if (f[j] + 1 < in[j].size()) {
        find = true;
        f[j]++;
        break;
      } else {
        f[j] = 0;
      }
    }
    if (!find) break;
  }
  cout << res.size() << '\n';
  for (auto i : res) cout << i << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
