#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int inf = 2000000000;
const long long infLL = 9000000000000000000;
template <typename first, typename second>
ostream &operator<<(ostream &os, const pair<first, second> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "[";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &v) {
  os << "[";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}
template <typename first, typename second>
ostream &operator<<(ostream &os, const map<first, second> &v) {
  os << "[";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ", ";
    os << it->first << " = " << it->second;
  }
  return os << "]";
}
clock_t tStart = clock();
void faltu() { cerr << '\n'; }
template <typename T>
void faltu(T a[], int n) {
  for (int i = 0; i < n; ++i) cerr << a[i] << ' ';
  cerr << '\n';
}
template <typename T, typename... hello>
void faltu(T arg, const hello &...rest) {
  cerr << arg << ' ';
  faltu(rest...);
}
const int mx = 2e5 + 5;
int n, m, k;
vector<pair<int, int> > adjlist[mx];
pair<int, int> p[mx];
string s = "";
queue<int> q;
int level[mx];
int cnt = 0;
vector<int> v[mx];
vector<string> store;
void bfs(int source) {
  memset(level, -1, sizeof(level));
  q.push(source);
  level[source] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    int l = adjlist[u].size();
    for (int i = 0; i < l; ++i) {
      pair<int, int> v = adjlist[u][i];
      if (level[v.first] == -1) {
        level[v.first] = level[u] + 1;
        q.push(v.first);
      }
    }
  }
}
void recur(int node) {
  if (node == n + 1) {
    ++cnt;
    cout << s << '\n';
    if (cnt == k) exit(0);
    return;
  }
  int l = v[node].size();
  for (int i = 0; i < l; ++i) {
    int p = v[node][i];
    s[p] = '1';
    recur(node + 1);
    s[p] = '0';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> k;
  for (int i = 0; i < m; ++i) s += '0';
  for (int i = 0; i < m; ++i) {
    cin >> p[i].first >> p[i].second;
    adjlist[p[i].first].emplace_back(make_pair(p[i].second, i));
    adjlist[p[i].second].emplace_back(make_pair(p[i].first, i));
  }
  bfs(1);
  for (int i = 0; i < m; ++i) {
    if (level[p[i].first] == level[p[i].second] + 1)
      v[p[i].first].emplace_back(i);
    else if (level[p[i].second] == level[p[i].first] + 1)
      v[p[i].second].emplace_back(i);
  }
  long long temp = 1;
  for (int i = 2; i <= n; ++i) {
    temp *= v[i].size();
    if (temp > k) break;
  }
  k = min((long long)k, temp);
  cout << k << '\n';
  recur(2);
}
