//#include <atcoder/all>
#include <bits/stdc++.h>
//using namespace atcoder;
using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N, M; cin >> N >> M;

 
  
  if(M < 0 || (M > N - 2 && N != 1)) {
    cout << -1 << endl;
    return;
  }

  rep(i, N - 1) {
    cout << (i +  1) * 10 << " " << (i + 1) * 10 + 5 << "\n";
  }
  if(M > 0) {
    cout << "7 " << (M + 1) * 10 + 8 << "\n";
  } else {
    cout << "7 8\n";
  }
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}

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

int main(void){
    long long int n,q,i,ng,ok,mid;

    cin >> n >> q;

    vector<long long int> a(n+1),k(q),c(n+1);
    a.at(0) = 0;
    c.at(0) = 0;

    for(i=1; i<=n; i++){
        cin >> a.at(i);
        c.at(i) = a.at(i) - i;
    }

    for(i=0; i<q; i++){
        cin >> k.at(i);
    }


    for(i=0; i<q; i++){
        if(c.at(n) < k.at(i)){
            cout << a.at(n) + k.at(i) - c.at(n) << endl;
        }else{
            ok = 0;
            ng = n;
            while(abs(ok - ng) > 1){
                mid = (ok + ng) / 2;
                if(k.at(i) > c.at(mid)){
                    ok = mid;
                }else{
                    ng = mid;
                }
            }
            cout << a[ok] + k[i] - c[ok] << endl;
        }
    }
    return 0;
}