#include <fstream>
#include <string>

using namespace std;

unsigned int accu, pc;
unsigned int m[32];

#include <iostream>
#define in cin

#define cmd(x) ((x)>>5)

int main() {
  while (1) {
    string s;
    if (!(in >> s))
      break;

    for (int i=0; i<32; i++) {
      m[i] = s[0] - '0';
      for (int j=1; j<8; j++) {
	m[i] *= 2;
	m[i] += s[j]-'0';
      }
      if (i<31)
	in >> s;
    }
    
    accu = pc = 0;
    while (1) {
      int command = m[pc] >> 5;
      int address = m[pc] % 32;
      // cout << accu << " " << pc << " " << command << " " << address << endl;
      pc = (pc+1)%32;
      switch(command) {
      case 0: m[address] = accu; continue;
      case 1: accu = m[address]; continue;
      case 2: if (accu == 0) pc = address; continue;
      case 3: continue;
      case 4: accu = (accu+255)%256; continue;
      case 5: accu = (accu+1)%256; continue;
      case 6: pc = address; continue;
      }
      break;
    }
    //  cout << accu << endl;
    for (int i=7; i>=0; i--)
      cout << (accu & (1<<i)?"1":"0");
    cout << endl;
  }

  return 0;
}
