#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
#define DEBUG 0
#if DEBUG
string actual;
int use_machine(vector<int> arr){
cout << "? ";
for(auto x : arr) cout << x << " ";
cout << endl;
int count = 0;
for(int i = 1; i< arr.size(); i++){
if(actual[arr[i]] != actual[arr[i-1]]) count++;
}
return count;
}
#endif
int count_mushrooms(int n) {
vector<int> A = {0};
vector<int> B;
int b = 90;
int i = 1;
while(A.size() < b && B.size() < b){
if(i == n) return A.size();
if(use_machine({0,i}) == 0) A.push_back(i);
else B.push_back(i);
i++;
}
bool swapped = false;
if(B.size() == b){
swapped = true;
swap(A,B);
}
int count = 0;
while(i < n){
int qs = min(b,n-i);
vector<int> arr;
for(int j = 0; j< qs; j++){
arr.push_back(A[j]);
arr.push_back(i+j);
}
count += qs-(use_machine(arr)+1)/2;
i += qs;
}
count += A.size();
if(swapped) count = n - count;
return count;
}
#if DEBUG
int main(){
string s;
cin >> s;
actual = s;
int ans = count_mushrooms(s.size());
cout << "! " << ans << endl;
}
#endif