#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1010;
const int MAXM = 13;
int N, M;
int L[MAXN];
int dp[MAXN][1<<MAXM], prevj[MAXN][1<<MAXM];

int main() {
  while(cin >> N >> M && (N|M)) {
    for(int i = 0; i < N; ++i) {
      cin >> L[i];
    }
    memset(dp, 0, sizeof(dp));
    for(int j = 0; j < (1<<M); ++j) {
      dp[1][j] = (__builtin_popcount(j) == L[0]);
    }
    for(int i = 1; i < N; ++i) {
      for(int j = 0; j < (1<<M); ++j) {
	if(dp[i][j] == 0) continue;
	for(int k = 0; k < 2; ++k) {
	  int nj = (j | (k << M)) >> 1;
	  if(__builtin_popcount(nj) != L[i]) continue;
	  dp[i+1][nj] = min(2, dp[i+1][nj] + dp[i][j]);
	  prevj[i+1][nj] = j;
	}
      }
    }
    int b = -1;
    for(int j = 0; j < (1<<M); ++j) {
      if(dp[N][j]) b = j;
    }
    if(b != -1) {
      vector<int> v;
      int i, j;
      for(i = N, j = b; i > 1; --i) {
	int nj = prevj[i][j];
	v.push_back(j >> (M-1) & 1);
	j = nj;
      }
      for(int k = M-1; k >= 0; --k) {
	v.push_back(j >> k & 1);
      }
      reverse(v.begin(), v.end());
      for(int k = 0; k < v.size(); ++k) {
	cout << v[k];
      }
      cout << endl;
    } else {
      cout << "Goofy" << endl;
    }
  }
  return 0;
}