import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Interact {
    private static final String FILE_NAME = "ransom";

    final static boolean DEBUG = false;

    final BufferedReader stdin;
    final Scanner fin;
    final PrintWriter fout;

    int n, k;
    ArrayList<Integer> exactAns = new ArrayList<>();

    Interact(String inputFileName, String outputFileName) throws IOException {
	stdin = new BufferedReader(new InputStreamReader(System.in));
	fin = new Scanner(new FileReader(inputFileName));
	fout = new PrintWriter(new FileWriter(outputFileName), true);
    }

    void close() {
	fin.close();
	fout.close();
    }

    static class PresentationException extends Exception {
	PresentationException(String message) {
	    super(message);
	}
    }

    void go() {
	try {
	    fout.println(interact());
	} catch (PresentationException e) {
	    fout.println("PE " + e.getMessage());
	} catch (IOException e) {
	    fout.println("FAIL " + e.getMessage());
	}
    }

    String compareAns(ArrayList<Integer> ans) {
	for (int i = 0; i < n; i++) {
	    if (!ans.get(i).equals(exactAns.get(i)))
		return "WA different number at position: " + (i + 1);
	}
	return "OK";
    }

    String calc(AskQuery qu) {
	BigInteger ans = BigInteger.ONE;
	for (int i : qu.index) {
	    ans = ans.multiply(BigInteger.valueOf(exactAns.get(i)));
	}
	return ans.toString();
    }

    String interact() throws IOException, PresentationException {
	n = fin.nextInt();
	k = fin.nextInt();
	for (int i = 0; i < n; i++)
	    exactAns.add(fin.nextInt());

	writeLine(n + " " + k);
	int maxQuary = n;
	for (int queries = 0; queries < maxQuary + 1; queries++) {
	    Query qu = readRequest();
	    if (qu instanceof AskQuery) {
		writeLine(calc((AskQuery) qu));
	    } else {
		String ans = compareAns(((AnswerQuery) qu).ans);
		if (ans.equals("OK"))
		    ans += " " + queries + " steps";
		return ans;
	    }
	}
	return "WA queries limit reached";
    }

    static class Query {
    }

    static class AskQuery extends Query {
	HashSet<Integer> index;

	public AskQuery(HashSet<Integer> index) {
	    super();
	    this.index = index;
	}
    }

    static class AnswerQuery extends Query {
	ArrayList<Integer> ans;

	public AnswerQuery(ArrayList<Integer> ans) {
	    super();
	    this.ans = ans;
	}
    }

    private Query readRequest() throws PresentationException, IOException {
	String line = readLine().toLowerCase();
	String[] tokens = line.trim().split("\\s+");
	try {
	    if (tokens.length == k && !tokens[0].equals("answer:")) {
		HashSet<Integer> hs = new HashSet<>();
		for (int i = 0; i < k; i++) {
		    int t = Integer.parseInt(tokens[i]);
		    if (t < 1 || t > n)
			throw new PresentationException("incorrect index");
		    if (hs.contains(t - 1))
			throw new PresentationException("index dublicate");
		    hs.add(t - 1);
		}
		return new AskQuery(hs);
	    } else if (tokens[0].equals("answer:") && tokens.length == n + 1) {
		ArrayList<Integer> ans = new ArrayList<>();
		for (int i = 1; i < n + 1; i++)
		    ans.add(Integer.parseInt(tokens[i]));
		return new AnswerQuery(ans);
	    } else {
		throw new PresentationException("incorrect query");
	    }
	} catch (Exception e) {
	    throw new PresentationException("incorrect query");
	}
    }

    private String readLine() throws PresentationException, IOException {
	String s = stdin.readLine();
	if (s == null) {
	    throw new PresentationException("terminated too early");
	}
	if (DEBUG) {
	    fout.print("INP ");
	    fout.println(s);
	}
	return s;
    }

    private void writeLine(String... s) {
	if (DEBUG) {
	    fout.print("OUT ");
	    for (int i = 0; i < s.length; i++)
		fout.println(s[i]);
	    fout.flush();
	}
	for (int i = 0; i < s.length; i++)
	    System.out.println(s[i]);
	System.out.flush();
    }

    public static void main(String[] args) throws IOException {
	Locale.setDefault(Locale.US);
	Interact instance = new Interact(args.length >= 2 ? args[0] : FILE_NAME
		+ ".in", args.length >= 2 ? args[1] : FILE_NAME + ".out");
	instance.go();
	instance.close();
    }
}
