#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > g[200005];
vector<int> pre[200005];
vector<string> ans;
int dis[200005];
char s[200005];
void bfs(int x) {
  queue<pair<int, int> > q;
  q.push(pair<int, int>(1, 0));
  while (!q.empty()) {
    pair<int, int> y = q.front();
    q.pop();
    for (int i = 0; i < g[y.first].size(); i++) {
      int v = g[y.first][i].first;
      if (y.second + 1 < dis[v]) {
        dis[v] = y.second + 1;
        q.push(pair<int, int>(v, dis[v]));
      }
    }
  }
}
int n, k;
void dfs(int x) {
  if (ans.size() >= k) return;
  if (x > n) {
    ans.push_back(s);
    return;
  }
  for (int i = 0; i < pre[x].size(); i++) {
    s[pre[x][i]] = '1';
    dfs(x + 1);
    s[pre[x][i]] = '0';
  }
}
int main() {
  int m;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(pair<int, int>(b, i));
    g[b].push_back(pair<int, int>(a, i));
  }
  for (int i = 2; i <= n; i++) dis[i] = 300000;
  bfs(1);
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < g[i].size(); j++) {
      int v = g[i][j].first;
      if (dis[v] + 1 == dis[i]) pre[i].push_back(g[i][j].second);
    }
  }
  for (int i = 0; i < m; i++) s[i] = '0';
  s[m] = '\0';
  dfs(2);
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
