import java.io.*;
import java.util.*;

public class password_dp_re {
    private StringBuilder s = new StringBuilder("");

    void solve() throws IOException {
        int n = nextInt();

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

        zeroes(l);
        int zeroesCount = 0;
        int maxZeroesCount = l;
        while (true) {
            s.append('1');
            int x = haveString(-1, -1);
            if (x == -1)
                return;
            if (x == 0) {
                s.setCharAt(s.length() - 1, '0');
                ++zeroesCount;
            } else {
                zeroesCount = 0;
            } 
            if (zeroesCount + maxZeroesCount >= n || zeroesCount >= maxZeroesCount + 1)
                break;
        }

        l = 0;
        r = zeroesCount;
        int start = s.length() - zeroesCount - 1;
        while (l < r - 1) {
            int m = (l + r) >> 1;
            int x = haveString(0, start + m);
            if (x == -1)
                return;
            if (x == 1)
                l = m;
            else
                r = m;
        }

        int len = start + l + 1;
        int need = n - (start + l + 1);
        for (int i = 0; i < need; i++)
            s.append(' ');
        for (int i = len; i >= 0; i--)
            s.setCharAt(i + need, s.charAt(i));
        for (int i = 0; i < need; ++i) {
            s.setCharAt(need - i - 1, '1');
            int x = haveString(need - i - 1, len + need - 1);
            if (x == -1)
                return;
            if (x == 0)
                s.setCharAt(need - i - 1, '0');
        }
        haveString(0, len + need - 1);
    }

    void zeroes(int m) {
        s.delete(0, s.length());
        for (int i = 0; i < m; i++)
            s.append('0');
    }

    int haveString(int l, int r) throws IOException {
        printString(l, r);
        out.flush();
        String s = nextToken();
        if (s.charAt(0) == 'S')
            return -1;
        return (s.charAt(0) == '1') ? 1 : 0;
    }

    void printString(int l, int r) {
        if (l != -1 && r != -1) {
            for (int i = l; i <= r; i++)
                out.print(s.charAt(i));
        } else {
            out.print(s);
        }
        out.println();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new password_dp_re().run();
    }

    String nextToken() throws IOException {
        while ((st == null) || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }
}
