#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
using namespace std;
using Int = long long;
using ll = long long;
using Double = long double;
const Int INF = 1e9; // ~ 3.6 * 1e16
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
using T = tuple<Int,Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
ostream& operator<<(ostream& o,T t){return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){Int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){Int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

class Dinic{
public:
  
  struct edge{
    Int to,cap,rev;
    edge(){};
    edge(Int to,Int cap,Int rev):to(to),cap(cap),rev(rev){};
  };

  Int V;
  vector<vector<edge> > G; //グラフの隣接リスト表現
  vector<Int> level;       //sからの距離
  vector<Int> iter;        //どこまで調べ終わったか
  Int INF;
  
  Dinic():V(-1){};
  Dinic(Int V,Int INF=1e9):V(V),G(V),level(V),iter(V),INF(INF){}

  //fromからtoへ向かう容量capの辺をグラフに追加。
  void add_edge(Int from,Int to,Int cap){  //有向
    assert(from < V && to < V);
    G[from].push_back(edge(to,cap,G[to].size()));
    G[to].push_back(edge(from,0,G[from].size()-1));
  }

  void add_edge2(Int from,Int to,Int cap){ //双方向
    G[from].push_back(edge(to,cap,G[to].size()));
    G[to].push_back(edge(from,cap,G[from].size()-1));
  }

  //sからの最短距離をBFSで計算する
  void bfs(Int s){
    level.clear(); level.resize(V,-1);
    queue<Int> que;
    level[s] = 0;
    que.push(s);
    while(!que.empty()){
      Int v = que.front(); que.pop();
      for(edge &e : G[v])
        if(e.cap > 0 && level[e.to] < 0){
          level[e.to] = level[v] + 1;
          que.push(e.to);
        }
    }
  }

  //増加パスをDFSで探す。
  Int dfs(Int v,Int t,Int f){
    if(v==t) return f;
    for(Int &i= iter[v]; i<(Int)G[v].size(); i++){
      edge &e = G[v][i];
      if(e.cap > 0 && level[v] < level[e.to]){
        Int d = dfs(e.to, t, min(f, e.cap));
        if(d > 0){
          e.cap -= d;
          G[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }

  //sからtへの最大流を求める
  Int max_flow(Int s,Int t){
    assert(V >= 0);
    Int flow=0;
    for(;;){
      bfs(s);
      if(level[t] < 0) return flow;
      if(flow >= INF) return flow;
      iter.clear();iter.resize(V,0);
      Int f;
      while((f=dfs(s ,t ,INF)) > 0 && flow < INF) flow += f;
    }
  }
};


Dinic buildDinic(Int n,Int w,vector<Int> A, vector<Int> B,Int last){
  
  Dinic F(n + w + w + 10);
  const Int S = F.V-1, T = S-1;

  for(Int i=0;i<n;i++) F.add_edge2(w + i, w + i + 1, A[i]);
  for(Int i=0;i<n;i++) F.add_edge2(w + i - w, w + i + w + 1, B[i]);

  for(Int i=1;i<=w;i+=2) F.add_edge(S, i, INF);
  for(Int i=0;i<=w;i+=2) F.add_edge(i, T, INF);
  for(Int i=0;i<=w;i++){
    Int idx = (w + n) + i;
    Int f = idx % 2;
    if(f == 0) last==0? F.add_edge(idx, T, INF):F.add_edge(S, idx, INF);
    if(f == 1) last==0? F.add_edge(S, idx, INF):F.add_edge(idx, T, INF);
  }  
  return F;
}


vector<Int> restore(Int n, Int w,Dinic F){
  vector<Int> visited(F.V);
  function<void(Int)> dfs = [&](Int pos){
    if(visited[pos]++) return;
    for(auto to:F.G[pos]){
      if(to.cap == 0) continue;
      dfs(to.to);
    }
  };

  dfs(F.V-1);
  
  vector<Int> X(F.V);
  for(Int i=0;i<F.V;i++){
    Int a = visited[i] != 0;
    Int b = i%2;
    X[i] = a ^ b;
  }

  vector<Int> res(n);
  for(Int i=0;i<n;i++) res[i] = X[i+w+1] ^ X[i+w];
  return res;
}


signed main(){
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  Int n, w;
  cin>>n>>w;
  vector<Int> A(n),B(n);
  cin>>A>>B;


  Dinic X = buildDinic(n, w, A, B, 0);
  Dinic Y = buildDinic(n, w, A, B, 1);
  const Int S = X.V - 1, T = S - 1;
  
  Int sum = 0;
  for(Int a:A) sum += a;
  for(Int b:B) sum += b;
  Int x = sum - X.max_flow(S, T);
  Int y = sum - Y.max_flow(S, T);

  vector<Int> ans = x > y?  restore(n, w, X):restore(n, w, Y);
  for(int i=0;i<n;i++) cout<<ans[i]; cout<<endl;
  
  return 0;
}



Measured memory_bytes: 4052