Problem: There are n cities in Berland. Some pairs of cities are connected by roads. All roads are bidirectional. Each road connects two different cities. There is at most one road between a pair of cities. The cities are numbered from 1 to n.

It is known that, from the capital (the city with the number 1), you can reach any other city by moving along the roads.

The President of Berland plans to improve the country's road network. The budget is enough to repair exactly n-1 roads. The President plans to choose a set of n-1 roads such that:

  * it is possible to travel from the capital to any other city along the n-1 chosen roads, 
  * if d_i is the number of roads needed to travel from the capital to city i, moving only along the n-1 chosen roads, then d_1 + d_2 + ... + d_n is minimized (i.e. as minimal as possible). 



In other words, the set of n-1 roads should preserve the connectivity of the country, and the sum of distances from city 1 to all cities should be minimized (where you can only use the n-1 chosen roads).

The president instructed the ministry to prepare k possible options to choose n-1 roads so that both conditions above are met.

Write a program that will find k possible ways to choose roads for repair. If there are fewer than k ways, then the program should output all possible valid ways to choose roads.

Input

The first line of the input contains integers n, m and k (2 ≤ n ≤ 2⋅10^5, n-1 ≤ m ≤ 2⋅10^5, 1 ≤ k ≤ 2⋅10^5), where n is the number of cities in the country, m is the number of roads and k is the number of options to choose a set of roads for repair. It is guaranteed that m ⋅ k ≤ 10^6.

The following m lines describe the roads, one road per line. Each line contains two integers a_i, b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i) — the numbers of the cities that the i-th road connects. There is at most one road between a pair of cities. The given set of roads is such that you can reach any city from the capital.

Output

Print t (1 ≤ t ≤ k) — the number of ways to choose a set of roads for repair. Recall that you need to find k different options; if there are fewer than k of them, then you need to find all possible different valid options.

In the following t lines, print the options, one per line. Print an option as a string of m characters where the j-th character is equal to '1' if the j-th road is included in the option, and is equal to '0' if the road is not included. The roads should be numbered according to their order in the input. The options can be printed in any order. All the t lines should be different.

Since it is guaranteed that m ⋅ k ≤ 10^6, the total length of all the t lines will not exceed 10^6.

If there are several answers, output any of them.

Examples

Input

4 4 3
1 2
2 3
1 4
4 3


Output

2
1110
1011


Input

4 6 3
1 2
2 3
1 4
4 3
2 4
1 3


Output

1
101001


Input

5 6 2
1 2
1 3
2 4
2 5
3 4
3 5


Output

2
111100
110110

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
const double pi = 3.141592653589793238462643383279;
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
inline int readInt() {
  int x;
  scanf("%d", &x);
  return x;
}
const double EPS = 1E-8;
class UnionFind {
 public:
  vector<int> par;
  vector<int> siz;
  UnionFind(int sz_) : par(sz_), siz(sz_, 1) {
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  void init(int sz_) {
    par.resize(sz_);
    siz.assign(sz_, 1LL);
    for (long long i = 0; i < sz_; ++i) par[i] = i;
  }
  int root(int x) {
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }
  bool merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }
  bool issame(int x, int y) { return root(x) == root(y); }
  int size(int x) { return siz[root(x)]; }
};
long long modPow(long long x, long long n, long long mod = 1000000007) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    res %= mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
bool sieve[5000000 + 10];
void makeSieve() {
  for (int i = 0; i < 5000000 + 10; ++i) sieve[i] = true;
  sieve[0] = sieve[1] = false;
  for (int i = 2; i * i < 5000000 + 10; ++i)
    if (sieve[i])
      for (int j = 2; i * j < 5000000 + 10; ++j) sieve[i * j] = false;
}
bool isprime(long long n) {
  if (n == 0 || n == 1) return false;
  for (long long i = 2; i * i <= n; ++i)
    if (n % i == 0) return false;
  return true;
}
const int MAX = 2000010;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = 1000000007 - inv[1000000007 % i] * (1000000007 / i) % 1000000007;
    finv[i] = finv[i - 1] * inv[i] % 1000000007;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % 1000000007) % 1000000007;
}
long long extGCD(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = extGCD(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
inline long long mod(long long a, long long m) { return (a % m + m) % m; }
long long modinv(long long a, long long m) {
  long long x, y;
  extGCD(a, m, x, y);
  return mod(x, m);
}
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
vector<vector<long long>> mul(vector<vector<long long>> &A,
                              vector<vector<long long>> &B) {
  vector<vector<long long>> C(A.size(), vector<long long>((int)B[0].size()));
  for (int i = 0; i < A.size(); ++i) {
    for (int k = 0; k < B.size(); ++k) {
      for (int j = 0; j < B[0].size(); ++j) {
        C[i][j] = (C[i][j] + A[i][k] * B[k][j] % 1000000007) % 1000000007;
      }
    }
  }
  return C;
}
vector<vector<long long>> matPow(vector<vector<long long>> A, long long n) {
  vector<vector<long long>> B(A.size(), vector<long long>((int)A.size()));
  for (int i = 0; i < A.size(); ++i) {
    B[i][i] = 1;
  }
  while (n > 0) {
    if (n & 1) B = mul(B, A);
    A = mul(A, A);
    n >>= 1;
  }
  return B;
}
map<long long, long long> prime_factor(long long n) {
  map<long long, long long> res;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n] = 1;
  return res;
}
struct Node {
  int mi, mx;
  Node(int mi, int mx) : mi(mi), mx(mx) {}
  Node() {}
} seg[1 << 23];
void update(int i, int x) {
  i += (1 << 22) - 1;
  seg[i].mi = seg[i].mx = x;
  while (i > 0) {
    i = (i - 1) / 2;
    seg[i].mi = min(seg[i * 2 + 1].mi, seg[i * 2 + 2].mi);
    seg[i].mx = max(seg[i * 2 + 1].mx, seg[i * 2 + 2].mx);
  }
}
Node query(int a, int b, int k = 0, int l = 0, int r = (1 << 22)) {
  if (r <= a || b <= l) return Node(INT_MAX, -INT_MAX);
  if (a <= l && r <= b)
    return seg[k];
  else {
    Node vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    Node vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return Node(min(vl.mi, vr.mi), max(vl.mx, vr.mx));
  }
}
vector<vector<int>> g(200010);
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(m), b(m);
  for (int i = 0; i < (int)m; ++i) {
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
  }
  queue<int> q;
  q.push(0);
  vector<int> d(n, INT_MAX);
  d[0] = 0;
  while (q.size()) {
    int v = q.front();
    q.pop();
    for (int u : g[v]) {
      if (d[u] == INT_MAX) {
        d[u] = d[v] + 1;
        q.push(u);
      }
    }
  }
  vector<vector<int>> cand(n);
  for (int i = 0; i < (int)m; ++i) {
    if (d[a[i]] + 1 == d[b[i]]) {
      cand[b[i]].push_back(i);
    }
    if (d[b[i]] + 1 == d[a[i]]) {
      cand[a[i]].push_back(i);
    }
  }
  vector<int> cnt(n);
  vector<string> res;
  for (int i = 0; i < (int)k; ++i) {
    string s(m, '0');
    for (int j = 1; j < n; j++) {
      s[cand[j][cnt[j]]] = '1';
    }
    res.push_back(s);
    bool ok = false;
    for (int j = 1; j < n; j++) {
      if (cnt[j] + 1 < cand[j].size()) {
        ok = true;
        cnt[j]++;
        break;
      } else {
        cnt[j] = 0;
      }
    }
    if (!ok) break;
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << endl;
  }
  return 0;
}