#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, INF = 0x3f3f3f3f;
int n, m;
long long k;
int he[N], ne[N << 1], to[N << 1], tot = 0;
int u, v;
int dis[N];
long long ans, num[N];
int sum, chose[N];
queue<int> q;
vector<int> pr[N];
void add(int u, int v) {
  ne[++tot] = he[u];
  to[tot] = v;
  he[u] = tot;
}
void dfs(int u) {
  if (u == n + 1) {
    for (int i = 1; i <= m; i++) printf("%d", chose[i]);
    printf("\n");
    if (++sum == k) exit(0);
    return;
  }
  for (int i = 0; i < pr[u].size(); i++) {
    chose[(pr[u][i] + 1) / 2] = 1;
    dfs(u + 1);
    chose[(pr[u][i] + 1) / 2] = 0;
  }
}
int main() {
  ans = 1;
  scanf("%d%d%lld", &n, &m, &k);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    add(u, v), add(v, u);
  }
  memset(dis, 0x3f, sizeof(dis));
  dis[1] = 0;
  q.push(1);
  while (q.size()) {
    u = q.front(), q.pop();
    for (int i = he[u]; i; i = ne[i]) {
      v = to[i];
      if (dis[v] == INF) {
        dis[v] = dis[u] + 1;
        num[v]++;
        q.push(v);
        pr[v].push_back(i);
      } else if (dis[v] == dis[u] + 1) {
        num[v]++;
        pr[v].push_back(i);
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (ans * num[i] < ans) exit(-1);
    if (ans * num[i] > k) {
      ans = k;
      break;
    } else {
      ans *= num[i];
    }
  }
  printf("%lld\n", ans);
  dfs(2);
}
