#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int L[1000];
bool table[1020];
int n,m;

bool solve() {
  for (int i=1; i<n; ++i) {
    int hoge = L[i-1]-table[i-1];
    if (hoge == L[i]) table[i+m-1] = 0;
    else if (hoge == L[i]-1) table[i+m-1] = 1;
    else return 0;
  }
  return 1;
}

int main() {
  while(cin >> n >> m, n||m) {
    REP(i, n) cin >> L[i];
    string s = string(m-L[0], '0') + string(L[0], '1');
    bool ok = 0;
    do {
      REP(i, m) table[i] = (s[i]=='1');
      if (solve()) {
        ok = 1;
        break;
      }
    } while(next_permutation(ALL(s)));
    if (ok) {
      REP(i, n+m-1) cout << table[i];
      cout << endl;
    } else {
      cout << "Goofy" << endl;
    }
  }
  
}