#include <bits/stdc++.h>
using namespace std;
int dis[500010], n, m, k, head[500010], ans[500010];
vector<int> vec[500005];
int tot = 0;
long long cnt = 1;
struct st {
  int u, v, nx;
} edge[500005];
void add(int u, int v) {
  edge[tot].u = u;
  edge[tot].v = v;
  edge[tot].nx = head[u];
  head[u] = tot++;
}
void bfs() {
  queue<int> q;
  int u, v;
  q.push(1);
  dis[1] = 0;
  while (!q.empty()) {
    u = q.front();
    q.pop();
    for (int i = head[u]; ~i; i = edge[i].nx) {
      v = edge[i].v;
      if (dis[v] != -1) continue;
      dis[v] = dis[u] + 1;
      q.push(v);
    }
  }
}
void dfs(int u) {
  if (cnt <= 0) return;
  if (u == n + 1) {
    cnt--;
    for (int i = 1; i <= m; i++) {
      printf("%d", ans[i]);
    }
    puts("");
    return;
  }
  for (int i = 0; i < vec[u].size(); i++) {
    ans[vec[u][i]] = 1;
    dfs(u + 1);
    ans[vec[u][i]] = 0;
  }
}
int main() {
  int u, v;
  memset(head, -1, sizeof(head));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  memset(dis, -1, sizeof(dis));
  bfs();
  for (int i = 0; i < tot; i++) {
    int u, v;
    u = edge[i].u;
    v = edge[i].v;
    if (dis[u] + 1 == dis[v]) {
      vec[v].push_back(i / 2 + 1);
    }
  }
  cnt = 1;
  for (int i = 2; i <= n; i++) {
    cnt *= vec[i].size();
    if (cnt >= k) break;
  }
  cnt = min(cnt, 1LL * k);
  printf("%lld\n", cnt);
  dfs(2);
  return 0;
}
