#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
int n;
int main() {
  while (cin >> n) {
    if (n == -1) break;
    switch (n) {
      case 0:
        puts("1111110");
        break;
      case 1:
        puts("0110000");
        break;
      case 2:
        puts("1101101");
        break;
      case 3:
        puts("1111001");
        break;
      case 4:
        puts("0110011");
        break;
      case 5:
        puts("1011011");
        break;
      case 6:
        puts("1011111");
        break;
      case 7:
        puts("1110010");
        break;
      case 8:
        puts("1111111");
        break;
      case 9:
        puts("1111011");
        break;
    }
  }
}
