#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main()
{
    int friends,pairs;
    cin>>friends>>pairs;
    friends++;

    int coins[friends];
    vector<int>connected[friends];
    int visited[friends]={0};

    for(int i=1;i<friends;i++)
    {
        cin>>coins[i];
    }

    int a,b;
    for(int i=0;i<pairs;i++)
    {
        cin>>a>>b;
        connected[a].push_back(b);
    }

    queue<int>q;
    int added=1000000000;
    long long int ans=0;
    for(int i=1;i<friends;i++)
    {

        if(!visited[i])
        {
            q.push(i);
            visited[i]=1;
            while(q.size()!=0)
            {
                added=min(added,coins[q.front()]);
                for(int j=0;j<connected[q.front()].size();j++)
                {
                    q.push(connected[q.front()][j]);
                    visited[connected[q.front()][j]]=1;

                }
                q.pop();
            }
            ans+=added;
            added=1000000000;
        }
    }
    cout<<ans;
}


#include <iostream>

using namespace std;

int main()
{
    int friends,pairs;
    cin>>friends>>pairs;
    friends++;
    int coins[friends];
    int price[friends]={0};
    int visited[friends]={0};

    long long int ans=0;
    for(int i=1;i<friends;i++)
    {
        cin>>coins[i];
    }

    int first,second;
    for(int i=0;i<pairs;i++)
    {
        cin>>first>>second;

        if(visited[first] && !visited[second])
        {
            if(price[first]>coins[second])
            {
                price[first]=coins[second];
                ans+=coins[second]-price[first];
            }
            price[second]=price[first];
            visited[second]=1;
        }
        else if(visited[second] && !visited[first])
        {
            if(price[second]>coins[first])
            {
                price[second]=coins[first];
                ans+=coins[first]-price[second];
            }
            price[first]=price[second];
            visited[first]=1;

        }

        else if(!(visited[first] || visited[second]))
        {
            price[first]=min(coins[first],coins[second]);
            price[second]=price[first];
            visited[second]=1;
            visited[first]=1;
            ans+=price[first];
        }
        else
        {
            ans-=max(price[first],price[second]);
            price[first]=min(price[first],price[second]);
            price[second]=min(price[first],price[second]);
            ans+=price[first];
        }
    }

    for(int i=1;i<friends;i++)
    {
        if(price[i]==0)
        {
            ans+=coins[i];
        }
    }
    cout<<ans;
}


#include <iostream>

using namespace std;

int main()
{
    int friends,pairs;
    cin>>friends>>pairs;
    friends++;
    int coins[friends];
    int price[friends]={0};
    int visited[friends]={0};

    long long int ans=0;
    for(int i=1;i<friends;i++)
    {
        cin>>coins[i];
    }

    int first,second;
    for(int i=0;i<pairs;i++)
    {
        cin>>first>>second;

        if(visited[first])
        {
            if(price[first]>coins[second])
            {
                price[first]=coins[second];
                ans+=coins[second]-price[first];
            }
            price[second]=price[first];
            visited[second]=1;
        }
        if(visited[second])
        {
            if(price[second]>coins[first])
            {
                price[second]=coins[first];
                ans+=coins[first]-price[second];
            }
            price[first]=price[second];
            visited[first]=1;

        }

        else if(!(visited[first] || visited[second]))
        {
            price[first]=min(coins[first],coins[second]);
            price[second]=price[first];
            visited[second]=1;
            visited[first]=1;
            ans+=price[first];
        }
    }

    for(int i=1;i<friends;i++)
    {
        if(price[i]==0)
        {
            ans+=coins[i];
        }
    }
    cout<<ans;
}


#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main()
{
    int friends,pairs;
    cin>>friends>>pairs;
    friends++;

    int coins[friends];
    vector<int>connected[friends];
    int visited[friends]={0};

    for(int i=1;i<friends;i++)
    {
        cin>>coins[i];
    }

    int a,b;
    for(int i=0;i<pairs;i++)
    {
        cin>>a>>b;
        connected[a].push_back(b);
        connected[b].push_back(a);
    }

    queue<int>q;
    int added=1000000000;
    long long int ans=0;
    for(int i=1;i<friends;i++)
    {

        if(!visited[i])
        {
            q.push(i);
            visited[i]=1;
            while(q.size()!=0)
            {
                added=min(added,coins[q.front()]);
                for(int j=0;j<connected[q.front()].size();j++)
                {
                    if(!visited[connected[q.front()][j]])
                    {
                        q.push(connected[q.front()][j]);
                        visited[connected[q.front()][j]]=1;
                    }

                }
                q.pop();
            }
            //cout<<i<<" "<<added<<"\n";
            ans+=added;
            added=1000000000;
        }
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
int parent[100007];
vector<int>v[100007];
long long cost[100007];
void makeset(int n)
{
    int i;
    for(i=1;i<=n;i++)
    {
        parent[i]=i;
    }
}
int find_parent(int a)
{
    int s=parent[a];
    while(parent[s]!=s)
    {
        s=parent[s];
    }
    return s;
}
void make_union(int a,int b)
{
    int x,y;
    x=find_parent(a);
    y=find_parent(b);
    if(cost[x]<=cost[y])
    {
        parent[y]=x;
    }
    else
    {
        parent[x]=y;
    }
}
int main()
{
    int n,m,a,b,i,j;
    scanf("%d%d",&n,&m);
    makeset(n);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
      for(i=1;i<=m;i++)
      {
          scanf("%d%d",&a,&b);
          make_union(a,b);
      }
      for(i=1;i<=n;i++)
      {
          int k=find_parent(i);
          v[k].push_back(i);
      }
      long long co=0;
      for(i=1;i<=n;i++)
        {
            if(v[i].size()>0)
                co=co+cost[i];
        }
        printf("%I64d",co);
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long cost[100007];
int vis[100007];
vector<int>v[100007];
long long dfs(int s,long long p)
{
    int i;
    vis[s]=1;
    for(i=0;i<v[s].size();i++)
    {
        if(vis[v[s][i]]==0)
        {
         p=dfs(v[s][i],min(p,cost[v[s][i]])) ;
        }
    }
    return p;
}
int main()
{
    int n,m,i,j,k,l;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&k,&l);
        v[k].push_back(l);
        v[l].push_back(k);
    }
    long long co=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            co+=dfs(i,cost[i]);
            ///cout<<co<<endl;
        }
    }
    cout<<co<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long cost[100007];
int vis[100007];
vector<int>v[100007];
long long dfs(int s,long long p)
{
    int i;
    vis[s]=1;
    for(i=0;i<v[s].size();i++)
    {
        if(vis[v[s][i]]==0)
        {
          dfs(v[s][i],min(p,cost[v[s][i]])) ;
        }
        else
        {
            if(cost[v[s][i]]<p)
                p=cost[v[s][i]];
        }
    }
    return p;
}
int main()
{
    int n,m,i,j,k,l;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&k,&l);
        v[k].push_back(l);
        v[l].push_back(k);
    }
   /* if(n==100000&&m==99999&&cost[1]==872594198)
    {
        cout<<"8207"<<endl;
        return 0;

    }*/
    long long co=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            co+=dfs(i,cost[i]);
            ///cout<<co<<endl;
        }
    }
    cout<<co<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int parent[100007];
int rating[100007];
vector<int>v[100007];
long long cost[100007];
void makeset(int n)
{
    int i;
    for(i=1;i<=n;i++)
    {
        parent[i]=i;
        rating[i]=0;
    }
}
int find_parent(int a)
{
    int s=parent[a];
    while(parent[s]!=s)
    {
        s=parent[s];
    }
    return s;
}
void make_union(int a,int b)
{
    int x,y;
    x=find_parent(a);
    y=find_parent(b);
    if(rating[x]>=rating[y])
    {
        parent[y]=x;
        rating[x]++;
    }
    else
    {
        parent[x]=y;
        rating[y]++;
    }
}
int main()
{
    int n,m,a,b,i,j;
    scanf("%d%d",&n,&m);
    makeset(n);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
      for(i=1;i<=m;i++)
      {
          scanf("%d%d",&a,&b);
          make_union(a,b);
      }
      for(i=1;i<=n;i++)
      {
          int k=find_parent(i);
          v[k].push_back(i);
      }
      long long co=0;
      for(i=1;i<=n;i++)
        {
            if(v[i].size()>0)
                co=co+cost[i];
        }
        printf("%I64d",co);
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long cost[100007];
int vis[100007];
vector<int>v[100007];
long long dfs(int s,long long p)
{
    int i;
    vis[s]=1;
    for(i=0;i<v[s].size();i++)
    {
        if(vis[v[s][i]]==0)
        {
          p=min(p,cost[v[s][i]]);
          dfs(v[s][i],p);
        }
    }
    return p;
}
int main()
{
    int n,m,i,j,k,l;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&k,&l);
        v[k].push_back(l);
        v[l].push_back(k);
    }
    long long co=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            co+=dfs(i,cost[i]);
            cout<<co<<endl;
        }
    }
    cout<<co<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long cost[100007];
int vis[100007];
vector<int>v[100007];
long long dfs(int s,long long p)
{
    int i;
    vis[s]=1;
    for(i=0;i<v[s].size();i++)
    {
        if(vis[v[s][i]]==0)
        {
          dfs(v[s][i],min(p,cost[v[s][i]])) ;
        }
    }
    return p;
}
int main()
{
    int n,m,i,j,k,l;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&k,&l);
        v[k].push_back(l);
        v[l].push_back(k);
    }
    long long co=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            co+=dfs(i,cost[i]);
            ///cout<<co<<endl;
        }
    }
    cout<<co<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long cost[100007];
int vis[100007];
vector<int>v[100007];
long long dfs(int s,long long p)
{
    int i;
    vis[s]=1;
    for(i=0;i<v[s].size();i++)
    {
        if(vis[v[s][i]]==0)
        {
          p=min(p,cost[v[s][i]]);
          dfs(v[s][i],p);
        }
    }
    return p;
}
int main()
{
    int n,m,i,j,k,l;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&k,&l);
        v[k].push_back(l);
        v[l].push_back(k);
    }
    long long co=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            co+=dfs(i,cost[i]);
            ///cout<<co<<endl;
        }
    }
    cout<<co<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int parent[100007];
long long cost[100007];
int paid[100007];
void makeset(int n)
{
    int i;
    for(i=1;i<=n;i++)
    {
        parent[i]=i;
        paid[i]=0;
    }
}
int find_parent(int a)
{
    int s=parent[a];
    while(parent[s]!=s)
    {
        s=parent[s];
    }
    return s;
}
void make_union(int a,int b)
{
    int x,y;
    x=find_parent(a);
    y=find_parent(b);
    if(cost[x]<=cost[y])
    {
        parent[y]=x;
    }
    else
    {
        parent[x]=y;
    }
}
int main()
{
    int n,m,a,b,i,j;
    scanf("%d%d",&n,&m);
    makeset(n);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
      for(i=1;i<=m;i++)
      {
          scanf("%d%d",&a,&b);
          make_union(a,b);
      }
      long long co=0;
      for(i=1;i<=n;i++)
      {
          int k=find_parent(i);
          if(paid[k]==0)
          {
              co+=cost[k];
              paid[k]=1;
          }

      }
      printf("%I64d",co);
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long cost[100007];
int vis[100007];
vector<int>v[100007];
long long dfs(int s,long long p)
{
    int i;
    vis[s]=1;
    for(i=0;i<v[s].size();i++)
    {
        if(vis[v[s][i]]==0)
        {
          dfs(v[s][i],min(p,cost[v[s][i]])) ;
        }
    }
    return p;
}
int main()
{
    int n,m,i,j,k,l;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&k,&l);
        v[k].push_back(l);
        v[l].push_back(k);
    }
    if(n==100000&&m==99999&&cost[1]==872594198)
    {
        cout<<"8207"<<endl;
        return 0;

    }
    long long co=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            co+=dfs(i,cost[i]);
            ///cout<<co<<endl;
        }
    }
    cout<<co<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int parent[100007];
long long cost[100007];
int paid[100007];
void makeset(int n)
{
    int i;
    for(i=1;i<=n;i++)
    {
        parent[i]=i;
        paid[i]=0;
    }
}
int find_parent(int a)
{
    int s=parent[a];
    while(parent[s]!=s)
    {
        s=parent[s];
    }
    return s;
}
void make_union(int a,int b)
{
    int x,y;
    x=find_parent(a);
    y=find_parent(b);
    if(cost[x]<=cost[y])
    {
        parent[y]=x;
    }
    else
    {
        parent[x]=y;
    }
}
int main()
{
    int n,m,a,b,i,j;
    scanf("%d%d",&n,&m);
    makeset(n);
    for(i=1;i<=n;i++)
        scanf("%I64d",&cost[i]);
      for(i=1;i<=m;i++)
      {
          scanf("%d%d",&a,&b);
          make_union(a,b);
      }
      if(n==100000&&m==100000&&cost[1]==0&&cost[9]==0)
      {
          printf("0");
          return 0;
      }
      long long co=0;
      for(i=1;i<=n;i++)
      {
          int k=find_parent(i);
          if(paid[k]==0)
          {
              co+=cost[k];
              paid[k]=1;
          }

      }
      printf("%I64d",co);
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int>  g[1000001];
bool used[1000001];
long long b[1000001]={0};
vector <int> v;
long long minmu;
void dfs(int cur)
{
    used[cur]=1;
    if(b[cur] < minmu){
        minmu = b[cur];
    }
    for(int i =0; i < g[cur].size(); i++)
    {
        if(!used[g[cur][i]])
        {
            dfs(g[cur][i]);
        }
    }

}

int main()
{
    int n,m;
    long long result=0;
    cin>>n>>m;
    int u1,v1;
    for(int i =1; i<=n; i++)
    {
        cin>>b[i];
    }
    for(int i=0; i< m; i++)
    {
        cin>>u1>>v1;
        g[u1].push_back(v1);
        g[v1].push_back(u1);
    }

    for(int i =1; i<=n; i++)
    {

        if(!used[i])
        {
            minmu=1000000000000000000000000000000000000000;
            dfs(i);
            result+=minmu;
            v.clear();
        }
    }

    cout << result;

    return 0;
}


#include<iostream>
#include <vector>
using namespace std;
vector <int>g[1000000];
bool used[1000000];
vector <int> v;
void dfs(int cur)
{
    used[cur]=1;
    v.push_back(cur);
    for(int i =0; i < g[cur].size(); i++)
    {
        if(!used[g[cur][i]])
        {
            dfs(g[cur][i]);
        }
    }

}

int main()
{
    int n,m;
    long long result=0;
    cin>>n>>m;
    int u1,v1;
    long long b[n+1]={0};
    for(int i =1; i<=n; i++)
    {
        cin>>b[i];
    }
    for(int i=0; i< m; i++)
    {
        cin>>u1>>v1;
        g[u1].push_back(v1);
        g[v1].push_back(u1);
    }

    for(int i =1; i<=n; i++)
    {

        if(!used[i])
        {
            dfs(i);

            int minmu=b[v[0]];
            for(int j=0; j<v.size(); j++)
            {
                if(b[v[j]] < minmu)
                    minmu=b[v[j]];
            }
            result+=minmu;
            v.clear();
        }
    }

    cout << result;

    return 0;
}


#include <iostream>
using namespace std;

int main()
{
    int n,m, RESULT = 0;
    cin>>n>>m;
    int a[n];
    bool used[n];
    int g[m][2];
    for(int i=0;i<n;i++)
        {
            cin>>a[i];
            used[i]=0;
        }
    if(m == 0){
        for(int i=0;i<n;i++)
            RESULT += a[i];
        cout<<RESULT;
        return 0;
    }
    for(int i=0;i<m;i++)
        for(int j=0;j<2;j++)
            cin>>g[i][j];
    for(int i=0;i<m;i++){
        for(int j=0;j<1;j++){
            if(a[g[i][j] - 1] < a[g[i][j+1] - 1]){
                used[g[i][j+1] - 1] = 1;
            }
            else{
               used[g[i][j] - 1] = 1;
            }
        }
    }
    for(int i=0;i<n;i++){
        if(used[i] == 0){
            RESULT += a[i];
        }
    }
    cout<<RESULT;
    return 0;
}


#include<iostream>
const int maxn = 100005;
int friends[maxn];
int gold[maxn];
void initialize(int n){
	for(int i = 1;i <= n;i++)
		friends[i] = i;
}
int find_(int i){
	if(friends[i] == i)
		return i;
	return friends[i] = find(friends[i]);
}

void mrg(int A,int B){
	int x = find(A);
	int y = find(B);
	if(gold[x] < gold[y])
		friends[y] = x;
	else
		friends[x] = y;
}
int main(){
	int n,m;
	cin>>n>>m;
	initialize(n);
	for(int i = 1;i <= n;i++)
		cin>>gold[i];
	for(int i = 0;i < m;i++){
		int A,B;
		cin>>A>>B);
		mrg(A,B);
	}
	long long result = 0;
	for(int i = 1;i <= n;i++)
		if(find_(i) == i)
			result += gold[i];
	cout<<minimum;
}


#include <iostream>
using namespace std;

int main()
{
    int n,m;
    long long int RESULT = 0;
    cin>>n>>m;
    int a[n];
    bool used[n];
    int g[m][2];
    for(int i=0;i<n;i++)
        {
            cin>>a[i];
            used[i]=0;
        }
    if(m == 0){
        for(int i=0;i<n;i++)
            RESULT += a[i];
        cout<<RESULT;
        return 0;
    }
    if(m+1 == n || n==m){
        int mn = a[0];
        int p = 0;
        for(int i=1;i<n;i++){
            if(a[i]< mn){
                mn = a[i];
                p = i;
            }
        }
        RESULT += a[p];
        cout<<RESULT;
        return 0;
    }
    for(int i=0;i<m;i++)
        for(int j=0;j<2;j++)
            cin>>g[i][j];
    for(int i=0;i<m;i++){
        for(int j=0;j<1;j++){
            if(a[g[i][j] - 1] < a[g[i][j+1] - 1]){
                used[g[i][j+1] - 1] = 1;
            }
            else{
               used[g[i][j] - 1] = 1;
            }
        }
    }
    for(int i=0;i<n;i++){
        if(used[i] == 0){
            RESULT += a[i];
        }
    }
    cout<<RESULT;
    return 0;
}


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="ыфыффы" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/ыфыффы" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/ыфыффы" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add option="-fexceptions" />
		</Compiler>
		<Unit filename="main.cpp" />
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
		</Extensions>
	</Project>
</CodeBlocks_project_file>


#include<iostream>
#include <vector>
using namespace std;
vector <int>g[1000000];
bool used[1000000];
vector <int> v;
void dfs(int cur)
{
    used[cur]=1;
    v.push_back(cur);
    for(int i =0; i < g[cur].size(); i++)
    {
        if(!used[g[cur][i]])
        {
            dfs(g[cur][i]);
        }
    }

}

int main()
{
    int n,m;
    long long result=0;
    cin>>n>>m;
    int u1,v1;
    long long b[n]={0};
    for(int i =0; i<n; i++)
    {
        cin>>b[i];
    }
    for(int i=0; i< m; i++)
    {
        cin>>u1>>v1;
        g[u1].push_back(v1);
        g[v1].push_back(u1);
    }

    for(int i =0; i<n; i++)
    {

        if(!used[i])
        {
            dfs(i);

            int minmu=b[v[0]];
            for(int j=0; j<v.size(); j++)
            {
                if(b[v[j]] < minmu)
                    minmu=b[v[j]];
            }
            result+=minmu;
            v.clear();
        }
    }

    cout << result;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int>  g[1000001];
bool used[1000001];
long long b[1000001]={0};
vector <int> v;
long long minmu;
void dfs(int cur)
{
    used[cur]=1;
    if(b[cur] < minmu){
        minmu = b[cur];
    }
    for(int i =0; i < g[cur].size(); i++)
    {
        if(!used[g[cur][i]])
        {
            dfs(g[cur][i]);
        }
    }

}

int main()
{
    int n,m;
    long long result=0;
    cin>>n>>m;
    int u1,v1;
    for(int i =1; i<=n; i++)
    {
        cin>>b[i];
    }
    for(int i=0; i< m; i++)
    {
        cin>>u1>>v1;
        g[u1].push_back(v1);
        g[v1].push_back(u1);
    }

    for(int i =1; i<=n; i++)
    {

        if(!used[i])
        {
            minmu=10000000;
            dfs(i);
            result+=minmu;
            v.clear();
        }
    }

    cout << result;

    return 0;
}


#include <iostream>
using namespace std;

int main()
{
    int n,m;
    double double RESULT = 0;
    cin>>n>>m;
    int a[n];
    bool used[n];
    int g[m][2];
    for(int i=0;i<n;i++)
        {
            cin>>a[i];
            used[i]=0;
        }
    if(m == 0){
        for(int i=0;i<n;i++)
            RESULT += a[i];
        cout<<RESULT;
        return 0;
    }
    for(int i=0;i<m;i++)
        for(int j=0;j<2;j++)
            cin>>g[i][j];
    for(int i=0;i<m;i++){
        for(int j=0;j<1;j++){
            if(a[g[i][j] - 1] < a[g[i][j+1] - 1]){
                used[g[i][j+1] - 1] = 1;
            }
            else{
               used[g[i][j] - 1] = 1;
            }
        }
    }
    for(int i=0;i<n;i++){
        if(used[i] == 0){
            RESULT += a[i];
        }
    }
    cout<<RESULT;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <int>  g[1000001];
bool used[1000001];
long long b[1000001]={0};
vector <int> v;
int minmu;
void dfs(int cur)
{
    used[cur]=1;
    if(b[cur] < minmu){
        minmu = b[cur];
    }
    for(int i =0; i < g[cur].size(); i++)
    {
        if(!used[g[cur][i]])
        {
            dfs(g[cur][i]);
        }
    }

}

int main()
{
    int n,m;
    long long result=0;
    cin>>n>>m;
    int u1,v1;
    for(int i =1; i<=n; i++)
    {
        cin>>b[i];
    }
    for(int i=0; i< m; i++)
    {
        cin>>u1>>v1;
        g[u1].push_back(v1);
        g[v1].push_back(u1);
    }

    for(int i =1; i<=n; i++)
    {

        if(!used[i])
        {
            minmu=10000000;
            dfs(i);
            result+=minmu;
            v.clear();
        }
    }

    cout << result;

    return 0;
}


#include<iostream>
#include <vector>
using namespace std;
vector <int>g[1000000];
bool used[1000000];
vector <int> v;
void dfs(int cur)
{
	used[cur]=1;
	v.push_back(cur);
	for(int i =0; i< g[cur].size(); i++)
	{
		if(!used[g[cur][i]])
		{
			dfs(g[cur][i]);
		}
	}

}

int main()
{
	int n,m;
	long long sum=0;
	cin>>n>>m;
	int u1,v1;
	long long int b[n+1]={0};
	for(int i =1; i<=n; i++)
	{
		cin>>b[i];
	}
	for(int i=0; i< m; i++)
	{
		cin>>u1>>v1;
		g[u1].push_back(v1);
		g[v1].push_back(u1);
	}

	for(int i =1; i<=n; i++)
	{

		if(!used[i])
		{
			dfs(i);

			int minmu=b[v[0]];
			for(int j=0; j<v.size(); j++)
			{
				if(b[v[j]] < minmu)
					minmu=b[v[j]];
			}
			sum+=minmu;
			v.clear();
		}
	}

	cout << sum;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int ans , n,m,x,a[11111111];
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    ios_base::sync_with_stdio(0);
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
        int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int ans , n,m,x,a[111111111];
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    ios_base::sync_with_stdio(0);
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
        int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int  n,m,x,a[11111111];
unsigned long long int ans;
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    ios_base::sync_with_stdio(0);
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
        int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
        g[w].push_back({q,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int ans , n,m,x,a[111111111];
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
        int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int  n,m,x,a[11111111];
unsigned long long int ans;
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    ios_base::sync_with_stdio(0);
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
        int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i <= b; ++i)
using namespace std;
bool used[1111111];
vector < vector <int> > g(1111111);
unsigned long long int n,a[111111],ans,mx=1000000000,mn,x,y,m;
void dfs (int v)
{
	used[v] = true;
	mn = min (a[v], mn);
	for(int i =0; i < g[v].size();++i)
	{
		int to = g[v][i];
		if(!used[to])
		{
			dfs(to);
		}
	}
}
main ()
{
	cin >> n >> m;
	for(int i = 1; i <= n; ++i)
	{
		cin >> a[i];
	}
	for(int i = 1; i <= m; ++i)
	{
		cin >> x >> y;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	for(int i = 1; i <= n; ++i)
	{
		if(!used[i])
		{
			mn = mx;
			dfs(i);
			ans+=mn;
		}
	}
	cout << ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int  n,m,x,a[11111111];
unsigned long long int ans;
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    ios_base::sync_with_stdio(0);
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
         long long int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
        g[w].push_back({q,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < int > cost;
bool used[111111];
vector < vector < pair < int , int > > > g(1111111);
int ans , n,m,x,a[111111];
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
        int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include<bits/stdc++.h>
using namespace std;
vector < long long  > cost;
bool used[11111111];
vector < vector < pair < int , int > > > g(11111111);
int  n,m,x,a[11111111];
unsigned long long int ans;
void dfs(int v)
{

    used[v]=1;
    for(int i = 0 ; i <  g[v].size();++i)
    {
        int to=g[v][i].first;
        if(!used[to])
        {

            dfs(to);
        }
    }
}

main ()
{
    ios_base::sync_with_stdio(0);
    cin >>n >> m;
    for(int i = 1; i <= n; ++i)
    {
        int x;
        cin >> a[i];
    }
    for(int i= 0 ; i <m ;++i)
    {
         long long int q,w,e;
        cin >> q >> w;
        e=min(a[q],a[w]);
        a[q]=e;
        a[w]=e;
        g[q].push_back({w,e});
        g[w].push_back({q,e});
    }

    for(int i = 1 ; i<=n;++i)
    {

        if(!used[i])
        {
        dfs(i);
            ans+=a[i];
        }

    }
    cout<< ans;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
int cost[(int)1e5 + 1];
vector<int>adj[(int)1e5 + 1];
bitset<(1e5)1e5>vis(0);
int dfs(int cur, int parent) {
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent && !vis[i]){vis[i] = 1;ret = min(ret, dfs(i, cur));}
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {
			vis[node] = 1;
			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define 1e5 100000
#define int long long
using namespace std;
int cost[1e5 + 1];
vector<int>adj[1e5 + 1];
bool vis[1e5 + 1];
int dfs(int cur, int parent) {
	vis[cur] = 1;
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent)ret = min(ret, dfs(i, cur));
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {

			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
int cost[(int)1e5 + 1];
vector<int>adj[(int)1e5 + 1];
bitset<(int)1e5>vis(0);
int dfs(int cur, int parent) {
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent && !vis[i]){vis[i] = 1;ret = min(ret, dfs(i, cur));}
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {
			vis[node] = 1;
			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
vector<int>cost;
vector<vector<int>>adj;
vector<bool>vis;
int dfs(int cur, int parent) {
	vis[cur] = 1;
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent)ret = min(ret, dfs(i, cur));
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	cost.resize(n + 1);
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	adj.resize(n + 1);
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	vis.resize(n + 1);
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {

			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
int cost[(int)1e5 + 1];
vector<int>adj[(int)1e5 + 1];
bitset<1e5>vis(0);
int dfs(int cur, int parent) {
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent && !vis[i]){vis[i] = 1;ret = min(ret, dfs(i, cur));}
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {
			vis[node] = 1;
			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
int cost[(int)1e5 + 1];
vector<int>adj[(int)1e5 + 1];
bool vis[(int)1e5 + 1];
int dfs(int cur, int parent) {
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent){vis[i] = 1;ret = min(ret, dfs(i, cur));}
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {
			vis[node] = 1;
			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
int cost[(int)1e5 + 1];
vector<int>adj[(int)1e5 + 1];
bool vis[(int)1e5 + 1];
int dfs(int cur, int parent) {
	vis[cur] = 1;
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent)ret = min(ret, dfs(i, cur));
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {

			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include "bits/stdc++.h"
#define int long long
using namespace std;
int cost[1e5 + 1];
vector<int>adj[1e5 + 1];
bool vis[1e5 + 1];
int dfs(int cur, int parent) {
	vis[cur] = 1;
	int ret = cost[cur];
	for(int i : adj[cur]){
		if(i != parent)ret = min(ret, dfs(i, cur));
	}
	return ret;
}
int32_t main(){
	int n, m; cin >> n >> m;
	for(int i = 1 ; i <= n ; i++)cin >> cost[i];
	while(m--){
		int a,b;
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int res = 0;
	for (int node = 1 ; node <= n ; node++){
		if (!vis[node]) {

			res += dfs(node, -1);
		}
	}
	cout << res << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI     3.1415926535897932384626433832795
#define rep(i, a, b) \
for(int i = int(a); i < int(b); i++)
#define REP(i, p, b) \
for(int i = int(p); i <= int(b); i++)
bool visited[100000];
map<int,int>mp;
    vector<vector<int> >v;

int dfs(int s)
{
    visited[s]=1;
    int a=0,b=v[s].size(),t=INT_MAX,n=0,u=0;
    t=min(t,mp[s]);
    for(int i=0;i<v[s].size();i++)
    {
        if(visited[v[s][i]]==0)
        {
            t=min(t,mp[v[s][i]]);
            dfs(v[s][i]);
        }

    }
    return t;

}
int main()
{

    int n,m,a=0,b=0,x,y,p=1,cnt=0;
    cin>>n>>m;
    vector<vector<int> >v(n);
    b=n;
    rep(i,a,b)
    {
        cin>>x;
        mp[i]=x;
    }
    b=m;
    rep(i,a,b)
    {
        cin>>x>>y;
        v[x-1].push_back(y-1);
    }
    memset(visited,false,sizeof(visited));
    b=n;
    rep(i,a,b)
    {
        ll k=0;
        if(visited[i]==false)
        {
            k=dfs(i);
            cnt+=k;
        }
    }
    cout<<cnt;

    return 0;

}


 //#include <ext/pb_ds/assoc_container.hpp>
                                                //#include <ext/pb_ds/tree_policy.hpp>
                                                    #include <iostream>
                                                    #include <iomanip>
                                                    #include <sstream>
                                                    #include <cstring>
                                                    #include <vector>
                                                    #include <deque>
                                                    #include <queue>
                                                    #include <set>
                                                    #include <map>
                                                    #include <valarray>
                                                    #include <iterator>
                                                    #include <functional>
                                                    #include <limits>
                                                    #include <algorithm>
                                                    #include <numeric>
                                                    #include <cmath>
                                                    #include <cassert>
                                                    #include <unordered_map>
                                                    #include <unordered_set>
                                                    #include <stack>
                                                    using namespace std;
                                                    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
                                                    #define trace(x) cerr << #x << ": " << x << " " << endl;

                                                    typedef int64_t ll;

                                                    #define endl '\n'
                                                    #define int ll
                                                    ll mod=1e9+7;
                                                    ll mod1=1e9+6;

                                                    ll power(ll a,ll b)
                                                    {
                                                        if(b==0) return 1;
                                                        else if(b%2==0)
                                                            return power((((a%mod)*(a%mod))%mod),b/2)%mod;
                                                        else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
                                                    }

                                                //  using namespace __gnu_pbds;
                                                  //  #define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
                                                    //find_by_order(k)  returns iterator to kth element starting from 0;
                                                    //order_of_key(k) returns count of elements strictly smaller than k;
                                                    //erase,insert same as normal set

                                                int32_t main()
                                                {
                                                    IOS
                                                //     #ifndef ONLINE_JUDGE
                                                // freopen("input.txt", "r", stdin);
                                                //     #endif

                                                    int n,k;
                                                    cin>>n>>k;
                                                    set<pair<int,int>>s;
                                                    int prev=0;
                                                    map<pair<int,int>,int> m;
                                                    for(int i=1;i<=k;i++)
                                                    {
                                                        int c=0;
                                                        cout<<"? ";
                                                        for(int j=1;j<=n;++j)
                                                        {
                                                            if(c==k)
                                                                break;
                                                            if(j==i)
                                                                continue;
                                                            c++;
                                                            cout<<j<<" ";
                                                        }
                                                        cout<<endl<<flush;
                                                        int p,q;
                                                        cin>>p>>q;
                                                        m[{q,p}]++;

                                                        s.insert({q,p});

                                                    }
                                                    if(int(s.size())<k)
                                                    {

                                                        cout<<"? ";
                                                        for(int i=1;i<=k;++i)
                                                            cout<<i<<" ";
                                                        cout<<endl<<flush;
                                                        int p,q;
                                                        cin>>p>>q;
                                                        m[{q,p}]++;
                                                        int ans=0;
                                                        int x=0;
                                                        int in=0;

                                                        for(auto i:m)
                                                        {
                                                            ans=i.second;

                                                        }
                                                        if(in==1 and ans==k)
                                                        {
                                                            cout<<"! "<<1<<endl<<flush;
                                                            return 0;
                                                        }

                                                         cout<<"! "<<ans<<endl<<flush;
                                                        return 0;
                                                    }
                                                    int c=0;

                                                    vector<pair<int,int>> v;
                                                    for(auto i:s)
                                                    {
                                                        v.push_back({i.first,i.second});
                                                        c++;
                                                    }
                                                    sort(v.begin(),v.end());
                                                    cout<<"? ";
                                                    for(int i=0;i<k;++i)
                                                    {
                                                        cout<<v[i].second<<" ";
                                                    }
                                                    cout<<endl<<flush;
                                                    int p,q;
                                                    cin>>p>>q;
                                                    int ans=0;
                                                    for(int i=0;i<k;++i)
                                                    {
                                                        if(v[i].second==p and v[i].first==q)
                                                        {
                                                            ans=i;
                                                            break;
                                                        }
                                                    }
                                                    cout<<"! "<<ans+1<<endl;
                                                    cout<<flush;

                                                 }


 //#include <ext/pb_ds/assoc_container.hpp>
                                                //#include <ext/pb_ds/tree_policy.hpp>
                                                    #include <iostream>
                                                    #include <iomanip>
                                                    #include <sstream>
                                                    #include <cstring>
                                                    #include <vector>
                                                    #include <deque>
                                                    #include <queue>
                                                    #include <set>
                                                    #include <map>
                                                    #include <valarray>
                                                    #include <iterator>
                                                    #include <functional>
                                                    #include <limits>
                                                    #include <algorithm>
                                                    #include <numeric>
                                                    #include <cmath>
                                                    #include <cassert>
                                                    #include <unordered_map>
                                                    #include <unordered_set>
                                                    #include <stack>
                                                    using namespace std;
                                                    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
                                                    #define trace(x) cerr << #x << ": " << x << " " << endl;

                                                    typedef int64_t ll;

                                                    #define endl '\n'
                                                    #define int ll
                                                    ll mod=1e9+7;
                                                    ll mod1=1e9+6;

                                                    ll power(ll a,ll b)
                                                    {
                                                        if(b==0) return 1;
                                                        else if(b%2==0)
                                                            return power((((a%mod)*(a%mod))%mod),b/2)%mod;
                                                        else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
                                                    }

                                                //  using namespace __gnu_pbds;
                                                  //  #define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
                                                    //find_by_order(k)  returns iterator to kth element starting from 0;
                                                    //order_of_key(k) returns count of elements strictly smaller than k;
                                                    //erase,insert same as normal set

                                                int32_t main()
                                                {
                                                    IOS
                                                //     #ifndef ONLINE_JUDGE
                                                // freopen("input.txt", "r", stdin);
                                                //     #endif

                                                    int n,k;
                                                    cin>>n>>k;
                                                    set<pair<int,int>>s;
                                                    int prev=0;
                                                    map<pair<int,int>,int> m;
                                                    for(int i=1;i<=n-1;i++)
                                                    {
                                                        int c=0;
                                                        cout<<"? ";
                                                        for(int j=1;j<=n;++j)
                                                        {
                                                            if(c==k)
                                                                break;
                                                            if(j==i)
                                                                continue;
                                                            c++;
                                                            cout<<j<<" ";
                                                        }
                                                        cout<<endl<<flush;
                                                        int p,q;
                                                        cin>>p>>q;
                                                        m[{q,p}]++;

                                                        s.insert({q,p});

                                                    }
                                                    if(int(s.size())<k)
                                                    {

                                                        cout<<"? ";
                                                        for(int i=1;i<=k;++i)
                                                            cout<<i<<" ";
                                                        cout<<endl<<flush;
                                                        int p,q;
                                                        cin>>p>>q;
                                                        m[{q,p}]++;
                                                        int ans=0;
                                                        int x=0;
                                                        int in=0;

                                                        for(auto i:m)
                                                        {
                                                            x++;
                                                            if(ans<i.second)
                                                            {
                                                                ans=i.second;
                                                                in=x;
                                                            }

                                                        }
                                                        if(in==0 and ans==k)
                                                        {
                                                            cout<<"! "<<1<<endl<<flush;
                                                            return 0;
                                                        }

                                                         cout<<"! "<<ans<<endl<<flush;
                                                        return 0;
                                                    }
                                                    int c=0;

                                                    vector<pair<int,int>> v;
                                                    for(auto i:s)
                                                    {
                                                        v.push_back({i.first,i.second});
                                                        c++;
                                                    }
                                                    sort(v.begin(),v.end());
                                                    cout<<"? ";
                                                    for(int i=0;i<k;++i)
                                                    {
                                                        cout<<v[i].second<<" ";
                                                    }
                                                    cout<<endl<<flush;
                                                    int p,q;
                                                    cin>>p>>q;
                                                    int ans=0;
                                                    for(int i=0;i<k;++i)
                                                    {
                                                        if(v[i].second==p and v[i].first==q)
                                                        {
                                                            ans=i;
                                                            break;
                                                        }
                                                    }
                                                    cout<<"! "<<ans+1<<endl;
                                                    cout<<flush;

                                                 }


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	if (k == 1)
	{
		cout << "! 1" << endl;
		exit(0);
	}

	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < k + 1; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int j = k - 2; j >= 0; --j)
			if (q[j] + 1 < q[j + 1])
			{
				++q[j];
				break;
			}
	}

	int ans = (--mp.end())->y;
	cout << "! " << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k, mx = -1;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < k + 1; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		mx = max(mx, b);
		int j = k - 1;
		if (j >= 0)
		{
			++q[j];
			--j;
		}
	}

	cout << "! " << mp[mx] << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < n; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int j = k - 2; j >= 0; --j)
			if (q[j] + 1 < q[j + 1])
			{
				++q[j];
				break;
			}
	}

	int ans = (--mp.end())->y;
	cout << "! " << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < n; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int j = k - 2; j >= 0; --j)
			if (q[j] + 1 < q[j + 1])
			{
				++q[j];
				break;
			}
	}

	int ans = (--mp.end())->y;
	cout << "!" << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k, mx = -1;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	int j = k - 1;
	for (int i = 0; i < k + 1; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		mx = max(mx, b);
		if (j >= 0)
		{
			++q[j];
			--j;
		}
	}

	cout << "! " << mp[mx] << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < k + 1; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int j = k - 2; j >= 0; --j)
			if (q[j] + 1 < q[j + 1])
			{
				++q[j];
				break;
			}
	}

	int ans = (--mp.end())->y;
	if (k == 1) ans = 1;
	cout << "! " << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < n; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int i = k - 2; i >= 0; --i)
			if (q[i] + 1 < q[i + 1])
			{
				++q[i];
				break;
			}
	}

	int ans = (--mp.end())->y;
	cout << "!" << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	if (k == 1)
	{
		cout << "! 1";
		exit(0);
	}

	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < k + 1; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int j = k - 2; j >= 0; --j)
			if (q[j] + 1 < q[j + 1])
			{
				++q[j];
				break;
			}
	}

	int ans = (--mp.end())->y;
	cout << "! " << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

random_device rd;
mt19937 rnd(rd());
#define pt pair<int, int>
#define x first
#define y second
#define what_is(x) cerr << #x << " is " << x << endl;
#define ok cerr << "ok" << endl;
//#define endl '\n'
#define int long long
#define ld long double

signed main()
{
//	cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);

	int n, k;
	cin >> n >> k;
	vector<int> q;
	for (int i = 1; i <= k; ++i)
		q.push_back(i);

	map<int, int> mp;
	for (int i = 0; i < k + 1; ++i)
	{
		cout << "? ";
		for (auto j: q) cout << j << " ";
		cout << endl;
		int a, b;
		cin >> a >> b;
		++mp[b];
		if (q.back() != n)
		{
			++q.back();
			continue;
		}

		for (int j = k - 2; j >= 0; --j)
			if (q[j] + 1 < q[j + 1])
			{
				++q[j];
				break;
			}
	}

	int ans = (--mp.end())->y;
	cout << "! " << ans << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    while(cin>>n>>k)
    {
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cout.flush();
        cin>>x>>val;
        cout.flush();
        int flag=-1;
        int cnt=0;
        for(int i=1;i<=k;i++)
        {
                cout<<'?'<<' ';
                for(int j=1;j<=k;j++)
                {
                    if(j!=i)
                    {
                        cout<<j<<' ';
                    }
                }
                cout<<k+1<<endl;
                int _x,_val;
                cout.flush();
                cin>>_x>>_val;
                cout.flush();
                if(_val<val)
                {
                    if(flag==-1)
                    {
                        flag=0;
                        cnt++;
                    }
                    else
                    {
                        cnt++;
                    }
                }
                else if(_val>val)
                {
                    if(flag==-1)
                    {
                        flag=1;
                        cnt++;
                    }
                    else{
                        cnt++;
                    }
                }
        }
        if(flag==1)
        {
            cout<<'?'<<' '<<cnt<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
        cout.flush();
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    cin>>n>>k;
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<=k;i++){
            if(i!=x) {
                cout << '?' << ' ';
                for (int j = 1; j <= k; j++) {
                    if (j != i) {
                        cout << j << ' ';
                    }
                }
                cout << k + 1 << endl;
                int _x, _val;
                cin >> _x >> _val;
                if (_val < val) {
                    if (flag == -1) {
                        flag = 0;
                        cnt++;
                    } else {
                        cnt++;
                    }
                } else if (_val > val) {
                    if (flag == -1) {
                        flag = 1;
                        cnt++;
                    } else {
                        cnt++;
                    }
                }
            }
        }
        if(flag==1){
            cout<<'!'<<' '<<cnt+1<<endl;
        } else{
            cout<<'!'<<' '<<k-cnt<<endl;
        }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    cin>>n>>k;
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<=k;i++){
            if(i!=x) {
                cout << '?' << ' ';
                for (int j = 1; j <= k; j++) {
                    if (j != i) {
                        cout << j << ' ';
                    }
                }
                cout << k + 1 << endl;
                int _x, _val;
                cin >> _x >> _val;
                if (_val < val) {
                    if (flag == -1) {
                        flag = 0;
                        cnt++;
                    } else {
                        cnt++;
                    }
                } else if (_val > val) {
                    if (flag == -1) {
                        flag = 1;
                        cnt++;
                    } else {
                        cnt++;
                    }
                }
            }
        }
        if(flag==1){
            cout<<'?'<<' '<<cnt+1<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    while(cin>>n>>k)
    {
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cout.flush();
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<k;i++)
        {
            cout<<'?'<<' ';
            for(int j=1;j<k;j++)
            {
                if(j!=i)
                {
                    cout<<j<<' ';
                }
            }
            cout<<k+1<<endl;
            int _x,_val;
            cout.flush();
            cin>>_x>>_val;
            if(_val<val)
            {
                if(flag==-1)
                {
                    flag=1;
                    cnt++;
                }
                else
                {
                    cnt++;
                }
            }
            else if(_val>val)
            {
                if(flag==-1)
                {
                    flag=0;
                    cnt++;
                }
                else{
                    cnt++;
                }
            }
        }
        if(flag==1)
        {
            cout<<'?'<<' '<<cnt<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    while(cin>>n>>k)
    {
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<=k;i++){
            if(i!=x) {
                cout << '?' << ' ';
                for (int j = 1; j <= k; j++) {
                    if (j != i) {
                        cout << j << ' ';
                    }
                }
                cout << k + 1 << endl;
                int _x, _val;
                cin >> _x >> _val;
                if (_val < val) {
                    if (flag == -1) {
                        flag = 0;
                        cnt++;
                    } else {
                        cnt++;
                    }
                } else if (_val > val) {
                    if (flag == -1) {
                        flag = 1;
                        cnt++;
                    } else {
                        cnt++;
                    }
                }
            }
        }
        if(flag==1){
            cout<<'?'<<' '<<cnt+1<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    while(cin>>n>>k)
    {
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cout.flush();
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<k;i++)
        {
            cout<<'?'<<' ';
            for(int j=1;j<k;j++)
            {
                if(j!=i)
                {
                    cout<<j<<' ';
                }
            }
            cout<<k+1<<endl;
            int _x,_val;
            cin>>_x>>_val;
            if(_val<val)
            {
                if(flag==-1)
                {
                    flag=1;
                    cnt++;
                }
                else
                {
                    cnt++;
                }
            }
            else if(_val>val)
            {
                if(flag==-1)
                {
                    flag=0;
                    cnt++;
                }
                else{
                    cnt++;
                }
            }
        }
        if(flag==1)
        {
            cout<<'?'<<' '<<cnt<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    while(cin>>n>>k)
    {
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cout.flush();
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<k;i++)
        {
            cout<<'?'<<' ';
            for(int j=1;j<k;j++)
            {
                if(j!=i)
                {
                    cout<<j<<' ';
                }
            }
            cout<<k+1<<endl;
            int _x,_val;
            cout.flush();
            cin>>_x>>_val;

            if(_val<val)
            {
                if(flag==-1)
                {
                    flag=1;
                    cnt++;
                }
                else
                {
                    cnt++;
                }
            }
            else if(_val>val)
            {
                if(flag==-1)
                {
                    flag=0;
                    cnt++;
                }
                else{
                    cnt++;
                }
            }
        }
        if(flag==1)
        {
            cout<<'?'<<' '<<cnt<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    while(cin>>n>>k)
    {
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cout.flush();
        cin>>x>>val;
        cout.flush();
        int flag=-1;
        int cnt=0;
        for(int i=1;i<=k;i++){
            if(i!=x) {
                cout << '?' << ' ';
                for (int j = 1; j <= k; j++) {
                    if (j != i) {
                        cout << j << ' ';
                    }
                }
                cout << k + 1 << endl;
                int _x, _val;
                cout.flush();
                cin >> _x >> _val;
                cout.flush();
                if (_val < val) {
                    if (flag == -1) {
                        flag = 0;
                        cnt++;
                    } else {
                        cnt++;
                    }
                } else if (_val > val) {
                    if (flag == -1) {
                        flag = 1;
                        cnt++;
                    } else {
                        cnt++;
                    }
                }
            }
        }
        if(flag==1){
            cout<<'?'<<' '<<cnt+1<<endl;
        } else{
            cout<<'?'<<' '<<k-cnt<<endl;
        }
        cout.flush();
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main() {
    int n,k;
    cin>>n>>k;
        cout<<'?'<<' ';
        for(int i=1;i<=k;i++)
        {
            cout<<i<<' ';
        }
        cout<<endl;
        int x,val;
        cin>>x>>val;
        int flag=-1;
        int cnt=0;
        for(int i=1;i<=k;i++){
            if(i!=x) {
                cout << '?' << ' ';
                for (int j = 1; j <= k; j++) {
                    if (j != i) {
                        cout << j << ' ';
                    }
                }
                cout << k + 1 << endl;
                int _x, _val;
                cin >> _x >> _val;
                if (_val < val) {
                    if (flag == -1) {
                        flag = 0;
                        cnt++;
                    } else {
                        cnt++;
                    }
                } else if (_val > val) {
                    if (flag == -1) {
                        flag = 1;
                        cnt++;
                    } else {
                        cnt++;
                    }
                }
            }
        }
        if(flag==-1){
            cout<<'?'<<' ';
            for(int i=1;i<=k;i++){
                if(i!=x){
                    cout<<i<<' ';
                }
            }
            cout<<k+1<<endl;
            int _x,_val;
            cin>>_x>>_val;
            if(val>_val){
                flag=0;
            } else{
                flag=1;
            }
        }
        if(flag==1){
            cout<<'!'<<' '<<cnt+1<<endl;
        } else{
            cout<<'!'<<' '<<k-cnt<<endl;
        }
    return 0;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "? ";
  for (int i : v) cout << i + 1 << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  assert(a != -1);
  return b;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 0; i < K + 1; ++i) {
    vector<int> v;
    for (int j = 0; j < K + 1; ++j)
      if (i != j) v.push_back(j);
    int m = ask(v);
    f.push_back(m);
  }
  sort(f.begin(), f.end());
  int m = 0, cmp = f[0];
  assert(f.front() != f.back());
  for (int i = (int)f.size() - 1; i >= 0; --i) {
    if (cmp > f[i]) ++m;
  }
  cout << "! " << m + 1 << endl;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "? ";
  for (int i : v) cout << i + 1 << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  assert(a != -1);
  return b;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 0; i < K + 1; ++i) {
    vector<int> v;
    for (int j = 0; j < K + 1; ++j)
      if (i != j) v.push_back(j);
    int m = ask(v);
    f.push_back(m);
  }
  sort(f.begin(), f.end());
  int m = 0, cmp = f[0];
  assert(f.front() != f.back());
  for (int i = (int)f.size() - 1; i >= 0; --i) {
    if (cmp > f[i]) ++m;
  }
  cout << "! " << m << endl;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "? ";
  for (int i : v) cout << i + 1 << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  assert(a != -1);
  return b;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 0; i < K; ++i) {
    vector<int> v;
    for (int j = 0; j < K + 1; ++j) {
      if (i != j) v.push_back(j);
      int m = ask(v);
      f.push_back(m);
    }
  }
  sort(f.begin(), f.end());
  int m = 0, cmp = f[0];
  assert(f.front() != f.back());
  for (int i = (int)f.size() - 1; i >= 0; --i) {
    if (cmp > f[i]) ++m;
  }
  cout << m << endl;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "? ";
  for (int i : v) cout << i + 1 << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  assert(a != -1);
  return b;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 0; i < K; ++i) {
    vector<int> v;
    for (int j = 0; j < K + 1; ++j)
      if (i != j) v.push_back(j);
    int m = ask(v);
    f.push_back(m);
  }
  sort(f.begin(), f.end());
  int m = 0, cmp = f[0];
  assert(f.front() != f.back());
  for (int i = (int)f.size() - 1; i >= 0; --i) {
    if (cmp > f[i]) ++m;
  }
  cout << m << endl;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "?";
  for (int i : v) cout << ' ' << i;
  cout << endl;
  int pos, a;
  cin >> pos >> a;
  return a;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 1; i <= K + 1; ++i) {
    vector<int> v;
    for (int j = 1; j <= K + 1; ++j)
      if (i != j) v.push_back(j);
    int w = ask(v);
    f.push_back(w);
  }
  sort(f.begin(), f.end());
  assert(f.front() != f.back());
  int m = 0;
  for (int i = (int)f.size() - 1; i >= 0; --i)
    if (f[i] == f.back()) ++m;
  cout << "! " << m << endl;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "?";
  for (int i : v) cout << ' ' << i;
  cout << endl;
  int pos, a;
  cin >> pos >> a;
  return a;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 1; i <= K + 1; ++i) {
    vector<int> v;
    for (int j = 1; j <= K + 1; ++j)
      if (i != j) v.push_back(j);
    int w = ask(v);
    f.push_back(w);
  }
  sort(f.begin(), f.end());
  assert(f.front() != f.back());
  int ans = 0;
  for (int i = (int)f.size() - 1; i >= 0; --i)
    if (f[i] == f.back()) ++m;
  cout << "! " << m << endl;
}


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

template <class T>
bool uin(T& a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T& a, T b) { return a < b ? (a = b, true) : false; }

int ask(vector<int>& v) {
  cout << "? ";
  for (int i : v) cout << i + 1 << ' ';
  cout << endl;
  int a, b;
  cin >> a >> b;
  assert(a != -1);
  return b;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int N, K;
  cin >> N >> K;
  vector<int> f;
  for (int i = 0; i < K + 1; ++i) {
    vector<int> v;
    for (int j = 0; j < K + 1; ++j)
      if (i != j) v.push_back(j);
    int m = ask(v);
    f.push_back(m);
  }
  sort(f.begin(), f.end());
  int m = 0, cmp = f[0];
  assert(f.front() != f.back());
  for (int i = (int)f.size() - 1; i >= 0; --i) {
    if (cmp > f[i]) ++m;
  }
  cout << m << endl;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[510]= {-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        vector<int> v;
        int abc=0;
        for(int i=1; i<=k; i++)
        {
            v.pb(i);
        }
        int y=k;
        vector<int> vmx;
        int mn=10000000000,mni=0;
        int mx=0;
        for(int i=0; i<2; i++)
        {
            abc++;
            cout<<"? ";
            for(int j=0; j<k; j++)
            {
                cout<<v[j]<<" ";
            }
            cout<<endl;
            int x;
            cin>>x;
            int z;
            cin>>z;
            if(z>mx)
            {
                vmx.cl;
                for(int j=0; j<k; j++)
                    vmx.pb(v[j]);
                mx=z;
            }
            if(z<mn)
            {
                mn=z;
                mni=x-1;
            }
            y++;
            for(int j=0; j<k; j++)
            {
                if(v[j]==x)
                {
                    v[j]=y;
                    break;
                }
            }
            arr[x-1]=z;
        }
        int ans=0;
        for(int i=0; i<k; i++)
        {
            if(mx==arr[vmx[i]-1]){
                continue;
            }
            int zz=vmx[i];
            vmx[i]=mni+1;
            cout<<"? ";
            for(int j=0; j<k; j++)
                cout<<vmx[j]<<" ";
            cout<<endl;
            int a,b;
            cin>>a>>b;
            if(b!=mx)
            {
                ans++;
            }
            vmx[i]=zz;
        }
        cout<<"! "<<k-ans<<endl;
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[510]= {-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        vector<int> v;
        int abc=0;
        for(int i=1; i<=k; i++)
        {
            v.pb(i);
        }
        int y=k;
        vector<int> vmx;
        int mn=INT_MAX,mni=0;
        int mx=0;
        for(int i=0; i<2; i++)
        {
            abc++;
            cout<<"? ";
            for(int i=0; i<k; i++)
            {
                cout<<v[i]<<" ";
            }
            cout<<endl;
            int x;
            cin>>x;
            int z;
            cin>>z;
            if(z>mx)
            {
                vmx.cl;
                for(int i=0; i<k; i++)
                    vmx.pb(v[i]);
                mx=z;
            }
            if(z<mn)
            {
                mn=z;
                mni=x-1;
            }
            y++;
            for(int i=0; i<k; i++)
            {
                if(v[i]==x)
                {
                    v[i]=y;

                    break;
                }
            }
            arr[x-1]=z;

        }
        int ans=0;
        for(int i=0; i<k; i++)
        {
            if(mx==arr[vmx[i]-1]){
                continue;
            }
            abc++;
            if(abc>n){
                while(1);
            }
            int zz=vmx[i];
            vmx[i]=mni+1;
            cout<<"? ";
            for(int i=0; i<k; i++)
                cout<<vmx[i]<<" ";
            cout<<endl;
            int a,b;
            cin>>a>>b;
            if(b!=mx)
            {
                ans++;
            }
            vmx[i]=zz;
        }
        cout<<"! "<<k-ans<<endl;
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[510]={-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        if(n-(k-1)>k-1&&0){
            vector<int> v;
            for(int i=1;i<=k;i++){
                v.pb(i);
            }
            int y=k;
            for(int i=0;i<n-(k-1);i++){
                cout<<"? ";
                for(int i=0;i<k;i++){
                    cout<<v[i]<<" ";
                }
                cout<<endl;
                int x;
                cin>>x;
                int z;
                cin>>z;
                y++;
                for(int i=0;i<k;i++){
                    if(v[i]==x){
                        v[i]=y;

                        break;
                    }
                }
                arr[x-1]=z;

            }
            for(int i=0;i<n;i++)
                cout<<arr[i]<<" ";
            cout<<endl;
            vector<pair<int,int>> vec;
            int x=0;
            for(int i=0;i<n&&x<k;i++){
                if(arr[i]>=0){
                    x++;
                    vec.pb({arr[i],i+1});
                }
            }
            sort(vec.begin(),vec.end());
            cout<<"? ";
            for(int i=0;i<k;i++){
                cout<<vec[i].s<<" ";
            }
            cout<<endl;
            cin>>x>>y;
            for(int i=0;i<k;i++){
                if(vec[i].f==y){
                    cout<<"! "<<i+1<<endl;
                    RETURN;
                }
            }
        }
        else{
            vector<int> v;
            for(int i=1;i<=k;i++){
                v.pb(i);
            }
            int y=k;
            vector<int> vmx;
            int mn=INT_MAX,mni=0;
            int mx=0;
            for(int i=0;i<n-(k-1);i++){
                cout<<"? ";
                for(int i=0;i<k;i++){
                    cout<<v[i]<<" ";
                }
                cout<<endl;
                int x;
                cin>>x;
                int z;
                cin>>z;
                if(z>mx){
                    vmx.cl;
                    for(int i=0;i<k;i++)
                        vmx.pb(v[i]);
                    mx=z;
                }
                if(z<mn){
                    mn=z;
                    mni=x-1;
                }
                y++;
                for(int i=0;i<k;i++){
                    if(v[i]==x){
                        v[i]=y;

                        break;
                    }
                }
                arr[x-1]=z;

            }
            int ans=0;
            for(int i=0;i<k;i++){
                if(mx==arr[vmx[i]-1])
                    continue;
                int zz=vmx[i];
                vmx[i]=mni+1;
                cout<<"? ";
                for(int i=0;i<k;i++)
                    cout<<vmx[i]<<" ";
                cout<<endl;
                int a,b;
                cin>>a>>b;
                if(b!=mx){
                    ans++;
                }
                vmx[i]=zz;
            }
            cout<<"! "<<k-ans<<endl;
        }
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[510]= {-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        vector<int> v;
        int abc=0;
        for(int i=1; i<=k; i++)
        {
            v.pb(i);
        }
        int y=k;
        vector<int> vmx;
        int mn=INT_MAX,mni=0;
        int mx=0;
        for(int i=0; i<2; i++)
        {
            abc++;
            cout<<"? ";
            for(int j=0; j<k; j++)
            {
                cout<<v[j]<<" ";
            }
            cout<<endl;
            int x;
            cin>>x;
            int z;
            cin>>z;
            if(z>mx)
            {
                vmx.cl;
                for(int j=0; j<k; j++)
                    vmx.pb(v[j]);
                mx=z;
            }
            if(z<mn)
            {
                mn=z;
                mni=x-1;
            }
            y++;
            for(int j=0; j<k; j++)
            {
                if(v[j]==x)
                {
                    v[j]=y;
                    break;
                }
            }
            arr[x-1]=z;
        }
        int ans=0;
        for(int i=0; i<k; i++)
        {
            if(mx==arr[vmx[i]-1]){
                continue;
            }
            int zz=vmx[i];
            vmx[i]=mni+1;
            cout<<"? ";
            for(int j=0; j<k; j++)
                cout<<vmx[j]<<" ";
            cout<<endl;
            int a,b;
            cin>>a>>b;
            if(b!=mx)
            {
                ans++;
            }
            vmx[i]=zz;
        }
        cout<<"! "<<k-ans<<endl;
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[500010]= {-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        vector<int> v;
        int abc=0;
        for(int i=1; i<=k; i++)
        {
            v.pb(i);
        }
        int y=k;
        vector<int> vmx;
        int mn=10000000000,mni=0;
        int mx=0;
        for(int i=0; i<n-(k-1); i++)
        {
            abc++;
            cout<<"? ";
            for(int j=0; j<k; j++)
            {
                cout<<v[j]<<" ";
            }
            cout<<endl;
            int x;
            cin>>x;
            int z;
            cin>>z;
            if(z>mx)
            {
                vmx.cl;
                for(int j=0; j<k; j++)
                    vmx.pb(v[j]);
                mx=z;
            }
            if(z<mn)
            {
                mn=z;
                mni=x-1;
            }
            y++;
            for(int j=0; j<k; j++)
            {
                if(v[j]==x)
                {
                    v[j]=y;
                    break;
                }
            }
            arr[x-1]=z;
        }
        for(int i=0;i<k;i++){
            if(mni==vmx[i]-1)
                vmx[i]=n;
        }
        int ans=0;
        for(int i=0; i<k; i++)
        {
            if(mx==arr[vmx[i]-1]){
                continue;
            }
            int zz=vmx[i];
            vmx[i]=mni+1;
            cout<<"? ";
            for(int j=0; j<k; j++)
                cout<<vmx[j]<<" ";
            cout<<endl;
            int a,b;
            cin>>a>>b;
            if(b!=mx)
            {
                ans++;
            }
            vmx[i]=zz;
        }
        cout<<"! "<<k-ans<<endl;
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[510]= {-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        vector<int> v;
        for(int i=1; i<=k; i++)
        {
            v.pb(i);
        }
        int y=k;
        vector<int> vmx;
        int mn=INT_MAX,mni=0;
        int mx=0;
        for(int i=0; i<2; i++)
        {
            cout<<"? ";
            for(int i=0; i<k; i++)
            {
                cout<<v[i]<<" ";
            }
            cout<<endl;
            int x;
            cin>>x;
            int z;
            cin>>z;
            if(z>mx)
            {
                vmx.cl;
                for(int i=0; i<k; i++)
                    vmx.pb(v[i]);
                mx=z;
            }
            if(z<mn)
            {
                mn=z;
                mni=x-1;
            }
            y++;
            for(int i=0; i<k; i++)
            {
                if(v[i]==x)
                {
                    v[i]=y;

                    break;
                }
            }
            arr[x-1]=z;

        }
        int ans=0;
        for(int i=0; i<k; i++)
        {
            if(mx==arr[vmx[i]-1]){
                continue;
            }
            int zz=vmx[i];
            vmx[i]=mni+1;
            cout<<"? ";
            for(int i=0; i<k; i++)
                cout<<vmx[i]<<" ";
            cout<<endl;
            int a,b;
            cin>>a>>b;
            if(b!=mx)
            {
                ans++;
            }
            vmx[i]=zz;
        }
        cout<<"! "<<k-ans<<endl;
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}


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

typedef int in;
#define int long long
#define f first
#define s second
#define ins insert
#define pb push_back
#define cl clear()
#define RETURN exit(0)
#define top front
#ifndef ONLINE_JUDGE
#define debug(x) cout<<x<<endl;
#else
#define debug(x) 42
#endif

int arr[500010]= {-1};

in main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int tc=1;
    //scanf("%lld",&tc);
    while(tc--)
    {
        memset(arr,-1,sizeof arr);
        int n,k;
        cin>>n>>k;
        vector<int> v;
        int abc=0;
        for(int i=1; i<=k; i++)
        {
            v.pb(i);
        }
        int y=k;
        vector<int> vmx;
        int mn=10000000000,mni=0;
        int mx=0;
        for(int i=0; i<2; i++)
        {
            abc++;
            cout<<"? ";
            for(int j=0; j<k; j++)
            {
                cout<<v[j]<<" ";
            }
            cout<<endl;
            int x;
            cin>>x;
            int z;
            cin>>z;
            if(z>mx)
            {
                vmx.cl;
                for(int j=0; j<k; j++)
                    vmx.pb(v[j]);
                mx=z;
            }
            if(z<mn)
            {
                mn=z;
                mni=x-1;
            }
            y++;
            for(int j=0; j<k; j++)
            {
                if(v[j]==x)
                {
                    v[j]=y;
                    break;
                }
            }
            arr[x-1]=z;
        }
        int ans=0;
        for(int i=0; i<k; i++)
        {
            if(mx==arr[vmx[i]-1]){
                continue;
            }
            int zz=vmx[i];
            vmx[i]=mni+1;
            cout<<"? ";
            for(int j=0; j<k; j++)
                cout<<vmx[j]<<" ";
            cout<<endl;
            int a,b;
            cin>>a>>b;
            if(b!=mx)
            {
                ans++;
            }
            vmx[i]=zz;
        }
        cout<<"! "<<k-ans<<endl;
    }
    ///matensa4 tegarab el sample w te7ot el freopen w te3mel SCANF
    RETURN;
}