#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 1000;
const int MAX_M = 12;
const int MAX_LEN = MAX_N + MAX_M - 1;

/* typedef */

/* global variables */

int n, m, len, mbits;
int ls[MAX_N], ks[MAX_LEN];

/* subroutines */

bool check_ls(int bits) {
  int c = 0;
  for (int i = 0; i < m; i++, bits >>= 1)
    if ((ks[i] = bits & 1)) c++;
  if (ls[0] != c) return false;

  for (int j = 1; j < n; j++) {
    if (ks[j - 1]) c--;
    if (ls[j] == c) ks[j + m - 1] = 0;
    else if (ls[j] == c + 1) ks[j + m - 1] = 1, c++;
    else return false;
  }
  return true;
}

/* main */

int main() {
  for (;;) {
    cin >> n >> m;
    if (n == 0) break;

    for (int i = 0; i < n; i++) cin >> ls[i];

    len = n + m - 1;
    mbits = (1 << m) - 1;
    bool found = false;
    
    for (int bits = 0; ! found && bits <= mbits; bits++)
      found = check_ls(bits);

    if (found) {
      for (int i = 0; i < len; i++) cout << ks[i];
      cout << endl;
    }
    else
      cout << "Goofy" << endl;
  }

  return 0;
}