This is an interactive problem.

John and his imaginary friend play a game. There are n lamps arranged in a circle. Lamps are numbered 1 through n in clockwise order, that is, lamps i and i + 1 are adjacent for any i = 1, …, n - 1, and also lamps n and 1 are adjacent. Initially all lamps are turned off.

John and his friend take turns, with John moving first. On his turn John can choose to terminate the game, or to make a move. To make a move, John can choose any positive number k and turn any k lamps of his choosing on. In response to this move, John's friend will choose k consecutive lamps and turn all of them off (the lamps in the range that were off before this move stay off). Note that the value of k is the same as John's number on his last move. For example, if n = 5 and John have just turned three lamps on, John's friend may choose to turn off lamps 1, 2, 3, or 2, 3, 4, or 3, 4, 5, or 4, 5, 1, or 5, 1, 2.

After this, John may choose to terminate or move again, and so on. However, John can not make more than 10^4 moves.

John wants to maximize the number of lamps turned on at the end of the game, while his friend wants to minimize this number. Your task is to provide a strategy for John to achieve optimal result. Your program will play interactively for John against the jury's interactor program playing for John's friend.

Suppose there are n lamps in the game. Let R(n) be the number of turned on lamps at the end of the game if both players act optimally. Your program has to terminate the game with at least R(n) turned on lamps within 10^4 moves. Refer to Interaction section below for interaction details.

For technical reasons hacks for this problem are disabled.

Interaction

Initially your program will be fed a single integer n (1 ≤ n ≤ 1000) — the number of lamps in the game. Then the interactor will wait for your actions.

To make a move, print a line starting with an integer k (1 ≤ k ≤ n), followed by k distinct integers l_1, …, l_k (1 ≤ l_i ≤ n) — indices of lamps you want to turn on. The indices may be printed in any order. It is allowed to try to turn on a lamp that is already on (although this will have no effect).

If your move was invalid for any reason, or if you have made more than 10^4 moves, the interactor will reply with a line containing a single integer -1. Otherwise, the reply will be a line containing a single integer x (1 ≤ x ≤ n), meaning that the response was to turn off k consecutive lamps starting from x in clockwise order.

To terminate the game instead of making a move, print a line containing a single integer 0. The test will be passed if at this point there are at least R(n) lamps turned on (note that neither R(n), nor the verdict received are not communicated to your program in any way). This action does not count towards the number of moves (that is, it is legal to terminate the game after exactly 10^4 moves).

To receive the correct verdict, your program should terminate immediately after printing 0, or after receiving -1 as a response.

Don't forget to flush your output after every action.

Examples

Input


3


Output



0


Input


4

1

Output



2 1 3

0

Note

When n = 3, any John's move can be reversed, thus R(3) = 0, and terminating the game immediately is correct.

R(4) = 1, and one strategy to achieve this result is shown in the second sample case.

Blank lines in sample interactions are for clarity and should not be printed.
#include <bits/stdc++.h>
using ll = long long int;
using ull = unsigned long long int;
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using pi = std::pair<int, int>;
using vpi = std::vector<pi>;
using vvpi = std::vector<vpi>;
using pll = std::pair<ll, ll>;
using vpll = std::vector<pll>;
using vvpll = std::vector<vpll>;
template <typename T>
void mk_unique(std::vector<T>& l) {
  if (!std::is_sorted((l).begin(), (l).end()))
    std::sort((l).begin(), (l).end());
  auto it = std::unique(l.begin(), l.end());
  auto d = std::distance(l.begin(), it);
  l.resize(d);
}
template <typename T>
T& smax(T& l, const T& r) {
  if (l < r) l = r;
  return l;
}
template <typename T>
T& smin(T& l, const T& r) {
  if (r < l) l = r;
  return l;
}
constexpr int MOD = 998244353;
namespace io {
class input_reader {
  void throw_error() {
    throw std::runtime_error("No more inputs while reading number");
  }
  template <typename T>
  inline void readIntegerValue(T& f) {
    bool positive = true;
    f = 0;
    char c;
    if (!in.get(c)) throw_error();
    while (c < '0' || c > '9') {
      if (c == '-') positive = false;
      if (!in.get(c)) throw_error();
    }
    while (c >= '0' && c <= '9') {
      f = (f << 3) + (f << 1) + (c & 15);
      if (!in.get(c)) break;
    }
    if (!positive) f *= -1;
  }

 public:
  std::istream& in;
  explicit input_reader(std::istream& in) : in(in) {}
  inline void read(int& f) { readIntegerValue(f); }
  inline void read(short& f) { readIntegerValue(f); }
  inline void read(long int& f) { readIntegerValue(f); }
  inline void read(long long int& f) { readIntegerValue(f); }
  inline void read(unsigned int& f) { readIntegerValue(f); }
  inline void read(unsigned short& f) { readIntegerValue(f); }
  inline void read(unsigned long int& f) { readIntegerValue(f); }
  inline void read(unsigned long long int& f) { readIntegerValue(f); }
  template <typename T>
  inline void read(std::vector<T>& f) {
    for (auto& i : f) read(i);
  }
  template <typename T, int N>
  inline void read(std::array<T, N>& res) {
    for (auto& i : res) read(i);
  }
  template <typename T1, typename T2>
  inline void read(std::pair<T1, T2>& p) {
    read(p.first, p.second);
  }
  template <typename T>
  inline void read(T& f) {
    in >> f;
  }
  template <typename T, typename... Args>
  inline void read(T& t, Args&... args) {
    read(t), read(args...);
  }
  template <typename T>
  inline void readArray(int n, T* res) {
    while (n--) read(*(res++));
  }
  template <typename T>
  inline input_reader& operator>>(T& t) {
    return read(t), *this;
  }
};
}  // namespace io
namespace io {
class output_writer {
  std::ostream& out;
  template <typename T>
  inline void printIntegerHelper(T x) {
    if (x >= 10) printIntegerHelper(x / 10);
    out.put(x % 10 + 48);
  }
  template <typename T>
  inline void printInteger(T x) {
    if (x < 0) out.put('-'), x = -x;
    printIntegerHelper(x);
  }
  template <typename T>
  inline void printArray(T& ar) {
    bool first = true;
    for (auto& t : ar) print((first) ? first = false, "" : " ", t);
  }

 public:
  explicit output_writer(std::ostream& out) : out(out) {}
  inline void flush() { out.flush(); }
  inline void print() {}
  inline void print(char x) { out.put(x); }
  inline void print(short x) { printInteger(x); }
  inline void print(int x) { printInteger(x); }
  inline void print(long int x) { printInteger(x); }
  inline void print(long long int x) { printInteger(x); }
  inline void print(unsigned short x) { printInteger(x); }
  inline void print(unsigned int x) { printInteger(x); }
  inline void print(unsigned long int x) { printInteger(x); }
  inline void print(unsigned long long int x) { printInteger(x); }
  template <typename T1>
  inline void print(const T1& t1) {
    out << t1;
  }
  template <typename T1, typename T2>
  inline void print(const std::pair<T1, T2>& t1) {
    println(t1.first, ' ', t1.second);
  }
  template <typename T1>
  inline void print(const std::vector<T1>& t1) {
    printArray(t1);
  }
  template <typename T1, int N>
  inline void print(const std::array<T1, N>& t1) {
    printArray(t1);
  }
  template <typename T1, int N, int M>
  inline void print(const std::array<std::array<T1, M>, N>& t1) {
    for (auto& t : t1) println(t);
  }
  template <typename T1>
  inline void print(const std::vector<std::vector<T1>>& t1) {
    bool first = true;
    for (auto& t : t1) print((first) ? first = false, "" : "\n", t);
  }
  template <typename T, typename... Args>
  inline void print(const T& t, Args... args) {
    print(t), print(args...);
  }
  template <typename... Args>
  inline void println(Args... args) {
    print(args...), print('\n');
  }
  template <typename T>
  output_writer& operator<<(const T& t) {
    return print(t), *this;
  }
};
}  // namespace io
inline ll pow_mod(ll a, ll b, const ll MOD) {
  ll res = 1;
  for (ll i = 1; b; b ^= b & i, i <<= 1, a = (a * a) % MOD)
    if (b & i) res = (res * a) % MOD;
  return res;
}
inline ll mod_inv(const ll a, const ll MOD) { return pow_mod(a, MOD - 2, MOD); }
template <typename T>
inline T gcd(T a, T b) {
  T t;
  while (a != 0) t = a, a = b % a, b = t;
  return b;
}
template <typename T>
T lcm(const T& a, const T& b) {
  assert(a != 0 && b != 0);
  return a / gcd(a, b) * b;
}
namespace math {
template <class T>
int gMOD(T v) {
  int res = (int)(v % MOD);
  if (res >= 0) return res;
  return res + MOD;
};
class mod_int {
  using mi = mod_int;
  int v;

 public:
  mod_int(int v) : v(gMOD(v)) {}
  mod_int(unsigned int v) : v(gMOD(v)) {}
  mod_int(long long int v) : v(gMOD(v)) {}
  mod_int(unsigned long long int v) : v(gMOD(v)) {}
  mod_int(long int v) : v(gMOD(v)) {}
  mod_int(unsigned long int v) : v(gMOD(v)) {}
  mod_int() = default;
  mod_int(const mi& o) = default;
  mod_int(mi&& o) = default;
  inline mi& operator=(const mi& o) = default;
  inline mi& operator=(mi&& o) = default;
  inline mi& operator++() {
    if (v == MOD - 1)
      v = 0;
    else
      v++;
    return *this;
  }
  inline mi& operator--() {
    if (v == 0)
      v = MOD - 1;
    else
      v--;
    return *this;
  }
  inline mi operator++(int) {
    mi t = *this;
    ++(*this);
    return t;
  }
  inline mi operator--(int) {
    mi t = *this;
    --(*this);
    return t;
  }
  inline bool friend operator==(const mi& lhs, const mi& rhs) {
    return lhs.v == rhs.v;
  }
  inline bool friend operator!=(const mi& lhs, const mi& rhs) {
    return lhs.v != rhs.v;
  }
  template <typename T>
  inline bool friend operator==(const mi& lhs, const T& rhs) {
    return lhs == mi(rhs);
  }
  template <typename T>
  inline bool friend operator!=(const mi& lhs, const T& rhs) {
    return lhs != mi(rhs);
  }
  inline mi friend operator-(const mi& lhs, const mi& rhs) {
    mi res;
    res.v = lhs.v - rhs.v;
    if (res.v < 0) res.v += MOD;
    return res;
  }
  inline mi friend operator+(const mi& lhs, const mi& rhs) {
    mi res;
    res.v = lhs.v + rhs.v - MOD;
    if (res.v < 0) res.v += MOD;
    return res;
  }
  inline mi friend operator*(const mi& lhs, const mi& rhs) {
    return {((((long long int)lhs.v) * rhs.v))};
  }
  inline mi friend operator/(const mi& lhs, const mi& rhs) {
    return lhs * rhs.inv();
  }
  template <typename T>
  inline mi friend operator-(const mi& lhs, const T& rhs) {
    return lhs - mi(rhs);
  }
  template <typename T>
  inline mi friend operator+(const mi& lhs, const T& rhs) {
    return lhs + mi(rhs);
  }
  template <typename T>
  inline mi friend operator*(const mi& lhs, const T& rhs) {
    return lhs * mi(rhs);
  }
  template <typename T>
  inline mi friend operator/(const mi& lhs, const T& rhs) {
    return lhs / mi(rhs);
  }
  template <typename T>
  inline mi& operator-=(const T& rhs) {
    return *this = *this - rhs;
  }
  template <typename T>
  inline mi& operator+=(const T& rhs) {
    return *this = *this + rhs;
  }
  template <typename T>
  inline mi& operator*=(const T& rhs) {
    return *this = *this * rhs;
  }
  template <typename T>
  inline mi& operator/=(const T& rhs) {
    return *this = *this / rhs;
  }
  inline mi inv() const { return pow(MOD - 2); }
  inline mi pow(long long int pw) const {
    mi res = 1, val = *this;
    while (pw) {
      if (pw & 1) res *= val;
      val *= val;
      pw >>= 1;
    }
    return res;
  }
  inline operator int() const { return v; }
  inline friend std::istream& operator>>(std::istream& in, mi& rhs) {
    long long int v;
    in >> v;
    rhs = {v};
    return in;
  }
  inline friend std::ostream& operator<<(std::ostream& out, mi& rhs) {
    out << rhs.v;
    return out;
  }
};
}  // namespace math
namespace math {
mod_int factorial(int n) {
  static std::vector<mod_int> mem;
  static mod_int last;
  if (mem.empty()) last = {1}, mem.push_back(last);
  while (n >= (int)mem.size()) mem.push_back(mem.back() * last++);
  return mem[n];
}
mod_int n_choose_k(int n, int k) {
  return factorial(n) / (factorial(k) * factorial(n - k));
}
}  // namespace math
const double PI = 3.14159265358979323846264338327950288419716939937510;
std::mt19937 get_random_engine() {
  return std::mt19937(std::random_device()());
}
template <typename T = int>
T myrand(T high = std::numeric_limits<T>::max()) {
  assert(high > 0);
  static std::mt19937 random_engine = get_random_engine();
  return std::uniform_int_distribution<T>(0, high - 1)(random_engine);
}
using mi = math::mod_int;
using vmi = std::vector<mi>;
using vvmi = std::vector<std::vector<mi>>;
using namespace std;
class FLampsOnACircle {
  class Solver {
   public:
    io::input_reader in;
    io::output_writer out;
    Solver(std::istream& in, std::ostream& out) : in(in), out(out) {}
    void solve() {
      int n;
      in >> n;
      pi nk = {0, 1};
      for (int k = 2; k < n; k++) {
        int maxn = n - ((n + k - 1) / k) - (k - 1);
        smax(nk, pi{maxn, k});
      }
      int k = nk.second;
      vi state(n, 0);
      while (true) {
        vi op;
        for (int i = 0; i < n && op.size() < k; i++) {
          if ((i % k) != 0 && state[i] == 0) op.push_back(i + 1), state[i] = 1;
        }
        if (op.size() != k) {
          out.println(0);
          out.flush();
          return;
        }
        out.println(k, " ", op);
        out.flush();
        int x;
        in >> x;
        if (x == -1) break;
        x--;
        for (int i = 0; i < (int)(k); i++) state[(x + i) % n] = 0;
      }
    }
  };

 public:
  void solve(std::istream& in, std::ostream& out) { Solver(in, out).solve(); }
};
int main() {
  std::ios_base::sync_with_stdio(false), cin.tie(0);
  FLampsOnACircle solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
