#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"
int pos0,pos1,total,ans,n;
string s;

int power(int a,int b,int m=mod)
{
	if(b==0)	return 1;
	if(b==1)	return a;
	int res=power(a,b/2,m);
	res=(res*res)%m;
	if(b&1)	res=(res*a)%m;
	return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	return (a+b)%m;}
int sub(int a,int b,int m=mod){	return (a-b+m)%m;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}
// x<<1 => x*2		x>>1 => x/2;	cout<<flush;

int query(string s)
{
	cout<<"? "<<s<<endl;
	cout<<flush;
	cin>>ans;
	return n-ans;
}

int check(int l,int r)
{
	string x=s;
	for(int i=l;i<=r;i++)	x[i]='0';
	return query(x);
}

void bs1(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		pos1=low+1;
	else if(val==(mid-low+1))
		bs1(mid+1,high);
	else
		bs1(low,mid);
}

void bs0(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		bs0(mid+1,high);
	else if(val==(mid-low+1))
		pos0=low+1;
	else
		bs0(low,mid);
}

void bs(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		pos1=low+1,bs0(mid+1,high);
	else if(val==(mid-low+1))
		pos0=low+1,bs1(mid+1,high);
	else
		bs(low,mid);
}

void solve()
{
	int i;
	cin>>n;
	s=string(n,'1');
	total=query(s);
	bs(0,n-1);
	cout<<"! "<<pos0<<" "<<pos1<<endl;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int t=1;//cin>>t;
	while(t--)	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"
int pos0,pos1,total,ans,n;
string s;

int power(int a,int b,int m=mod)
{
	if(b==0)	return 1;
	if(b==1)	return a;
	int res=power(a,b/2,m);
	res=(res*res)%m;
	if(b&1)	res=(res*a)%m;
	return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	return (a+b)%m;}
int sub(int a,int b,int m=mod){	return (a-b+m)%m;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}
// x<<1 => x*2		x>>1 => x/2;	cout<<flush;

int query(string s)
{
	cout<<"? "<<s<<endl;
	cout<<flush;
	cin>>ans;
	return n-ans;
}

int check(int l,int r)
{
	string x=s;
	for(int i=l;i<=r;i++)	x[i]='0';
	return query(x);
}

void bs1(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		pos1=low+1;
	else if(val==(mid-low+1))
		bs1(mid+1,high);
	else
		bs1(low,mid);
}

void bs0(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		bs0(mid+1,high);
	else if(val==(mid-low+1))
		pos0=low+1;
	else
		bs0(low,mid);
}

void solve()
{
	int i;
	cin>>n;
	s=string(n,'1');
	total=query(s);
	int val=check(0,0);
	if(val==total+1)	pos0=1,bs1(1,n-1);
	else			pos1=1,bs0(1,n-1);
	cout<<"! "<<pos0<<" "<<pos1<<endl;
}

int32_t main()
{
	//ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int t=1;//cin>>t;
	while(t--)	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"
int pos0,pos1,total,ans,n;
string s;

int power(int a,int b,int m=mod)
{
	if(b==0)	return 1;
	if(b==1)	return a;
	int res=power(a,b/2,m);
	res=(res*res)%m;
	if(b&1)	res=(res*a)%m;
	return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	return (a+b)%m;}
int sub(int a,int b,int m=mod){	return (a-b+m)%m;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}
// x<<1 => x*2		x>>1 => x/2;	cout<<flush;

int query(string s)
{
	cout<<"? "<<s<<endl;
	cout<<flush;
	cin>>ans;
	return n-ans;
}

int check(int l,int r)
{
	string x=s;
	for(int i=l;i<=r;i++)	x[i]='0';
	return query(x);
}

void bs1(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		pos1=low+1;
	else if(val==(mid-low+1))
		bs1(mid+1,high);
	else
		bs1(low,mid);
}

void bs0(int low,int high)
{
	if(low>high)	return;
	int mid=(low+high)/2;
	int val=check(low,mid)-total;
	if(val==-(mid-low+1))
		bs0(mid+1,high);
	else if(val==(mid-low+1))
		pos0=low+1;
	else
		bs0(low,mid);
}

void solve()
{
	int i;
	cin>>n;
	s=string(n,'1');
	total=query(s);
	int val=check(0,0);
	if(val==no+1)	pos0=1,bs1(1,n-1);
	else			pos1=1,bs0(1,n-1);
	cout<<"! "<<pos0<<" "<<pos1<<endl;
}

int32_t main()
{
	//ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int t=1;//cin>>t;
	while(t--)	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"

int power(int a,int b,int m=mod)
{
	if(b==0)	return 1;
	if(b==1)	return a;
	int res=power(a,b/2,m);
	res=(res*res)%m;
	if(b&1)	res=(res*a)%m;
	return res;
}
int modinv(int a,int m=mod){ return power(a,m-2,m);}
int add(int a,int b,int m=mod){	return (a+b)%m;}
int sub(int a,int b,int m=mod){	return (a-b+m)%m;}
int mul(int a,int b,int m=mod){	return (a*b)%m;}
// x<<1 => x*2		x>>1 => x/2;	cout<<flush;

void solve()
{
	int n,i;
	cin>>n;
	int a[n],pos[2],prev,new_val;
	pos[0]=pos[1]=0;
	for(i=0;i<n;i++)	a[i]=0;
	cout<<"? ";
	for(i=0;i<n;i++)	cout<<a[i];
	cout<<endl<<flush;
	cin>>prev;
	int low=0,high=n,mid;
	while(low<=high)
	{
		mid=(low+high)/2;
		for(i=low;i<=mid;i++)
			a[i]=1-a[i];
		int val=mid-low+1;
		cout<<"? ";
		for(i=0;i<n;i++)	cout<<a[i];
		cout<<endl<<flush;
		cin>>new_val;
		if(new_val==prev-val)
		{
			pos[a[low]]=low+1;
			if(mid==low)
				pos[1-a[low]]=low+2;
			low=mid+1;

		}
		else if(new_val==prev+val)
		{
			pos[1-a[low]]=low+1;
			if(mid==low)
				pos[a[low]]=low+2;
			low=mid+1;
		}
		else
			high=mid-1;
		prev=new_val;
	}
	cout<<"! "<<pos[0]<<" "<<pos[1]<<endl;
}

int32_t main()
{
	//ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int t=1;//cin>>t;
	while(t--)	solve();
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll create(ll a,ll b,ll n,bool q){
    cout<<"? ";
    string s="";
    for(ll i=0;i<n;i++){
        if(i>=a and i<=b){
            s.push_back(q+'0');
        }else{
            s.push_back(!q+'0');
        }
    }
    cout<<s<<"\n";
    ll r;
    cin>>r;
    return n-r;
}
string s;
ll c;
ll n;

ll f0(ll s,ll b){
    while(s<b){
        ll v=(s+b)/2;
        ll r=create(s,v,n,0)-c;
        if(r!=-(v-s+1))
            b=v;
        else{
            s=v+1;
        }
    }
    return s;
}

ll f1(ll s,ll b){
    while(s<b){
        //cout<<s<<" "<<b<<"\n";
        ll v=(s+b)/2;
        ll r=create(s,v,n,0)-c;
        if(r!=(v-s+1))
            b=v;
        else{
            s=v+1;
        }
    }
    return s;
}
int main()
{
    cin>>n;
    ll c=create(0,n,n,1);
    ll s=0,b=n-1;
    ll r0,r1;
    while(s<b){
        ll v=(s+b)/2;
        ll r=create(s,v,n,0)-c;
        //cout<<"r-> "<<r<<"\n";
        if(r==-(v-s+1)){
            r1=s;
            r0=f0(v+1,b);
            break;
        }else if(r==(v-s+1)){
            r0=s;
            r1=f1(v+1,b);
            break;
        }else{
            b=v;
        }
    }
    cout<<"! "<<r0+1<<" "<<r1+1<<"\n";
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll create(ll a,ll b,ll n,bool q){
    cout<<"? ";
    string s="";
    for(ll i=0;i<n;i++){
        if(i>=a and i<=b){
            s.push_back(q+'0');
        }else{
            s.push_back(!q+'0');
        }
    }
    cout<<s<<"\n";
}
string s;
ll c;
ll n;
ll f0(ll s,ll b){
    while(s<b){
        ll v=(s+b)/2;
        create(s,v,n,1);
        ll r;
        cin>>r;
        if(r+(v-s+1)==c)
            s=v+1;
        else{
            b=v;
        }
    }
    return s;
}

ll f1(ll s,ll b){
    while(s<b){
        ll v=(s+b)/2;
        create(s,v,n,1);
        ll r;
        cin>>r;
        if(r-(v-s+1)==c)
            s=v+1;
        else{
            b=v;
        }
    }
    return s;
}
int main()
{
    cin>>n;
    create(0,n,n,0);
    cin>>c;
    ll s=0,b=n-1;
    ll r0,r1;
    create(1,n,n,0);
    ll c2;
    cin>>c2;
    if(c<c2){
        r0=1;
        r1=f1(0,n-1)+1;
    }else{
        r1=1;
        r0=f0(0,n-1)+1;
    }
    cout<<"! "<<r0<<" "<<r1<<"\n";
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll create(ll a,ll b,ll n,bool q){
    cout<<"? ";
    string s="";
    for(ll i=0;i<n;i++){
        if(i>=a and i<=b){
            s.push_back(q+'0');
        }else{
            s.push_back(!q+'0');
        }
    }
    cout<<s<<"\n";
    ll r;
    cin>>r;
    return n-r;
}
string s;
ll c;
ll n;

ll f0(ll s,ll b){
    while(s<b){
        ll v=(s+b)/2;
        ll r=create(s,v,n,0)-c;
        if(r!=-(v-s+1))
            b=v;
        else{
            s=v+1;
        }
    }
    return s;
}

ll f1(ll s,ll b){
    while(s<b){
        //cout<<s<<" "<<b<<"\n";
        ll v=(s+b)/2;
        ll r=create(s,v,n,0)-c;
        if(r!=(v-s+1))
            b=v;
        else{
            s=v+1;
        }
    }
    return s;
}
int main()
{
    cin>>n;
    ll c=create(0,n,n,1);
    ll s=0,b=n-1;
    ll r0,r1;
    while(s<b){
        ll v=(s+b)/2;
        ll r=create(s,v,n,0)-c;
        //cout<<"r-> "<<r<<"\n";
        if(r==-(v-s+1)){
            r1=s;
            r0=f0(v+1,b);
            break;
        }else if(r==(v-s+1)){
            r0=s;
            r1=f1(v+1,b);
            break;
        }else{
            b=v;
        }
    }
    cout<<"! "<<r0+1<<" "<<r1+1<<"\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
void create(ll a,ll b,ll n,bool q){
    cout<<"? ";
    for(ll i=0;i<n;i++){
        if(i>=a and i<=b){
            cout<<q;
        }else{
            cout<<!q;
        }
    }
    cout<<"\n";
}
string s;
ll c;
ll n;

ll f0(ll s,ll b){
    while(s<b){
        ll v=(s+b)/2;
        create(s,v,n,1);
        ll r;
        cin>>r;
        if(r+(v-s+1)==c)
            s=v+1;
        else{
            b=v;
        }
    }
    return s;
}

ll f1(ll s,ll b){
    while(s<b){
        ll v=(s+b)/2;
        create(s,v,n,1);
        ll r;
        cin>>r;
        if(r-(v-s+1)==c)
            s=v+1;
        else{
            b=v;
        }
    }
    return s;
}
int main()
{
    cin>>n;
    create(0,n,n,0);
    cin>>c;
    ll s=0,b=n-1;
    ll r0,r1;
    while(s<b){
        ll v=(s+b)/2;
        create(s,v,n,1);
        ll r;
        cin>>r;

        if(r-(v-s+1)==c){
            r1=s;
            r0=f0(v+1,b);
            break;
        }else if(r+(v-s+1)==c){
            r0=s;
            r1=f1(v+1,b);
            break;
        }else{
            s=v;
        }
    }
    cout<<"! "<<r1+1<<" "<<r0+1<<"\n";
}


/// Code by Leonardo16
///   “It is not the strength of the body, but the strength of the spirit.”   —  J.R.R. Tolkien
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
/// Macros
#define int long long
#define ll long long
#define sz size
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define ii pair<int,int>
#define vii vector<ii>
#define fst first
#define scd second
#define pb push_back
#define fl '\n'
#define el endl
#define all(x) x.begin() , x.end()
#define rall(x) x.rbegin() , x.rend()
/// Functions
#define db(x) cerr << #x << ": " << (x) << '\n';
#define random() __builtin_ia32_rdtsc()
#define lg2(x) 31-__builtin_clz(x)
#define lg2ll(x) 63-__builtin_clzll(x)
#define pi acos(-1)
#define YN(x) cout<<((x)?("YES"):("NO"))<<fl;
#define yn(x) cout<<((x)?("Yes"):("No"))<<fl;
/// Red-Black Tree Template
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree < long long ,  null_type ,  less<long long> ,  rb_tree_tag ,  tree_order_statistics_node_update > ordered_set;
//#define less_than(n) order_of_key(n)
//#define en_pos(n) find_by_order(n)
/// Prime numbers  173,179,311,331,737,1009,2011,2027,3079,4001,100003
///===================================================================
int n;

main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    cin>>n;

    int s1=0,s2=0;
    char beg,ot;
    cout<<"? ";
    cout.flush();
    for(int i=1;i<=n;i++){
        cout<<"1";
    }cout<<el;
    cout.flush();
    cin>>s1;

    cout<<"? 0";
    cout.flush();
    for(int i=2;i<=n;i++){
        cout<<"1";
    }cout<<el;
    cin>>s2;

    if(s1>s2){
        beg='0';ot='1';
    }else{
        beg='1';ot='0';
    }

    cout<<"? ";
    cout.flush();
    for(int i=1;i<=n;i++){
        cout<<beg;
    }cout<<el;
    int st;
    cin>>st;

    int wr=n+1;
    for(int i=11;i>=0;i--){
        if(wr-(1<<i)>0){
            cout<<"? ";
            cout.flush();
            for(int j=1;j<wr-(1<<i);j++){
                cout<<beg;
                cout.flush();
            }
            for(int j=wr-(1<<i);j<=n;j++){
                cout<<ot;
                cout.flush();
            }
            cout<<el;
            cout.flush();
            int x;
            cin>>x;

            if( (n+1)-(wr-(1<<i)) ==  x-st ){
                wr-=(1<<i);
            }
        }
    }

    if(beg=='0'){
        cout<<"! "<<1<<" "<<wr-1<<el;
        cout.flush();
    }else{
        cout<<"! "<<wr-1<<" "<<1<<el;
        cout.flush();
    }
return 0;}


/// Code by Leonardo16
///   “It is not the strength of the body, but the strength of the spirit.”   —  J.R.R. Tolkien
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
/// Macros
#define int long long
#define ll long long
#define sz size
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define ii pair<int,int>
#define vii vector<ii>
#define fst first
#define scd second
#define pb push_back
#define fl '\n'
#define el endl
#define all(x) x.begin() , x.end()
#define rall(x) x.rbegin() , x.rend()
/// Functions
#define db(x) cerr << #x << ": " << (x) << '\n';
#define random() __builtin_ia32_rdtsc()
#define lg2(x) 31-__builtin_clz(x)
#define lg2ll(x) 63-__builtin_clzll(x)
#define pi acos(-1)
#define YN(x) cout<<((x)?("YES"):("NO"))<<fl;
#define yn(x) cout<<((x)?("Yes"):("No"))<<fl;
/// Red-Black Tree Template
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree < long long ,  null_type ,  less<long long> ,  rb_tree_tag ,  tree_order_statistics_node_update > ordered_set;
//#define less_than(n) order_of_key(n)
//#define en_pos(n) find_by_order(n)
/// Prime numbers  173,179,311,331,737,1009,2011,2027,3079,4001,100003
///===================================================================
int n;

main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    cin>>n;

    int s1=0,s2=0;
    char beg,ot;
    cout<<"? ";
    cout.flush();
    for(int i=1;i<=n;i++){
        cout<<"1";
    }cout<<el;
    cout.flush();
    cin>>s1;

    cout<<"? 0";
    cout.flush();
    for(int i=2;i<=n;i++){
        cout<<"1";
    }cout<<el;
    cin>>s2;

    if(s1>s2){
        beg='0';ot='1';
    }else{
        beg='1';ot='0';
    }

    cout<<"? ";
    cout.flush();
    for(int i=1;i<=n;i++){
        cout<<beg;
    }cout<<el;
    int st;
    cin>>st;

    int wr=n+1;
    for(int i=11;i>=0;i--){
        if(wr-(1<<i)>0){
            cout<<"? ";
            cout.flush();
            for(int j=1;j<wr-(1<<i);j++){
                cout<<beg;
                cout.flush();
            }
            for(int j=wr-(1<<i);j<=n;j++){
                cout<<ot;
                cout.flush();
            }
            cout<<el;
            int x;
            cin>>x;

            if( (n+1)-(wr-(1<<i)) ==  x-st ){
                wr-=(1<<i);
            }
        }
    }

    if(beg==0){
        cout<<"! "<<1<<" "<<wr-1<<el;
    }else{
        cout<<"! "<<wr-1<<" "<<1<<el;
    }
return 0;}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;
int n;
string tquery(int l, int r) {
	string q = "? ";
	for (int i = 0; i < l; i++) {
		q += '1';
	}
	for (int i = l; i <= r; i++) {
		q += '0';
	}
	for (int i = r + 1; i < n; i++) {
		q += '1';
	}
	return q;
}

int main() {
	int num_of_zeros, pos0 = -1, pos1 = -1, num_of_ones;
	cin >> n;
	string query = "? ";
	for (int i = 0; i < n; i++) {
		query += '1';
	}
	cout << query << endl;
	cout.flush();
	cin >> num_of_zeros;
	int l = 0, r = n - 1;
	while (pos0 == -1 || pos1 == -1) {
		int m = (l + r) / 2;
		cout << tquery(l, m) << endl;
		cout.flush();
		cin >> num_of_ones;
		if (num_of_zeros - num_of_ones == m - l + 1) {
			pos0 = l;
			l = m + 1;
		}
		else if (num_of_zeros - num_of_ones == l - m - 1) {
			pos1 = l;
			l = m + 1;
		}
		else {
			r = m;
		}
	}
	cout << "! " << pos0+1 << " " << pos1+1;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;
int n;
string tquery(int l, int r) {
	string q = "? ";
	for (int i = 0; i < l; i++) {
		q += '1';
	}
	for (int i = l; i <= r; i++) {
		q += '0';
	}
	for (int i = r + 1; i < n; i++) {
		q += '1';
	}
	return q;
}

int main() {
	int num_of_zeros, pos0 = -1, pos1 = -1, num_of_ones;
	cin >> n;
	string query = "? ";
	for (int i = 0; i < n; i++) {
		query += '1';
	}
	cout << query;
	cout.flush();
	cin >> num_of_zeros;
	int l = 0, r = n - 1;
	while (pos0 == -1 || pos1 == -1) {
		int m = (l + r) / 2;
		cout << tquery(l, m);
		cout.flush();
		cin >> num_of_ones;
		if (num_of_zeros - num_of_ones == m - l + 1) {
			pos0 = l;
			l = m + 1;
		}
		else if (num_of_zeros - num_of_ones == l - m - 1) {
			pos1 = l;
			l = m + 1;
		}
		else {
			r = m;
		}
	}
	cout << "! " << pos0+1 << " " << pos1+1;
	return 0;
}


/*input
1
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ldd double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=1e6+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ldd PI=acos(-1);
const ldd eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return (a*b)%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
#define int ll
int n;
int cnt;
int query(int l,int r){
    string s="";
    REP(i,n) s+="1";
    for(;l<=r;l++) s[l]='0';
    cout<<s<<endl;
    int x;
    cin>>x;
    return x;
}
int pos0=-1,pos1=-1;
void rec(int l,int r){
    if(l==r){
        pos1=l;
        return;
    }
    int mid=(l+r)/2;
    if(query(l,mid)!=cnt){
        rec(l,mid);
    }
    else{
        rec(mid+1,r);
        pos0=l;
    }
}
int32_t main(){
    ios::sync_with_stdio(false),cin.tie(0);

    cin>>n;
    cnt=query(0,n-1);
    rec(0,n-1);
    cout<<pos1+1<<' '<<pos0+1<<endl;
}


/*input
1
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ldd double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=1e6+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ldd PI=acos(-1);
const ldd eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return (a*b)%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
#define int ll
int n;
int cnt;
int query(int l,int r){
    string s="";
    REP(i,n) s+="1";
    for(;l<=r;l++) s[l]='0';
    cout<<"? "<<s<<endl;
    int x;
    cin>>x;
    return x;
}
int pos0=-1,pos1=-1;
//has a 0 and 1
void rec(int l,int r){
    if(l>r){
        return;
    }
    int mid=(l+r)/2;
    // all 1s
    int x=query(l,mid);
    if(x==(n-cnt)+(mid-l+1)){
        //cout<<l<<' '<<mid<<"ALL 1s\n";
        rec(mid+1,r);
        pos1=l;
    }
    else if(x==(n-cnt-(mid-l+1))){
        //cout<<l<<' '<<mid<<"ALL 0s\n";
        rec(mid+1,r);
        pos0=l;
    }
    else{
        if(l!=mid) rec(l,mid);
    }
}
int32_t main(){
    ios::sync_with_stdio(false),cin.tie(0);

    cin>>n;
    cnt=query(0,n-1);
    rec(0,n-1);
    cout<<"! "<<pos0+1<<' '<<pos1+1<<endl;
}


/*input
1
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ldd double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=1e6+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ldd PI=acos(-1);
const ldd eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return (a*b)%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
#define int ll
int n;
int cnt;
int query(int l,int r){
    string s="";
    REP(i,n) s+="1";
    for(;l<=r;l++) s[l]='0';
    cout<<"? "<<s<<endl;
    int x;
    cin>>x;
    return x;
}
int pos0=-1,pos1=-1;
void rec(int l,int r){
    if(l==r){
        pos1=l;
        return;
    }
    int mid=(l+r)/2;
    if(query(l,mid)!=cnt){
        rec(l,mid);
    }
    else{
        rec(mid+1,r);
        pos0=l;
    }
}
int32_t main(){
    //ios::sync_with_stdio(false),cin.tie(0);

    cin>>n;
    cnt=query(0,n-1);
    rec(0,n-1);
    cout<<"! "<<pos1+1<<' '<<pos0+1<<endl;
}


/*input
1
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ldd double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=1e6+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ldd PI=acos(-1);
const ldd eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return (a*b)%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
#define int ll
int n;
int cnt;
int query(int l,int r){
    string s="";
    REP(i,n) s+="1";
    for(;l<=r;l++) s[l]='0';
    cout<<"? "<<s<<endl;
    int x;
    cin>>x;
    return x;
}
int pos0=-1,pos1=-1;
void rec(int l,int r){
    if(l==r){
        pos0=l;
        return;
    }
    int mid=(l+r)/2;
    if(query(l,mid)!=(n-cnt)+(mid-l+1)){
        rec(l,mid);
    }
    else{
        rec(mid+1,r);
        pos1=l;
    }
}
int32_t main(){
    ios::sync_with_stdio(false),cin.tie(0);

    cin>>n;
    cnt=query(0,n-1);
    rec(0,n-1);
    cout<<"! "<<pos0+1<<' '<<pos1+1<<endl;
}


#include <bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a, b)      (a * (b / __gcd(a,b)))
#define inf           (long long )(1e18+1)
//#define endl          '\n'
#define mp            make_pair
#define time(s)       (double(clock()-s)/double(CLOCKS_PER_SEC))
#define debug(args...)    _F(#args, args)
#define vi            std::vector<int>
#define pii           pair<int, int>
#define vpi           vector<pii>

clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

template<typename T> void _F(const char *name, T arg1){
    cerr << name << " = " << arg1 << endl;
}
template<typename T, typename... Args> void _F(const char *names, T arg1, Args... args){
    const char *name = strchr(names, ',');cerr.write(names, name-names) << " = " << arg1 << endl;_F(name+2, args...);
}
template<typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2> &q){
    in >> q.F >> q.S; return in;
}
template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> &q){
    out << q.F << " " << q.S; return out;
}
template< typename T1, typename T2> pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F+p2.F, p1.S+p2.S};
}
template< typename T1, typename T2> pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F-p2.F, p1.S-p2.S};
}

void solve() {
    int n;
    cin >> n;
    string s;
    for(int i = 0; i < n; i++)
        s.pb('0');
    cout << s << endl;
    int st;
    cin >> st;
    s[0] = '1';
    cout << s << endl;
    int tmp;
    cin >> tmp;
    int pos[2], f;
    if(st > tmp){
        pos[1] = 1;
        s[0] = '1';
        f = 1;
    } else{
        pos[0] = 1;
        s[1] = '0';
        f = 0;
    }
    for(int i = 1; i < n; i++)
        s[i] = (s[i-1] == '0' ? '0' : '1');
    cout << s << endl;
    cin >> st;
    int ss = 1, ee = n-1;
    while(ss <= ee){
        int mid = (ss+ee)>>1;
        for(int i = 1; i <= n-1; i++){
            if(ee >= i && i >= mid)
            s[i] = (s[0] == '0' ? '1' : '0');
            else s[i] = (s[0] == '0' ? '0' : '1');
        }
        cout << s << endl;
        int tmp;
        cin >> tmp;
        if(tmp-st == ee-mid+1){
            ee = mid-1;
        }else {
            pos[!f] = mid;
            ss = mid+1;
        }
    }
    //pos[!f] = s+1;
    cout << "! " << pos[0] << " " << pos[1] << endl;

}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    start = clock();

    cout << fixed << setprecision(20);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // freopen("error.txt", "w", stderr);
    // #endif

    //cin >> t;

    for(int i = 1; i <= t; ++i){
        //cout << "Case #" << i << ": ";
        solve();
        //cout << endl;
    }
    //cerr << time(start);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a, b)      (a * (b / __gcd(a,b)))
#define inf           (long long )(1e18+1)
//#define endl          '\n'
#define mp            make_pair
#define time(s)       (double(clock()-s)/double(CLOCKS_PER_SEC))
#define debug(args...)    _F(#args, args)
#define vi            std::vector<int>
#define pii           pair<int, int>
#define vpi           vector<pii>

clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

template<typename T> void _F(const char *name, T arg1){
    cerr << name << " = " << arg1 << endl;
}
template<typename T, typename... Args> void _F(const char *names, T arg1, Args... args){
    const char *name = strchr(names, ',');cerr.write(names, name-names) << " = " << arg1 << endl;_F(name+2, args...);
}
template<typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2> &q){
    in >> q.F >> q.S; return in;
}
template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> &q){
    out << q.F << " " << q.S; return out;
}
template< typename T1, typename T2> pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F+p2.F, p1.S+p2.S};
}
template< typename T1, typename T2> pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F-p2.F, p1.S-p2.S};
}

void solve() {
    int n;
    cin >> n;
    string s;
    for(int i = 0; i < n; i++)
        s.pb('0');
    cout << "? ";
    cout << s << endl;
    int st;
    cin >> st;
    s[0] = '1';
    cout << "? ";
    cout << s << endl;
    int tmp;
    cin >> tmp;
    int pos[2], f;
    if(st > tmp){
        pos[1] = 1;
        s[0] = '1';
        f = 1;
    } else{
        pos[0] = 1;
        s[0] = '0';
        f = 0;
    }
    //cout << f << " f " << endl;
    for(int i = 1; i < n; i++)
        s[i] = (s[i-1] == '0' ? '0' : '1');
    cout << "? ";
    cout << s << endl;
    cin >> st;
    int ss = 1, ee = n-1;
    while(ss <= ee){
        int mid = (ss+ee)>>1;
        for(int i = 1; i <= n-1; i++){
            if(ee >= i && i >= mid)
            s[i] = (s[0] == '0' ? '1' : '0');
            else s[i] = (s[0] == '0' ? '0' : '1');
        }
        cout << "? ";
        cout << s << endl;
        int tmp;
        cin >> tmp;
        if(tmp-st == ee-mid+1){
            ee = mid-1;
        }else {
            pos[!f] = mid+1;
            ss = mid+1;
        }
    }
    //pos[!f] = s+1;
    cout << "! " << pos[0] << " " << pos[1] << endl;

}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    start = clock();

    cout << fixed << setprecision(20);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // freopen("error.txt", "w", stderr);
    // #endif

    //cin >> t;

    for(int i = 1; i <= t; ++i){
        //cout << "Case #" << i << ": ";
        solve();
        //cout << endl;
    }
    //cerr << time(start);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a, b)      (a * (b / __gcd(a,b)))
#define inf           (long long )(1e18+1)
//#define endl          '\n'
#define mp            make_pair
#define time(s)       (double(clock()-s)/double(CLOCKS_PER_SEC))
#define debug(args...)    _F(#args, args)
#define vi            std::vector<int>
#define pii           pair<int, int>
#define vpi           vector<pii>

clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

template<typename T> void _F(const char *name, T arg1){
    cerr << name << " = " << arg1 << endl;
}
template<typename T, typename... Args> void _F(const char *names, T arg1, Args... args){
    const char *name = strchr(names, ',');cerr.write(names, name-names) << " = " << arg1 << endl;_F(name+2, args...);
}
template<typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2> &q){
    in >> q.F >> q.S; return in;
}
template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> &q){
    out << q.F << " " << q.S; return out;
}
template< typename T1, typename T2> pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F+p2.F, p1.S+p2.S};
}
template< typename T1, typename T2> pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F-p2.F, p1.S-p2.S};
}

void solve() {
    int n;
    cin >> n;
    string s;
    for(int i = 0; i < n; i++)
        s.pb('0');
    cout << "? ";
    cout << s << endl;
    int st;
    cin >> st;
    s[0] = '1';
    cout << "? ";
    cout << s << endl;
    int tmp;
    cin >> tmp;
    int pos[2], f;
    if(st > tmp){
        pos[1] = 1;
        s[0] = '1';
        f = 1;
    } else{
        pos[0] = 1;
        s[1] = '0';
        f = 0;
    }
    for(int i = 1; i < n; i++)
        s[i] = (s[i-1] == '0' ? '0' : '1');
    cout << "? ";
    cout << s << endl;
    cin >> st;
    int ss = 1, ee = n-1;
    while(ss <= ee){
        int mid = (ss+ee)>>1;
        for(int i = 1; i <= n-1; i++){
            if(ee >= i && i >= mid)
            s[i] = (s[0] == '0' ? '1' : '0');
            else s[i] = (s[0] == '0' ? '0' : '1');
        }
        cout << "? ";
        cout << s << endl;
        int tmp;
        cin >> tmp;
        if(tmp-st == ee-mid+1){
            ee = mid-1;
        }else {
            pos[!f] = mid;
            ss = mid+1;
        }
    }
    //pos[!f] = s+1;
    cout << "! " << pos[0] << " " << pos[1] << endl;

}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    start = clock();

    cout << fixed << setprecision(20);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // freopen("error.txt", "w", stderr);
    // #endif

    //cin >> t;

    for(int i = 1; i <= t; ++i){
        //cout << "Case #" << i << ": ";
        solve();
        //cout << endl;
    }
    //cerr << time(start);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a, b)      (a * (b / __gcd(a,b)))
#define inf           (long long )(1e18+1)
//#define endl          '\n'
#define mp            make_pair
#define time(s)       (double(clock()-s)/double(CLOCKS_PER_SEC))
#define debug(args...)    _F(#args, args)
#define vi            std::vector<int>
#define pii           pair<int, int>
#define vpi           vector<pii>

clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

template<typename T> void _F(const char *name, T arg1){
    cerr << name << " = " << arg1 << endl;
}
template<typename T, typename... Args> void _F(const char *names, T arg1, Args... args){
    const char *name = strchr(names, ',');cerr.write(names, name-names) << " = " << arg1 << endl;_F(name+2, args...);
}
template<typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2> &q){
    in >> q.F >> q.S; return in;
}
template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> &q){
    out << q.F << " " << q.S; return out;
}
template< typename T1, typename T2> pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F+p2.F, p1.S+p2.S};
}
template< typename T1, typename T2> pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F-p2.F, p1.S-p2.S};
}

void solve() {
    int n;
    cin >> n;
    string s;
    for(int i = 0; i < n; i++)
        s.pb('0');
    cout << s << endl;
    int st;
    cin >> st;
    s[0] = '1';
    cout << s << endl;
    int tmp;
    cin >> tmp;
    int pos[2], f;
    if(st > tmp){
        pos[1] = 1;
        s[0] = '1';
        f = 1;
    } else{
        pos[0] = 1;
        s[1] = '0';
        f = 0;
    }
    for(int i = 1; i < n; i++)
        s[i] = (s[i-1] == '0' ? '0' : '1');
    cout << s << endl;
    cin >> st;
    int ss = 1, ee = n-1;
    while(ss <= ee){
        int mid = (ss+ee)>>1;
        for(int i = 1; i <= n-1; i++){
            if(ee >= i && i >= mid)
            s[i] = (s[0] == '0' ? '1' : '0');
            else s[i] = (s[0] == '0' ? '0' : '1');
        }
        cout << s << endl;
        int tmp;
        cin >> tmp;
        if(tmp-st == ee-mid+1){
            ee = mid-1;
        }else {
            pos[!f] = mid;
            ss = mid+1;
        }
    }
    pos[!f] = s+1;
    cout << "! " << pos[0] << " " << pos[1] << endl;

}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    start = clock();

    cout << fixed << setprecision(20);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // freopen("error.txt", "w", stderr);
    // #endif

    //cin >> t;

    for(int i = 1; i <= t; ++i){
        //cout << "Case #" << i << ": ";
        solve();
        //cout << endl;
    }
    //cerr << time(start);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend()
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a, b)      (a * (b / __gcd(a,b)))
#define inf           (long long )(1e18+1)
//#define endl          '\n'
#define mp            make_pair
#define time(s)       (double(clock()-s)/double(CLOCKS_PER_SEC))
#define debug(args...)    _F(#args, args)
#define vi            std::vector<int>
#define pii           pair<int, int>
#define vpi           vector<pii>

clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

template<typename T> void _F(const char *name, T arg1){
    cerr << name << " = " << arg1 << endl;
}
template<typename T, typename... Args> void _F(const char *names, T arg1, Args... args){
    const char *name = strchr(names, ',');cerr.write(names, name-names) << " = " << arg1 << endl;_F(name+2, args...);
}
template<typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2> &q){
    in >> q.F >> q.S; return in;
}
template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> &q){
    out << q.F << " " << q.S; return out;
}
template< typename T1, typename T2> pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F+p2.F, p1.S+p2.S};
}
template< typename T1, typename T2> pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F-p2.F, p1.S-p2.S};
}

void solve() {
    int n;
    cin >> n;
    string s;
    for(int i = 0; i < n; i++)
        s.pb('0');
    cout << "? ";
    cout << s << endl;
    int st;
    cin >> st;
    s[0] = '1';
    cout << "? ";
    cout << s << endl;
    int tmp;
    cin >> tmp;
    int pos[2], f;
    if(st > tmp){
        pos[1] = 1;
        s[0] = '1';
        f = 1;
    } else{
        pos[0] = 1;
        s[1] = '0';
        f = 0;
    }
    for(int i = 1; i < n; i++)
        s[i] = (s[i-1] == '0' ? '0' : '1');
    cout << "? ";
    cout << s << endl;
    cin >> st;
    int ss = 1, ee = n-1;
    while(ss <= ee){
        int mid = (ss+ee)>>1;
        for(int i = 1; i <= n-1; i++){
            if(ee >= i && i >= mid)
            s[i] = (s[0] == '0' ? '1' : '0');
            else s[i] = (s[0] == '0' ? '0' : '1');
        }
        cout << "? ";
        cout << s << endl;
        int tmp;
        cin >> tmp;
        if(tmp-st == ee-mid+1){
            ee = mid-1;
        }else {
            pos[!f] = mid+1;
            ss = mid+1;
        }
    }
    //pos[!f] = s+1;
    cout << "! " << pos[0] << " " << pos[1] << endl;

}

signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int t = 1;
    start = clock();

    cout << fixed << setprecision(20);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // freopen("error.txt", "w", stderr);
    // #endif

    //cin >> t;

    for(int i = 1; i <= t; ++i){
        //cout << "Case #" << i << ": ";
        solve();
        //cout << endl;
    }
    //cerr << time(start);
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
#define int long long int
using namespace std;
int tot = 0;
int n;
void query(int l, int r, int f)
{
	string s;
	for (int j=1; j<l; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	for (int j=l; j<=r; j++)
	{
		if (f)
		{
			s+='1';
		}
		else
		{
			s+='0';
		}
	}
	for (int j=r+1; j<=n; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	assert(tot < 15);
	cout<<"? "<<s<<"\n";
	tot++;
	cout<<flush;

}
int solve()
{
	cin>>n;
	//first determine the first pos
	string s1, s2;
	s1+='1';
	s2+='0';
	for (int j=1; j<n; j++)
	{
		s1+='0';
		s2+='0';
	}
	int f;
	int d1, d2;
	cout<<"? "<<s1<<"\n";
	cout<<flush;
	tot++;
	cin>>d1;
	cout<<"? "<<s2<<"\n";
	cout<<flush;
	tot++;
	cin>>d2;
	//f->to find
	if (d1<d2)
	{
		f=0;
	}
	else
	{
		f=1;
	}
	int l=1, r=n;
	string q;
	for (int j=1; j<=n; j++)
	{
		if (f)
		{
			q+='0';
		}
		else
		{
			q+='1';
		}
	}
	cout<<"? "<<q<<"\n";
	cout<<flush;
	tot++;
	int r1; cin>>r1;
	while (r-l+1>2)
	{
		int len=r-l+1;
		int x=(l+r)/2;
		query(x, r, f);
		int d; cin>>d;
		if (((r1-d)+len)/2)
		{
			l=x;
		}
		else
		{
			r=x;
		}
	}
	if (r-l+1==2)
	{
		query(l, l, f);
		int d; cin>>d;
		if (((r1-d)+2)/2)
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<l<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<l<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
		else
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<r<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<r<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
	}
	if (r-l+1==1)
	{
		if (f)
		{
			cout<<"! "<<1<<" "<<l<<"\n";
			cout<<flush;
			return 0;
		}
		else
		{
			cout<<"! "<<l<<" "<<1<<"\n";
			cout<<flush;
			return 0;
		}
	}
	return 0;
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
#define int long long int
using namespace std;
int n;
void query(int l, int r, int f)
{
	string s;
	for (int j=1; j<l; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	for (int j=l; j<=r; j++)
	{
		if (f)
		{
			s+='1';
		}
		else
		{
			s+='0';
		}
	}
	for (int j=r+1; j<=n; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	cout<<"? "<<s<<"\n";
	cout<<flush;
}
int solve()
{
	cin>>n;
	//first determine the first pos
	string s1, s2;
	s1+='1';
	s2+='0';
	for (int j=1; j<n; j++)
	{
		s1+='0';
		s2+='0';
	}
	int f;
	int d1, d2;
	cout<<"? "<<s1<<"\n";
	cout<<flush;
	cin>>d1;
	cout<<"? "<<s2<<"\n";
	cout<<flush;
	cin>>d2;
	//f->to find
	if (d1<d2)
	{
		f=0;
	}
	else
	{
		f=1;
	}
	int l=1, r=n;
	string q;
	for (int j=1; j<=n; j++)
	{
		if (f)
		{
			q+='0';
		}
		else
		{
			q+='1';
		}
	}
	cout<<"? "<<q<<"\n";
	cout<<flush;
	int r1; cin>>r1;
	while (r-l+1>2)
	{
		int len=r-l+1;
		int x=(l+r)/2;
		query(x, r, f);
		int d; cin>>d;
		if (((r1-d)+len)/2)
		{
			l=x;
		}
		else
		{
			r=x;
		}
	}
	if (r-l+1==2)
	{
		query(l, l, f);
		int d; cin>>d;
		if (((r1-d)+2)/2)
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<l<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<l<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
		else
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<r<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<r<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
	}
	if (r-l+1==1)
	{
		if (f)
		{
			cout<<"! "<<1<<" "<<l<<"\n";
			cout<<flush;
			return 0;
		}
		else
		{
			cout<<"! "<<l<<" "<<1<<"\n";
			cout<<flush;
			return 0;
		}
	}
	return 0;
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
#define int long long int
using namespace std;
int tot = 0;
int n;
void query(int l, int r, int f)
{
	string s;
	for (int j=1; j<l; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	for (int j=l; j<=r; j++)
	{
		if (f)
		{
			s+='1';
		}
		else
		{
			s+='0';
		}
	}
	for (int j=r+1; j<=n; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	cout<<"? "<<s<<"\n";
	tot++;
	assert(tot < 16);
	cout<<flush;

}
int solve()
{
	cin>>n;
	//first determine the first pos
	string s1, s2;
	s1+='1';
	s2+='0';
	for (int j=1; j<n; j++)
	{
		s1+='0';
		s2+='0';
	}
	int f;
	int d1, d2;
	cout<<"? "<<s1<<"\n";
	cout<<flush;
	tot++;
	cin>>d1;
	cout<<"? "<<s2<<"\n";
	cout<<flush;
	tot++;
	cin>>d2;
	//f->to find
	if (d1<d2)
	{
		f=0;
	}
	else
	{
		f=1;
	}
	int l=1, r=n;
	string q;
	for (int j=1; j<=n; j++)
	{
		if (f)
		{
			q+='0';
		}
		else
		{
			q+='1';
		}
	}
	cout<<"? "<<q<<"\n";
	cout<<flush;
	tot++;
	int r1; cin>>r1;
	while (r-l+1>2)
	{
		int len=r-l+1;
		int x=(l+r)/2;
		query(x, r, f);
		int d; cin>>d;
		if (((r1-d)+len)/2)
		{
			l=x;
		}
		else
		{
			r=x;
		}
	}
	if (r-l+1==2)
	{
		query(l, l, f);
		int d; cin>>d;

		if (((r1-d)+2)/2)
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<l<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<l<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
		else
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<r<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<r<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
	}
	if (r-l+1==1)
	{
		if (f)
		{
			cout<<"! "<<1<<" "<<l<<"\n";
			cout<<flush;
			return 0;
		}
		else
		{
			cout<<"! "<<l<<" "<<1<<"\n";
			cout<<flush;
			return 0;
		}
	}
	return 0;
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
#define int long long int
using namespace std;
int tot = 0;
int n;
void query(int l, int r, int f)
{
	string s;
	for (int j=1; j<l; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	for (int j=l; j<=r; j++)
	{
		if (f)
		{
			s+='1';
		}
		else
		{
			s+='0';
		}
	}
	for (int j=r+1; j<=n; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	assert(tot < 15);
	cout<<"? "<<s<<"\n";
	tot++;
	cout<<flush;
}
int solve()
{
	cin>>n;
	//first determine the first pos
	string s1, s2;
	s1+='1';
	s2+='0';
	for (int j=1; j<n; j++)
	{
		s1+='0';
		s2+='0';
	}
	int f;
	int d1, d2;
	cout<<"? "<<s1<<"\n";
	cout<<flush;
	tot++;
	cin>>d1;
	cout<<"? "<<s2<<"\n";
	cout<<flush;
	tot++;
	cin>>d2;
	//f->to find
	if (d1<d2)
	{
		f=0;
	}
	else
	{
		f=1;
	}
	int l=1, r=n;
	string q;
	for (int j=1; j<=n; j++)
	{
		if (f)
		{
			q+='0';
		}
		else
		{
			q+='1';
		}
	}
	cout<<"? "<<q<<"\n";
	cout<<flush;
	tot++;
	int r1; cin>>r1;
	while (r-l+1>2)
	{
		int x=(l+r)/2;
		query(x, r, f);
		int d; cin>>d;
		int len = r - x + 1;
		if (((r1-d)+len)/2)
		{
			l=x;
		}
		else
		{
			r=x;
		}
	}
	if (r-l+1==2)
	{
		query(l, l, f);
		int d; cin>>d;
		if (((r1-d)+2)/2)
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<l<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<l<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
		else
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<r<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<r<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
	}
	if (r-l+1==1)
	{
		if (f)
		{
			cout<<"! "<<1<<" "<<l<<"\n";
			cout<<flush;
			return 0;
		}
		else
		{
			cout<<"! "<<l<<" "<<1<<"\n";
			cout<<flush;
			return 0;
		}
	}
	return 0;
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <assert.h>
#include <stack>
#include <string>
#define int long long int
using namespace std;
int tot = 0;
int n;
void query(int l, int r, int f)
{
	string s;
	for (int j=1; j<l; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	for (int j=l; j<=r; j++)
	{
		if (f)
		{
			s+='1';
		}
		else
		{
			s+='0';
		}
	}
	for (int j=r+1; j<=n; j++)
	{
		if (f)
		{
			s+='0';
		}
		else
		{
			s+='1';
		}
	}
	assert(tot < 15);
	cout<<"? "<<s<<"\n";
	tot++;
	cout<<flush;

}
int solve()
{
	cin>>n;
	//first determine the first pos
	string s1, s2;
	s1+='1';
	s2+='0';
	for (int j=1; j<n; j++)
	{
		s1+='0';
		s2+='0';
	}
	int f;
	int d1, d2;
	cout<<"? "<<s1<<"\n";
	cout<<flush;
	tot++;
	cin>>d1;
	cout<<"? "<<s2<<"\n";
	cout<<flush;
	tot++;
	cin>>d2;
	//f->to find
	if (d1<d2)
	{
		f=0;
	}
	else
	{
		f=1;
	}
	int l=1, r=n;
	string q;
	for (int j=1; j<=n; j++)
	{
		if (f)
		{
			q+='0';
		}
		else
		{
			q+='1';
		}
	}
	cout<<"? "<<q<<"\n";
	cout<<flush;
	tot++;
	int r1; cin>>r1;
	while (r-l+1>2)
	{
		int len=r-l+1;
		int x=(l+r)/2;
		query(x, r, f);
		int d; cin>>d;
		if (((r1-d)+len)/2)
		{
			l=x;
		}
		else
		{
			r=x;
		}
	}
	if (r-l+1==2)
	{
		query(l, l, f);
		int d; cin>>d;
		if (((r1-d)+2)/2)
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<l<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<l<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
		else
		{
			if (f)
			{
				cout<<"! "<<1<<" "<<r<<"\n";
				cout<<flush;
				return 0;
			}
			else
			{
				cout<<"! "<<r<<" "<<1<<"\n";
				cout<<flush;
				return 0;
			}
		}
	}
	if (r-l+1==1)
	{
		if (f)
		{
			cout<<"! "<<1<<" "<<l<<"\n";
			cout<<flush;
			return 0;
		}
		else
		{
			cout<<"! "<<l<<" "<<1<<"\n";
			cout<<flush;
			return 0;
		}
	}
	return 0;
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int t;
	//cin >> t;
	t=1;
	while (t--)
	{
		solve();
	}
	return 0;
}
//


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! %d 0", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! 0 %d", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
void func1(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! %d 0", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! 0 %d", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    int n;
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp, int x1)
{
    if(r == l)
    {
        printf("! %d 1", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                printf("%d", x1);
            else
                printf("%d", 1 - x1);
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = x1;
        func1((r+l)/2.0 + 1, r, ans, temp, x1);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = x1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2, x1);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0, 1);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
void func1(int l, int r, int ans, int temp);
{
    if(r == l)
    {
        printf("! %d 0", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp);
{
    if(r == l)
    {
        printf("! 0 %d", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    int n;
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! %d 0", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! 0 %d", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! %d 1", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! 1 %d", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp, int x1)
{
    if(r == l)
    {
        printf("! %d 1", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                printf("%d", x1);
            else
                printf("%d", 1 - x1);
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = x1;
        func1((r+l)/2.0 + 1, r, ans, temp, x1);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = x1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2, x1);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0, 1);
    }
    else
    {
        fix[0] = 0;
        func1(1, n - 1, ans, 0, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! %d 0", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! 0 %d", l);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d ", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! %d 1", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('1');
            else
                putchar('0');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 1;
        func1((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
void func2(int l, int r, int ans, int temp)
{
    if(r == l)
    {
        printf("! 1 %d", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                putchar('0');
            else
                putchar('1');
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = 0;
        func2((r+l)/2.0 + 1, r, ans, temp);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = 0;
        func2(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int> fix;
int n;
void func1(int l, int r, int ans, int temp, int x1)
{
    if(r == l)
    {
        printf("! %d 1", l+1);
        return;
    }
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        if(i < l || i > r)
            printf("%d", fix[i]);
        else
        {
            if(l <= i && i <= (r+l)/2)
                printf("%d", x1);
            else
                printf("%d", 1-x1);
        }
    }
    putchar('\n');
    fflush(stdout);
    int x;
    scanf("%d", &x);
    x -= temp;
    if(x + ans - ceil((r-l)/2.0) == 0)
    {
        for(int i = l;i <= (r+l)/2;i++)
            fix[i] = x1;
        func1((r+l)/2.0 + 1, r, ans, temp, x1);
    }
    else
    {
        for(int i = (r+l)/2;i <= r;i++)
            fix[i] = x1;
        func1(l, (r+l)/2, (x + ans - ceil((r-l)/2.0))/2, temp + ans - (x + ans - ceil((r-l)/2.0))/2, x1);
    }
    return;
}
int main()
{
    scanf("%d", &n);
    fix.resize(n);
    printf("? ");
    for(int i = 0;i < n;i++)
    {
        putchar('0');
        fix[i] = (-1);
    }
    putchar('\n');
    fflush(stdout);
    int ans, x;
    scanf("%d", &ans);
    printf("? ");
    putchar('1');
    for(int i = 1;i < n;i++)
        putchar('0');
    putchar('\n');
    fflush(stdout);
    scanf("%d", &x);
    if(x == ans - 1)
    {
        fix[0] = 1;
        ans--;
        func1(1, n - 1, n - 1 - ans, 0, 1);
    }
    else
    {
        fix[0] = 0;
        func2(1, n - 1, ans, 0, 0);
    }
    //0011001100
    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;

#define     LL                      long long int
#define     LD                      long double
#define     ULL                     unsigned long long int

#define     pii                     pair<int, int>
#define     ump                     unordered_map
#define     mp                      make_pair
#define     mt                      make_tuple
#define     pb                      push_back
#define     ff                      first
#define     ss                      second
#define     SZ(x)                   (int)x.size()
#define     all(x)                  x.begin(), x.end()
#define     lb(x, y)                lower_bound(all(x), y)
#define     fill2d(arr, a, b, v)    fill(&arr[0][0], &arr[0][0] + sizeof(arr), v)
#define     fill3d(arr, a, b, c, v) fill(&arr[0][0][0], &arr[0][0][0] + a * b * c, v)
#define     rep(i, begin, end)      for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define     sp(x)                   setprecision(x) << fixed
#define     what_is(x)              cout << #x << " is " << x << endl
//#define     I64                     ll

#define     PI                      acos(-1.0)
#define     EPS                     1e-12
#define     mx                      200010
#define     S_SIZE                  2000010

const LL inf = 1000000000;
const LL mod = 1000000000 + 7;

inline void IO() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
inline int dcmp (LD x) { return x < -EPS ? -1 : (x > EPS); }

template<class T> inline int CHECK(T MASK, int i) { return (MASK >> i) & 1; }
template<class T> inline T ON(T MASK, int i) { return MASK | (T(1) << i); }
template<class T> inline T OFF(T MASK, int i) { return MASK & (~(T(1) << i)); }
template<typename T> inline int CNT(T MASK) {
    if (numeric_limits<T>::digits <= numeric_limits<unsigned int>::digits) return __builtin_popcount(MASK);
    else return __builtin_popcountll(MASK);
}
template<class T> inline int RIGHT(T MASK) { return log2(MASK & -MASK); }

int dx4[] = { 0, 0, -1, +1 }; int dy4[] = { +1, -1, 0, 0 };
int dx8[] = { 1, 1, 0, -1, -1, -1, 0, 1, 0 }; int dy8[] = { 0, 1, 1, 1, 0, -1, -1, -1, 0 };

inline void I(int& a) { scanf("%d", &a); } inline void I(LL& a) { scanf("%I64d", &a); }
inline void I(ULL& a) { scanf("%I64u", &a); } inline void I(char* a) { scanf("%s", a); }
char Iarr[S_SIZE]; inline void I(string& a) { scanf("%s", Iarr); a = Iarr; }
template<typename T, typename... Args>
void I(T& a, Args&... args) { I(a); I(args...); }

inline void OUT(int a) { printf("%d", a); } inline void OUT(LL a) { printf("%I64d", a); }
inline void OUT(const char* a) { printf("%s", a); } inline void OUT(char* a) { printf("%s", a); }
inline void OUT(bool a) { printf("%d", a); } inline void OUT(string a) { rep(it, a.begin(), a.end()) printf("%c", *it); }
inline void OUT(ULL a) { printf("%I64u", a); }
template<typename T, typename... Args>
void OUT(T a, Args... args) { OUT(a); OUT(" "); OUT(args...); }
template<typename... Args>
void O(Args... args) { OUT(args...); OUT("\n"); }

template<typename T1, typename T2>
inline ostream& operator<<(ostream& os, pair<T1, T2> p) { os << "{" << p.first << ", " << p.second << "}"; return os; }
template<typename T>
inline ostream& operator<<(ostream& os, vector<T>& a) { os << "["; for (int i = 0; i < (int)a.size(); i++) { if (i) os << ", "; os << a[i]; } os << "]"; return os; }

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cout << *it << " = " << a << endl;
	err(++it, args...);
}

// mp.reserve(1024); mp.max_load_factor(0.25);
// head

const int M = 100010; // maximum number of cubes
//const LL modd = 998244353;

int main()
{
    int n;
    cin >> n;
    string s;
    while (n--) {
        s.pb('0');
    }
    int cnt;
    cout << "? " << s << endl;
    cin >> cnt;

    int low = 0, high = SZ(s) - 1;
    while (low < high - 1) {
        string ss;
        ss.resize(SZ(s));
        for (int i = 0; i < SZ(s); i++) {
            if (i >= low && i <= high) {
                ss[i] = '1';
            }
            else {
                ss[i] = '0';
            }
        }
        cout << "? " << ss << endl;
        int ret;
        cin >> ret;
        int diff = abs(cnt - ret);
        int one = (high - low + 1 - diff) / 2;
        int two = one + diff;
        high = low + max(one, two);
    }
    for (int i = 0; i < SZ(s); i++) {
        if (i == low) s[i] = '1';
        else s[i] = '0';
    }
    cout << "? " << s << endl;
    int nCnt;
    cin >> nCnt;
    if (nCnt < cnt) {
        cout << "! " << high + 1 << " " << low + 1 << endl;
    }
    else {
        cout << "! " << low + 1 << " " << high + 1 << endl;
    }

    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;

#define     LL                      long long int
#define     LD                      long double
#define     ULL                     unsigned long long int

#define     pii                     pair<int, int>
#define     ump                     unordered_map
#define     mp                      make_pair
#define     mt                      make_tuple
#define     pb                      push_back
#define     ff                      first
#define     ss                      second
#define     SZ(x)                   (int)x.size()
#define     all(x)                  x.begin(), x.end()
#define     lb(x, y)                lower_bound(all(x), y)
#define     fill2d(arr, a, b, v)    fill(&arr[0][0], &arr[0][0] + sizeof(arr), v)
#define     fill3d(arr, a, b, c, v) fill(&arr[0][0][0], &arr[0][0][0] + a * b * c, v)
#define     rep(i, begin, end)      for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define     sp(x)                   setprecision(x) << fixed
#define     what_is(x)              cout << #x << " is " << x << endl
//#define     I64                     ll

#define     PI                      acos(-1.0)
#define     EPS                     1e-12
#define     mx                      200010
#define     S_SIZE                  2000010

const LL inf = 1000000000;
const LL mod = 1000000000 + 7;

inline void IO() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
inline int dcmp (LD x) { return x < -EPS ? -1 : (x > EPS); }

template<class T> inline int CHECK(T MASK, int i) { return (MASK >> i) & 1; }
template<class T> inline T ON(T MASK, int i) { return MASK | (T(1) << i); }
template<class T> inline T OFF(T MASK, int i) { return MASK & (~(T(1) << i)); }
template<typename T> inline int CNT(T MASK) {
    if (numeric_limits<T>::digits <= numeric_limits<unsigned int>::digits) return __builtin_popcount(MASK);
    else return __builtin_popcountll(MASK);
}
template<class T> inline int RIGHT(T MASK) { return log2(MASK & -MASK); }

int dx4[] = { 0, 0, -1, +1 }; int dy4[] = { +1, -1, 0, 0 };
int dx8[] = { 1, 1, 0, -1, -1, -1, 0, 1, 0 }; int dy8[] = { 0, 1, 1, 1, 0, -1, -1, -1, 0 };

inline void I(int& a) { scanf("%d", &a); } inline void I(LL& a) { scanf("%I64d", &a); }
inline void I(ULL& a) { scanf("%I64u", &a); } inline void I(char* a) { scanf("%s", a); }
char Iarr[S_SIZE]; inline void I(string& a) { scanf("%s", Iarr); a = Iarr; }
template<typename T, typename... Args>
void I(T& a, Args&... args) { I(a); I(args...); }

inline void OUT(int a) { printf("%d", a); } inline void OUT(LL a) { printf("%I64d", a); }
inline void OUT(const char* a) { printf("%s", a); } inline void OUT(char* a) { printf("%s", a); }
inline void OUT(bool a) { printf("%d", a); } inline void OUT(string a) { rep(it, a.begin(), a.end()) printf("%c", *it); }
inline void OUT(ULL a) { printf("%I64u", a); }
template<typename T, typename... Args>
void OUT(T a, Args... args) { OUT(a); OUT(" "); OUT(args...); }
template<typename... Args>
void O(Args... args) { OUT(args...); OUT("\n"); }

template<typename T1, typename T2>
inline ostream& operator<<(ostream& os, pair<T1, T2> p) { os << "{" << p.first << ", " << p.second << "}"; return os; }
template<typename T>
inline ostream& operator<<(ostream& os, vector<T>& a) { os << "["; for (int i = 0; i < (int)a.size(); i++) { if (i) os << ", "; os << a[i]; } os << "]"; return os; }

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cout << *it << " = " << a << endl;
	err(++it, args...);
}

// mp.reserve(1024); mp.max_load_factor(0.25);
// head

const int M = 100010; // maximum number of cubes
//const LL modd = 998244353;

int main()
{
    int n;
    cin >> n;
    string s;
    while (n--) {
        s.pb('0');
    }
    int cnt;
    cout << "? " << s << endl;
    cin >> cnt;

    int low = 0, high = SZ(s) - 1;
    while (low < high) {
        int mid = (low + high + 1) / 2;
        string ss;
        ss.resize(SZ(s));
        for (int i = 0; i < SZ(s); i++) {
            if (i <= mid) {
                ss[i] = '1';
            }
            else {
                ss[i] = '0';
            }
        }
        cout << "? " << ss << endl;
        int ret;
        cin >> ret;
        int diff = abs(cnt - ret);
        int one = (mid + 1 - diff) / 2;
        int two = one + diff;
//        cout << low << " " << high << " " << mid << " " << diff << endl;
        if (min(one, two) == 0) {
            low = mid;
        }
        else {
            high = mid - 1;
        }
    }
//    cout << low << " x " << high << endl;
    for (int i = 0; i < SZ(s); i++) {
        if (i == 0) s[i] = '1';
    }
    cout << "? " << s << endl;
    int nCnt;
    cin >> nCnt;
    if (nCnt < cnt) {
        cout << "! " << high + 2 << " " << 1 << endl;
    }
    else {
        cout << "! " << 1 << " " << high + 2 << endl;
    }

    return 0;
}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;

#define     LL                      long long int
#define     LD                      long double
#define     ULL                     unsigned long long int

#define     pii                     pair<int, int>
#define     ump                     unordered_map
#define     mp                      make_pair
#define     mt                      make_tuple
#define     pb                      push_back
#define     ff                      first
#define     ss                      second
#define     SZ(x)                   (int)x.size()
#define     all(x)                  x.begin(), x.end()
#define     lb(x, y)                lower_bound(all(x), y)
#define     fill2d(arr, a, b, v)    fill(&arr[0][0], &arr[0][0] + sizeof(arr), v)
#define     fill3d(arr, a, b, c, v) fill(&arr[0][0][0], &arr[0][0][0] + a * b * c, v)
#define     rep(i, begin, end)      for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define     sp(x)                   setprecision(x) << fixed
#define     what_is(x)              cout << #x << " is " << x << endl
//#define     I64                     ll

#define     PI                      acos(-1.0)
#define     EPS                     1e-12
#define     mx                      200010
#define     S_SIZE                  2000010

const LL inf = 1000000000;
const LL mod = 1000000000 + 7;

inline void IO() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
inline int dcmp (LD x) { return x < -EPS ? -1 : (x > EPS); }

template<class T> inline int CHECK(T MASK, int i) { return (MASK >> i) & 1; }
template<class T> inline T ON(T MASK, int i) { return MASK | (T(1) << i); }
template<class T> inline T OFF(T MASK, int i) { return MASK & (~(T(1) << i)); }
template<typename T> inline int CNT(T MASK) {
    if (numeric_limits<T>::digits <= numeric_limits<unsigned int>::digits) return __builtin_popcount(MASK);
    else return __builtin_popcountll(MASK);
}
template<class T> inline int RIGHT(T MASK) { return log2(MASK & -MASK); }

int dx4[] = { 0, 0, -1, +1 }; int dy4[] = { +1, -1, 0, 0 };
int dx8[] = { 1, 1, 0, -1, -1, -1, 0, 1, 0 }; int dy8[] = { 0, 1, 1, 1, 0, -1, -1, -1, 0 };

inline void I(int& a) { scanf("%d", &a); } inline void I(LL& a) { scanf("%I64d", &a); }
inline void I(ULL& a) { scanf("%I64u", &a); } inline void I(char* a) { scanf("%s", a); }
char Iarr[S_SIZE]; inline void I(string& a) { scanf("%s", Iarr); a = Iarr; }
template<typename T, typename... Args>
void I(T& a, Args&... args) { I(a); I(args...); }

inline void OUT(int a) { printf("%d", a); } inline void OUT(LL a) { printf("%I64d", a); }
inline void OUT(const char* a) { printf("%s", a); } inline void OUT(char* a) { printf("%s", a); }
inline void OUT(bool a) { printf("%d", a); } inline void OUT(string a) { rep(it, a.begin(), a.end()) printf("%c", *it); }
inline void OUT(ULL a) { printf("%I64u", a); }
template<typename T, typename... Args>
void OUT(T a, Args... args) { OUT(a); OUT(" "); OUT(args...); }
template<typename... Args>
void O(Args... args) { OUT(args...); OUT("\n"); }

template<typename T1, typename T2>
inline ostream& operator<<(ostream& os, pair<T1, T2> p) { os << "{" << p.first << ", " << p.second << "}"; return os; }
template<typename T>
inline ostream& operator<<(ostream& os, vector<T>& a) { os << "["; for (int i = 0; i < (int)a.size(); i++) { if (i) os << ", "; os << a[i]; } os << "]"; return os; }

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cout << *it << " = " << a << endl;
	err(++it, args...);
}

// mp.reserve(1024); mp.max_load_factor(0.25);
// head

const int M = 100010; // maximum number of cubes
//const LL modd = 998244353;

int main()
{
    int n;
    cin >> n;
    string s;
    while (n--) {
        s.pb('0');
    }
    int cnt;
    cout << "? " << s << endl;
    cin >> cnt;

    int low = 0, high = SZ(s) - 1;
    while (low < high - 1) {
        string ss;
        ss.resize(SZ(s));
        for (int i = 0; i < SZ(s); i++) {
            if (i >= low && i <= high) {
                ss[i] = '1';
            }
            else {
                ss[i] = '0';
            }
        }
        cout << "? " << ss << endl;
        int ret;
        cin >> ret;
        int diff = abs(cnt - ret);
        int one = (high - low + 1 - diff) / 2;
        int two = one + diff;
        high = low + min(one, two);
    }
    for (int i = 0; i < SZ(s); i++) {
        if (i == low) s[i] = '1';
        else s[i] = '0';
    }
    cout << "? " << s << endl;
    int nCnt;
    cin >> nCnt;
    if (nCnt < cnt) {
        cout << "! " << high + 1 << " " << low + 1 << endl;
    }
    else {
        cout << "! " << low + 1 << " " << high + 1 << endl;
    }

    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
#define ll long long
using namespace std;

#define N 20
#define MAX 900000 // Why? :D
#define inf 0x7fffffff

int ans[20];
int pos0 = -1, pos1 = -1;
bool findZero;

int n;
void send(int a, int b) {
    string str;
    str.resize(n);
    if(findZero) {
        for (int i = 0; i <= n; i++) {
            if (i >= a && i <= b) str[i] = '0';
            else str[i] = '1';
        }
    }
    else {
        for (int i = 0; i <= n; i++) {
            if (i >= a && i <= b) str[i] = '1';
            else str[i] = '0';
        }
    }
    cout << "? " << str << '\n';
    fflush(stdout);
}

int main() {
    cin >> n;
    string str;

    str.resize(n);

    send(-1, -1);
    cin >> ans[0];
    send(0, 0);
    cin >> ans[1];
    if(ans[0] > ans[1]) {
        pos1 = 0;
        findZero = true;
    }
    else {
        pos0 = 0;
        findZero = false;
    }

    send(-1, -1);
    cin >> ans[0];

    int l = 0, r = n;
    for(int i = 3; i < 15; i++) {
        int mid = (l + r) / 2;
        send(l, mid);
//        printf("%d %d\n", l, r);
        cin >> ans[i];
        int x;
        if(findZero)
            x = ((mid - l + 1) + ans[0] - ans[i]) / 2;
        else
            x = ((mid - l + 1) + ans[0] - ans[i]) / 2;
        if(l == mid && x == 1) {
            if(findZero) pos0 = l;
            else pos1 = l;
            break;
        }
//        printf("(%d %d) 1의 개수 : %d\n", l, mid, x);
        if(x == 0) {
            l = mid + 1;
            r = r;
        }
        else {
            l = l;
            r = mid;
        }
    }
    cout << "! " << pos0 + 1 << ' ' << pos1 + 1 << '\n';
    fflush(stdout);
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) x.begin(),x.end()
#define len(x) (int)(x).size()
#define int long long

/*
#pragma GCC omptimize("unroll-loops")
#pragma optimize("SEX_ON_THE_BEACH")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:10000000000")
*/

using namespace std;
using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pari;
typedef vector<vi > matrix;

ld PI = 3.14159265358979323846;

typedef tree<int, null_type, less<int >,
    rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void volodya22(){
    #ifdef THERE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen("fibonacci.in", "r", stdin);
        //freopen("fibonacci.out", "w", stdout);
        #define endl "\n"
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(6);
    //cout << fixed;
}

const int N = 1e6+7;
const int alphabet = 256;
const ll INF = 2e9+7;
const ll MOD = 1e9+7;
const ld eps = 1e-8;
const int K = 2000+7;

int m1 = 998244353;
int m2 = 1e9+9;
int p1 = 347;
int p2 = 108;

struct Zdarovo{
    int x,c;
};

int n;
string s;
int p[N];
int dp[N];

void input(){
    cin >> n >> s;
    set<int> st;
    set<int> A,B;
    int ans = 0;
    for(int i = 0;i < n;i++){
        if(s[i] == 'A')
            A.insert(i);
        else B.insert(i);
    }

    for(int i = n-1;i >= 0;i--){
        if(s[i] == 'A'){
            if(A.upper_bound(i) == A.end())
                dp[i] = 0;
            else{
                int x = *(A.upper_bound(i))+1;
                dp[i] = 1+dp[x];
                if(s[x] == s[i] || s[x] == s[i+1])
                    dp[i] = n-x+1;
            }
        }else{
            if(A.upper_bound(i) == B.end())
                dp[i] = 0;
            else{
                int x = *(B.upper_bound(i))+1;
                dp[i] = 1+dp[x];
                if(s[x] == s[i] || s[x] == s[i+1])
                    dp[i] = n-x+1;
            }
        }
        //cout << dp[i] << endl;
        ans += dp[i];
    }
    cout << ans;
}

void solve(){

}

signed main(){
    volodya22();
    input();
    solve();
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) x.begin(),x.end()
#define len(x) (int)(x).size()
#define int long long

/*
#pragma GCC omptimize("unroll-loops")
#pragma optimize("SEX_ON_THE_BEACH")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:10000000000")
*/

using namespace std;
using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pari;
typedef vector<vi > matrix;

ld PI = 3.14159265358979323846;

typedef tree<int, null_type, less<int >,
    rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void volodya22(){
    #ifdef THERE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen("fibonacci.in", "r", stdin);
        //freopen("fibonacci.out", "w", stdout);
        #define endl "\n"
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(6);
    //cout << fixed;
}

const int N = 1e6+7;
const int alphabet = 256;
const ll INF = 2e9+7;
const ll MOD = 1e9+7;
const ld eps = 1e-8;
const int K = 2000+7;

int m1 = 998244353;
int m2 = 1e9+9;
int p1 = 347;
int p2 = 108;

struct Zdarovo{
    int x,c;
};

int n;
string s;
int p[N];
int dp[N];

set<int> A,B;

void f(int i){
    if(s[i] == 'A')
        A.insert(i);
    else B.insert(i);
}

void input(){
    cin >> n >> s;
    set<int> st;

    int ans = 0;
    for(int i = 0;i < n-1;i++){
        if(s[i] != s[i+1]){
            f(i);
            f(i+1);
            //cout << i+1 << endl;
            //cout << i << endl;
        }
    }

    f(n-1);

     for(int i = n-1;i >= 0;i--){
        if(s[i] == 'A'){
            if(A.upper_bound(i) == A.end())
                dp[i] = 0;
            else{
                if(B.upper_bound(i) == B.end()){
                    dp[i] = n-i-1;
                }else if(B.upper_bound(i) == (--B.end())){
                    dp[i] = n-i-2;
                }else{
                    if(s[i] == s[i+1]){
                        dp[i] = n-i-2;
                    }else{
                        dp[i] = n-*(A.upper_bound(i));
                    }
                }
            }
        }else{
            if(B.upper_bound(i) == B.end())
                dp[i] = 0;
            else{
                if(A.upper_bound(i) == A.end()){
                    dp[i] = n-i-1;
                }else if(A.upper_bound(i) == (--A.end())){
                    dp[i] = n-i-2;
                }else{
                    if(s[i] == s[i+1]){
                        dp[i] = n-i-2;
                    }else{
                        dp[i] = n-*(B.upper_bound(i));
                    }
                }
            }
        }
        //cout << dp[i] << endl;
        ans += dp[i];
    }
    cout << ans;
}

void solve(){

}

signed main(){
    volodya22();
    input();
    solve();
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) x.begin(),x.end()
#define len(x) (int)(x).size()
#define int long long

/*
#pragma GCC omptimize("unroll-loops")
#pragma optimize("SEX_ON_THE_BEACH")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:10000000000")
*/

using namespace std;
using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pari;
typedef vector<vi > matrix;

ld PI = 3.14159265358979323846;

typedef tree<int, null_type, less<int >,
    rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void volodya22(){
    #ifdef THERE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen("fibonacci.in", "r", stdin);
        //freopen("fibonacci.out", "w", stdout);
        #define endl "\n"
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(6);
    //cout << fixed;
}

const int N = 1e6+7;
const int alphabet = 256;
const ll INF = 2e9+7;
const ll MOD = 1e9+7;
const ld eps = 1e-8;
const int K = 2000+7;

int m1 = 998244353;
int m2 = 1e9+9;
int p1 = 347;
int p2 = 108;

struct Zdarovo{
    int x,c;
};

int n;
string s;
int p[N];
int dp[N];

void input(){
    cin >> n >> s;
    set<int> st;
    set<int> A,B;
    int ans = 0;
    for(int i = 0;i < n;i++){
        if(s[i] == 'A')
            A.insert(i);
        else B.insert(i);
    }

    for(int i = n-1;i >= 0;i--){
        if(s[i] == 'A'){
            if(A.upper_bound(i) == A.end())
                dp[i] = 0;
            else{
                int x = *(A.upper_bound(i))+1;
                dp[i] = 1+dp[x];
                if(s[x] == s[i] || s[x] == s[i+1])
                    dp[i] = n-x+1;
            }
        }else{
            if(B.upper_bound(i) == B.end())
                dp[i] = 0;
            else{
                int x = *(B.upper_bound(i))+1;
                dp[i] = 1+dp[x];
                if(s[x] == s[i] || s[x] == s[i+1])
                    dp[i] = n-x+1;
            }
        }
        //cout << dp[i] << endl;
        ans += dp[i];
    }
    cout << ans;
}

void solve(){

}

signed main(){
    volodya22();
    input();
    solve();
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) x.begin(),x.end()
#define len(x) (int)(x).size()
#define int long long

/*
#pragma GCC omptimize("unroll-loops")
#pragma optimize("SEX_ON_THE_BEACH")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:10000000000")
*/

using namespace std;
using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pari;
typedef vector<vi > matrix;

ld PI = 3.14159265358979323846;

typedef tree<int, null_type, less<int >,
    rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void volodya22(){
    #ifdef THERE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen("fibonacci.in", "r", stdin);
        //freopen("fibonacci.out", "w", stdout);
        #define endl "\n"
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(6);
    //cout << fixed;
}

const int N = 1e6+7;
const int alphabet = 256;
const ll INF = 2e9+7;
const ll MOD = 1e9+7;
const ld eps = 1e-8;
const int K = 2000+7;

int m1 = 998244353;
int m2 = 1e9+9;
int p1 = 347;
int p2 = 108;

struct Zdarovo{
    int x,c;
};

int n;
string s;
int p[N];
int dp[N];

void input(){
    cin >> n >> s;
    set<int> st;
    set<int> A,B;
    int ans = 0;
    for(int i = 0;i < n;i++){
        if(s[i] == 'A')
            A.insert(i);
        else B.insert(i);
    }

    for(int i = n-1;i >= 0;i--){
        if(s[i] == 'A'){
            if(A.upper_bound(i) == A.end())
                dp[i] = 0;
            else{
                int x = *(A.upper_bound(i))+1;
                dp[i] = 1+dp[x];
                if(s[x] == s[i] || s[x] == s[i+1])
                    dp[i] = n-x+1;
            }
        }else{
            if(B.upper_bound(i) == B.end())
                dp[i] = 0;
            else{
                int x = *(B.upper_bound(i))+1;
                dp[i] = 1+dp[x];
                if(dp[x] == 0){
                    if(s[x] == s[i] || s[x] == s[i+1])
                        dp[i]++;
                }
            }
        }
        //cout << dp[i] << endl;
        ans += dp[i];
    }
    cout << ans;
}

void solve(){

}

signed main(){
    volodya22();
    input();
    solve();
}