#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
vector<int> adj[N], l[N];
int dist[N], n, m, k, ans[N], a[N], b[N], aa[N];
vector<vector<int> > vv;
void print(int lvl) {
  if (lvl == 0) {
    for (int i = 1; i <= m; i++) {
      cout << ans[i];
    }
    cout << "\n";
    --k;
    if (!k) exit(0);
    return;
  }
  for (int x : l[aa[lvl]]) {
    ans[x] = 1;
    print(lvl - 1);
    ans[x] = 0;
  }
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    a[i] = u;
    b[i] = v;
  }
  dist[1] = 1;
  queue<int> q;
  q.push(1);
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (int v : adj[u])
      if (!dist[v]) {
        dist[v] = dist[u] + 1;
        q.push(v);
      }
  }
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j : adj[i]) {
      if (dist[j] + 1 == dist[i]) ++cnt;
    }
    if (cnt) ans *= cnt;
    ans = min(ans, 1LL * k);
    aa[i] = i;
  }
  for (int i = 1; i <= m; i++) {
    if (dist[a[i]] > dist[b[i]]) swap(a[i], b[i]);
    if (dist[a[i]] + 1 == dist[b[i]]) {
      l[b[i]].push_back(i);
    }
  }
  sort(aa + 1, aa + n + 1,
       [](int i, int j) { return l[i].size() > l[j].size(); });
  cout << ans << endl;
  k = min(1LL * k, ans);
  print(n - 1);
}
