#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
struct edgepar {
  int v;
  int id;
};
const int maxn = 2e5 + 5;
queue<int> bfs;
int n, m, k, cnt;
bool vis[maxn], ans[maxn];
string s[maxn];
vector<edgepar> d[maxn];
int father[maxn];
void print() {
  cnt++;
  for (int i = 1; i <= m; ++i) s[cnt] += '0' + ans[i];
}
void dfs(int cur) {
  if (cur > n) {
    print();
    return;
  }
  for (auto nxt : d[cur]) {
    if (cnt >= k) {
      return;
    }
    if (father[nxt.v] == father[cur] - 1)
      ans[nxt.id] = true, dfs(cur + 1), ans[nxt.id] = false;
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    d[u].push_back({v, i});
    d[v].push_back({u, i});
  }
  bfs.push(1);
  vis[1] = true;
  while (!bfs.empty()) {
    int cur = bfs.front();
    bfs.pop();
    for (auto nxt : d[cur])
      if (!vis[nxt.v])
        father[nxt.v] = father[cur] + 1, bfs.push(nxt.v), vis[nxt.v] = true;
  }
  dfs(2);
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) cout << s[i] << endl;
  return 0;
}
