#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>

const int maxn = 2e3 + 10;

char s[maxn];

void zeroes(int m) {
    for (int i = 0; i < m; ++i)
        s[i] = '0';
    s[m] = '\0';
}

void printString(int l, int r) {
    if (l != -1 && r != -1) {
        for (int i = l; i <= r; ++i)
            putc(s[i], stdout);
    } else {
        for (int i = 0; s[i] != '\0'; ++i)
            putc(s[i], stdout);
    }
    putc('\n', stdout);
    fflush(stdout);
}

bool haveString(int l = -1, int r = -1) {
    printString(l, r);
    fflush(stdout);
    char x[10];
    scanf("%s", x);
    if (x[0] == 'S')
        exit(0);
    return x[0] == '1';
}

int main() {
    //freopen("password.in", "r", stdin);
    //freopen("password.out", "w", stdout);
    int n;
    scanf("%d", &n);

    int l = 0, r = n + 1;
    while (l < r - 1) {
        int m = (l + r) >> 1;
        zeroes(m);
        if (haveString())
            l = m;
        else
            r = m;
    }

    zeroes(l);
    int len = l;
    int zeroesCount = 0;
    int maxZeroesCount = l;
    while (true) {
        s[len++] = '1';
        s[len] = '\0';
        if (!haveString()) {
            s[len - 1] = '0';
            ++zeroesCount;
        } else {
            zeroesCount = 0;
        }
        if (zeroesCount + maxZeroesCount >= n || zeroesCount >= maxZeroesCount + 1)
            break;
    }
    
    l = 0, r = zeroesCount;
    int start = len - zeroesCount - 1;
    while (l < r - 1) {
        int m = (l + r) >> 1;
        if (haveString(0, start + m))
            l = m;
        else
            r = m;
    }

    s[start + l + 1] = '\0';
    len = strlen(s);
    int need = n - (start + l + 1);
    for (int i = len; i >= 0; i--)
        s[i + need] = s[i];
    for (int i = 0; i < need; ++i) {
        s[need - i - 1] = '1';
        if (!haveString(need - i - 1, len + need - 1))
            s[need - i - 1] = '0';
    }
    haveString(0, len + need - 1);
    return 0;
}                       