/*|In The Name of Allah|*/
/* Dear GCC compiler:
*
* If my code doesn't compile, this doesn't mean it's wrong.
* It just mean that you don't understand what I want.
* Here's my safety pig, I hope my code compile and get accepted.
* _._ _..._ .-',     _.._(`))
*'-. `     '  /-._.-'    ',/
*   )         \            '.
*  / _    _    |             \
* |  a    a    /              |
* \   .-.                     ;
*  '-('' ).-'       ,'       ;
*     '-;           |      .'
*        \           \    /
*        | 7  .__  _.-\   \
*        | |  |  ``/  /`  /
*       /,_|  |   /,_/   /
*          /,_/      '`-'
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace  __gnu_pbds;

long long power(long long x, long long y){
if (y == 0)
	return 1;
long long ret = power(x , y >> 1) %1000000007 ;
if (y % 2 == 0)
	return (ret * ret) % 1000000007;
else
	return (x * (ret * ret % 1000000007)) % 1000000007;
}

pair<int, int> norm(pair<int, int> p)
{
	if(p.first < 0)
	{
		p.first *= -1;
		p.second *= -1;
	}
	else if (p.first == 0 && p.second < 0)
	{
		p.second *= -1;
	}
	int d = __gcd(abs(p.first), abs(p.second));
	p.first /= d;
	p.second /= d;
	return p;
}

/*

int parent[N], sz[N];
int n, m, components;

void init(){
  iota(parent, parent+n, 0);
  fill(sz, sz+n, 1);
  components = n;
}

int find(int u){
  if(parent[u] == u)  return u;
  return parent[u] = find(parent[u]);
}

void join(int u, int v){
  u = find(u), v = find(v);
  if(u == v)  return;
  if(sz[u] < sz[v]) swap(u, v);
  parent[v] = u;
  sz[u] += sz[v];
  --components;
}
int dst[N];
int vis[N];
int parent[N];
vector<vector<pair<int,ll>>>v(N);
void dikstra(){
	set<pair<ll,ll>>s;
	clr(dst,oo);
	clr(vis,0);
	clr(parent,-1);
	dst[1]=0;
	parent[1]=-1;
	s.insert( mp(0,1 ) );
	while(!s.empty()){

		pair<ll,ll> x=*s.begin();
		s.erase(s.begin());
		ll u=x.sc;
		ll d=x.fr;
		if (vis[u])continue;
		vis[u]=1;
		for (int i=0;i<v[u].size();i++){
			ll to=v[u][i].fr;
			ll cost=v[u][i].sc;
			if (vis[to]||d+cost>=dst[to])continue;
			dst[to]=d+cost;
			parent[to]=u;
			s.insert(mp(d+cost,to));
		}
	}

return;
}
void primeFactors(int n)
{
	while (n % 2 == 0){
		n = n/2;
	}

	for (int i = 3; i <= sqrt(n); i = i + 2)
	{
		while (n % i == 0){
			cout << i << " ";
			n = n/i;
		}
	}
	if (n > 2){

	}
}

void Theaf(){
isPrime[0]=1;
isPrime[1]=1;
for (int i=2;i*i<=N;i++){
	if (isPrime[i]==1)continue;
	for (int cnt=2;i*cnt<=N;cnt++)isPrime[ cnt*i ]=1;
}

}
void dfs_EdgeClassification(int node)
{
	start[node] = timer++;

	rep(i, adj[node])
	{
		int child = adj[node][i];
		if (start[child] == -1)	// Not visited Before. Treed Edge
			dfs_EdgeClassification(child);
		else {
			if(finish[child] == -1)// then this is ancestor that called us and waiting us to finish. Then Cycle. Back Edge
				anyCycle = 1;
			else if(start[node] < start[child])	// then you are my descendant
				;	// Forward Edge
			else
				;	// Cross Edge
		}
	}

	finish[node] = timer++;
}

vectorll factorization(ll n) 	 max n is 1e12
{	// O( sqrt(n) )

	vectorll primes;

	for (ll i = 2; i  i * i <= n; ++i)	 Improve start by i = 3.
		while (n % i == 0)
			primes.push_back(i), n /= i;	 Get every prime inside n.	n  i^j	is a new number

	 Two ways to prove that n will be prime number if n  1
	 1) Think in n  pi^x as a NEW sub-problem. If we went to its sqrt and % applied, then we are facing a prime number
	 2) Prove that, for any n either all its primes before sqrt(n), or only the biggest prime after sqrt(n).
	if (n  > 1)
		primes.push_back(n);

	return primes;
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

	ordered_set X;
	X.insert(1);
	X.insert(2);
	X.insert(4);
	X.insert(8);
	X.insert(16);

	0 1 2 3 4
	1 2 4 8 16
	cout<<*X.find_by_order(1)<<endl; // 2
	cout<<*X.find_by_order(2)<<endl; // 4
	cout<<*X.find_by_order(4)<<endl; // 16
	cout<<(end(X)==X.find_by_order(6))<<endl; // true

	cout<<X.order_of_key(-5)<<endl;  // 0
	cout<<X.order_of_key(1)<<endl;   // 0
	cout<<X.order_of_key(3)<<endl;   // 2
	cout<<X.order_of_key(4)<<endl;   // 2
	cout<<X.order_of_key(400)<<endl; // 5

int t = 0;

ordered_set me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

*/
const double Eps =(1e-7);
int dcmp(double x,double y){ return fabs(x-y)<=Eps? 0: x<y ?-1:1; }
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_setpair;
typedef long long  ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pair<int,int> > vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef pair<int, int> pii;
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define sll set <ll>
#define spii set <pii>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define el	'\n'
#define lp(i,n) for(int i = 0;i < int(n);i++)
#define lp1(i,n) for(int i = 1;i <= int(n);i++)
#define rlp(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rng(i,a,b) for(int i = int(a);i <= int(b);i++)
#define mp(x,y)  	make_pair((x),(y))
#define pb(x)    	push_back((x))
#define all(v)  	((v).begin()),((v).end())
#define sz(x)  		((int) (x).size())
#define bits(a) 	__builtin_popcountll(a)
#define fr first
#define sc second
#define pii pair<int, int>
#define sortva(v) sort(all(v))
#define sortvd(v) sort(v.rbegin(),v.rend())
#define sortaa(a,n) sort(a,a+n)
#define sortad(a,n) sort(a,a+n),reverse(a,a+n)
#define SS stringstream
#define ll long long
#define clr(x, y) memset(x, y, sizeof(x))
#define foreach(it,x) for(__typeof__((x).begin()) it = (x).begin(); it != (x).end(); ++it)
#define read freopen("input.in", "rt", stdin);
#define write freopen("output.in", "wt", stdout);
#define fastIO cout << fixed << setprecision(0), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
const int key = 37;
const int key2 = 59;
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int kx[] = { 2, 2, 1, -1, -2, -2, 1, -1 };
int ky[] = { 1, -1, 2, 2, 1, -1, -2, -2 };
ll gcd(ll a, ll b){if (a == 0)return b;return gcd(b % a, a);}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

int const N = 5e5+9, mod = 998244353 ,  oo = 2e9+7;

//------------------------------------------------------------------------------------

set<int>s;
int n,nofships,len;

bool ok (int nofships,int total){
return nofships*len+(nofships-1)<=total;
}

int get(int l,int r){
if (l==0)l++;
if (r==n+1)r--;
int len=r-l+1;
int lo=0,rr=4e5,med;
while(lo<rr){
	med=(lo+rr+1)>>1;
	if (ok(med,len))lo=med;
	else rr=med-1;
}
return lo;

}
int main()
{
	cin>>n>>nofships>>len;
	int y;
	cin>>y;
	s.insert(0);
	s.insert(n+1);

	int sum=get(1,n);
	for (int i=1;i<=y;i++){
		int x;
		cin>>x;
		auto it=s.upper_bound(x);
		int r=*it;
		int l=*--it;
		sum-=get(l,r);
		sum+=get(l,x-1);
		sum+=get(x+1,r);
		if (sum<nofships)return cout<< i,0;
	}
	cout<< -1;

/*
*/
return 0;
}


/*|In The Name of Allah|*/
/* Dear GCC compiler:
*
* If my code doesn't compile, this doesn't mean it's wrong.
* It just mean that you don't understand what I want.
* Here's my safety pig, I hope my code compile and get accepted.
* _._ _..._ .-',     _.._(`))
*'-. `     '  /-._.-'    ',/
*   )         \            '.
*  / _    _    |             \
* |  a    a    /              |
* \   .-.                     ;
*  '-('' ).-'       ,'       ;
*     '-;           |      .'
*        \           \    /
*        | 7  .__  _.-\   \
*        | |  |  ``/  /`  /
*       /,_|  |   /,_/   /
*          /,_/      '`-'
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace  __gnu_pbds;

long long power(long long x, long long y){
if (y == 0)
	return 1;
long long ret = power(x , y >> 1) %1000000007 ;
if (y % 2 == 0)
	return (ret * ret) % 1000000007;
else
	return (x * (ret * ret % 1000000007)) % 1000000007;
}

pair<int, int> norm(pair<int, int> p)
{
	if(p.first < 0)
	{
		p.first *= -1;
		p.second *= -1;
	}
	else if (p.first == 0 && p.second < 0)
	{
		p.second *= -1;
	}
	int d = __gcd(abs(p.first), abs(p.second));
	p.first /= d;
	p.second /= d;
	return p;
}

/*

int parent[N], sz[N];
int n, m, components;

void init(){
  iota(parent, parent+n, 0);
  fill(sz, sz+n, 1);
  components = n;
}

int find(int u){
  if(parent[u] == u)  return u;
  return parent[u] = find(parent[u]);
}

void join(int u, int v){
  u = find(u), v = find(v);
  if(u == v)  return;
  if(sz[u] < sz[v]) swap(u, v);
  parent[v] = u;
  sz[u] += sz[v];
  --components;
}
int dst[N];
int vis[N];
int parent[N];
vector<vector<pair<int,ll>>>v(N);
void dikstra(){
	set<pair<ll,ll>>s;
	clr(dst,oo);
	clr(vis,0);
	clr(parent,-1);
	dst[1]=0;
	parent[1]=-1;
	s.insert( mp(0,1 ) );
	while(!s.empty()){

		pair<ll,ll> x=*s.begin();
		s.erase(s.begin());
		ll u=x.sc;
		ll d=x.fr;
		if (vis[u])continue;
		vis[u]=1;
		for (int i=0;i<v[u].size();i++){
			ll to=v[u][i].fr;
			ll cost=v[u][i].sc;
			if (vis[to]||d+cost>=dst[to])continue;
			dst[to]=d+cost;
			parent[to]=u;
			s.insert(mp(d+cost,to));
		}
	}

return;
}
void primeFactors(int n)
{
	while (n % 2 == 0){
		n = n/2;
	}

	for (int i = 3; i <= sqrt(n); i = i + 2)
	{
		while (n % i == 0){
			cout << i << " ";
			n = n/i;
		}
	}
	if (n > 2){

	}
}

void Theaf(){
isPrime[0]=1;
isPrime[1]=1;
for (int i=2;i*i<=N;i++){
	if (isPrime[i]==1)continue;
	for (int cnt=2;i*cnt<=N;cnt++)isPrime[ cnt*i ]=1;
}

}
void dfs_EdgeClassification(int node)
{
	start[node] = timer++;

	rep(i, adj[node])
	{
		int child = adj[node][i];
		if (start[child] == -1)	// Not visited Before. Treed Edge
			dfs_EdgeClassification(child);
		else {
			if(finish[child] == -1)// then this is ancestor that called us and waiting us to finish. Then Cycle. Back Edge
				anyCycle = 1;
			else if(start[node] < start[child])	// then you are my descendant
				;	// Forward Edge
			else
				;	// Cross Edge
		}
	}

	finish[node] = timer++;
}

vectorll factorization(ll n) 	 max n is 1e12
{	// O( sqrt(n) )

	vectorll primes;

	for (ll i = 2; i  i * i <= n; ++i)	 Improve start by i = 3.
		while (n % i == 0)
			primes.push_back(i), n /= i;	 Get every prime inside n.	n  i^j	is a new number

	 Two ways to prove that n will be prime number if n  1
	 1) Think in n  pi^x as a NEW sub-problem. If we went to its sqrt and % applied, then we are facing a prime number
	 2) Prove that, for any n either all its primes before sqrt(n), or only the biggest prime after sqrt(n).
	if (n  > 1)
		primes.push_back(n);

	return primes;
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

	ordered_set X;
	X.insert(1);
	X.insert(2);
	X.insert(4);
	X.insert(8);
	X.insert(16);

	0 1 2 3 4
	1 2 4 8 16
	cout<<*X.find_by_order(1)<<endl; // 2
	cout<<*X.find_by_order(2)<<endl; // 4
	cout<<*X.find_by_order(4)<<endl; // 16
	cout<<(end(X)==X.find_by_order(6))<<endl; // true

	cout<<X.order_of_key(-5)<<endl;  // 0
	cout<<X.order_of_key(1)<<endl;   // 0
	cout<<X.order_of_key(3)<<endl;   // 2
	cout<<X.order_of_key(4)<<endl;   // 2
	cout<<X.order_of_key(400)<<endl; // 5

int t = 0;

ordered_set me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

*/
const double Eps =(1e-7);
int dcmp(double x,double y){ return fabs(x-y)<=Eps? 0: x<y ?-1:1; }
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_setpair;
typedef long long  ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pair<int,int> > vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef pair<int, int> pii;
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define sll set <ll>
#define spii set <pii>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define el	'\n'
#define lp(i,n) for(int i = 0;i < int(n);i++)
#define lp1(i,n) for(int i = 1;i <= int(n);i++)
#define rlp(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rng(i,a,b) for(int i = int(a);i <= int(b);i++)
#define mp(x,y)  	make_pair((x),(y))
#define pb(x)    	push_back((x))
#define all(v)  	((v).begin()),((v).end())
#define sz(x)  		((int) (x).size())
#define bits(a) 	__builtin_popcountll(a)
#define fr first
#define sc second
#define pii pair<int, int>
#define sortva(v) sort(all(v))
#define sortvd(v) sort(v.rbegin(),v.rend())
#define sortaa(a,n) sort(a,a+n)
#define sortad(a,n) sort(a,a+n),reverse(a,a+n)
#define SS stringstream
#define ll long long
#define clr(x, y) memset(x, y, sizeof(x))
#define foreach(it,x) for(__typeof__((x).begin()) it = (x).begin(); it != (x).end(); ++it)
#define read freopen("input.in", "rt", stdin);
#define write freopen("output.in", "wt", stdout);
#define fastIO cout << fixed << setprecision(0), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
const int key = 37;
const int key2 = 59;
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int kx[] = { 2, 2, 1, -1, -2, -2, 1, -1 };
int ky[] = { 1, -1, 2, 2, 1, -1, -2, -2 };
ll gcd(ll a, ll b){if (a == 0)return b;return gcd(b % a, a);}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

int const N = 5e5+9, mod = 998244353 ,  oo = 2e9+7;

//------------------------------------------------------------------------------------

set<int>s;
int n,nofships,len;

bool ok (int nofships,int total){
return ((ll)nofships*(ll)len)+(ll)(nofships-1)<=(ll)total;
}

int get(int l,int r){
if (l==0)l++;
if (r==n+1)r--;
int len=r-l+1;
int lo=0,rr=4e5,med;
while(lo<rr){
	med=(lo+rr+1)>>1;
	if (ok(med,len))lo=med;
	else rr=med-1;
}
return lo;

}
int main()
{
	cin>>n>>nofships>>len;
	int y;
	cin>>y;
	s.insert(0);
	s.insert(n+1);

	int sum=get(1,n);

	sum=min(sum,nofships);
	for (int i=1;i<=y;i++){
		int x;
		cin>>x;
		auto it=s.upper_bound(x);
		int r=*it;
		int l=*--it;
		sum-=get(l,r);
		sum+=get(l,x-1);
		sum+=get(x+1,r);
		if (sum<nofships)return cout<< i,0;
		s.insert(x-1);
		s.insert(x);
		s.insert(x+1);
	}
	cout<< -1;

/*
*/
return 0;
}


/*|In The Name of Allah|*/
/* Dear GCC compiler:
*
* If my code doesn't compile, this doesn't mean it's wrong.
* It just mean that you don't understand what I want.
* Here's my safety pig, I hope my code compile and get accepted.
* _._ _..._ .-',     _.._(`))
*'-. `     '  /-._.-'    ',/
*   )         \            '.
*  / _    _    |             \
* |  a    a    /              |
* \   .-.                     ;
*  '-('' ).-'       ,'       ;
*     '-;           |      .'
*        \           \    /
*        | 7  .__  _.-\   \
*        | |  |  ``/  /`  /
*       /,_|  |   /,_/   /
*          /,_/      '`-'
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace  __gnu_pbds;

long long power(long long x, long long y){
if (y == 0)
	return 1;
long long ret = power(x , y >> 1) %1000000007 ;
if (y % 2 == 0)
	return (ret * ret) % 1000000007;
else
	return (x * (ret * ret % 1000000007)) % 1000000007;
}

pair<int, int> norm(pair<int, int> p)
{
	if(p.first < 0)
	{
		p.first *= -1;
		p.second *= -1;
	}
	else if (p.first == 0 && p.second < 0)
	{
		p.second *= -1;
	}
	int d = __gcd(abs(p.first), abs(p.second));
	p.first /= d;
	p.second /= d;
	return p;
}

/*

int parent[N], sz[N];
int n, m, components;

void init(){
  iota(parent, parent+n, 0);
  fill(sz, sz+n, 1);
  components = n;
}

int find(int u){
  if(parent[u] == u)  return u;
  return parent[u] = find(parent[u]);
}

void join(int u, int v){
  u = find(u), v = find(v);
  if(u == v)  return;
  if(sz[u] < sz[v]) swap(u, v);
  parent[v] = u;
  sz[u] += sz[v];
  --components;
}
int dst[N];
int vis[N];
int parent[N];
vector<vector<pair<int,ll>>>v(N);
void dikstra(){
	set<pair<ll,ll>>s;
	clr(dst,oo);
	clr(vis,0);
	clr(parent,-1);
	dst[1]=0;
	parent[1]=-1;
	s.insert( mp(0,1 ) );
	while(!s.empty()){

		pair<ll,ll> x=*s.begin();
		s.erase(s.begin());
		ll u=x.sc;
		ll d=x.fr;
		if (vis[u])continue;
		vis[u]=1;
		for (int i=0;i<v[u].size();i++){
			ll to=v[u][i].fr;
			ll cost=v[u][i].sc;
			if (vis[to]||d+cost>=dst[to])continue;
			dst[to]=d+cost;
			parent[to]=u;
			s.insert(mp(d+cost,to));
		}
	}

return;
}
void primeFactors(int n)
{
	while (n % 2 == 0){
		n = n/2;
	}

	for (int i = 3; i <= sqrt(n); i = i + 2)
	{
		while (n % i == 0){
			cout << i << " ";
			n = n/i;
		}
	}
	if (n > 2){

	}
}

void Theaf(){
isPrime[0]=1;
isPrime[1]=1;
for (int i=2;i*i<=N;i++){
	if (isPrime[i]==1)continue;
	for (int cnt=2;i*cnt<=N;cnt++)isPrime[ cnt*i ]=1;
}

}
void dfs_EdgeClassification(int node)
{
	start[node] = timer++;

	rep(i, adj[node])
	{
		int child = adj[node][i];
		if (start[child] == -1)	// Not visited Before. Treed Edge
			dfs_EdgeClassification(child);
		else {
			if(finish[child] == -1)// then this is ancestor that called us and waiting us to finish. Then Cycle. Back Edge
				anyCycle = 1;
			else if(start[node] < start[child])	// then you are my descendant
				;	// Forward Edge
			else
				;	// Cross Edge
		}
	}

	finish[node] = timer++;
}

vectorll factorization(ll n) 	 max n is 1e12
{	// O( sqrt(n) )

	vectorll primes;

	for (ll i = 2; i  i * i <= n; ++i)	 Improve start by i = 3.
		while (n % i == 0)
			primes.push_back(i), n /= i;	 Get every prime inside n.	n  i^j	is a new number

	 Two ways to prove that n will be prime number if n  1
	 1) Think in n  pi^x as a NEW sub-problem. If we went to its sqrt and % applied, then we are facing a prime number
	 2) Prove that, for any n either all its primes before sqrt(n), or only the biggest prime after sqrt(n).
	if (n  > 1)
		primes.push_back(n);

	return primes;
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

	ordered_set X;
	X.insert(1);
	X.insert(2);
	X.insert(4);
	X.insert(8);
	X.insert(16);

	0 1 2 3 4
	1 2 4 8 16
	cout<<*X.find_by_order(1)<<endl; // 2
	cout<<*X.find_by_order(2)<<endl; // 4
	cout<<*X.find_by_order(4)<<endl; // 16
	cout<<(end(X)==X.find_by_order(6))<<endl; // true

	cout<<X.order_of_key(-5)<<endl;  // 0
	cout<<X.order_of_key(1)<<endl;   // 0
	cout<<X.order_of_key(3)<<endl;   // 2
	cout<<X.order_of_key(4)<<endl;   // 2
	cout<<X.order_of_key(400)<<endl; // 5

int t = 0;

ordered_set me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

*/
const double Eps =(1e-7);
int dcmp(double x,double y){ return fabs(x-y)<=Eps? 0: x<y ?-1:1; }
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_setpair;
typedef long long  ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pair<int,int> > vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef pair<int, int> pii;
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define sll set <ll>
#define spii set <pii>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define el	'\n'
#define lp(i,n) for(int i = 0;i < int(n);i++)
#define lp1(i,n) for(int i = 1;i <= int(n);i++)
#define rlp(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rng(i,a,b) for(int i = int(a);i <= int(b);i++)
#define mp(x,y)  	make_pair((x),(y))
#define pb(x)    	push_back((x))
#define all(v)  	((v).begin()),((v).end())
#define sz(x)  		((int) (x).size())
#define bits(a) 	__builtin_popcountll(a)
#define fr first
#define sc second
#define pii pair<int, int>
#define sortva(v) sort(all(v))
#define sortvd(v) sort(v.rbegin(),v.rend())
#define sortaa(a,n) sort(a,a+n)
#define sortad(a,n) sort(a,a+n),reverse(a,a+n)
#define SS stringstream
#define ll long long
#define clr(x, y) memset(x, y, sizeof(x))
#define foreach(it,x) for(__typeof__((x).begin()) it = (x).begin(); it != (x).end(); ++it)
#define read freopen("input.in", "rt", stdin);
#define write freopen("output.in", "wt", stdout);
#define fastIO cout << fixed << setprecision(0), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
const int key = 37;
const int key2 = 59;
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int kx[] = { 2, 2, 1, -1, -2, -2, 1, -1 };
int ky[] = { 1, -1, 2, 2, 1, -1, -2, -2 };
ll gcd(ll a, ll b){if (a == 0)return b;return gcd(b % a, a);}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

int const N = 5e5+9, mod = 998244353 ,  oo = 2e9+7;

//------------------------------------------------------------------------------------

set<int>s;
int n,nofships,len;

bool ok (int nofships,int total){
return (ll)nofships*(ll)len+(ll)(nofships-1)<=(ll)total;
}

int get(int l,int r){
if (l==0)l++;
if (r==n+1)r--;
int len=r-l+1;
int lo=0,rr=4e5,med;
while(lo<rr){
	med=(lo+rr+1)>>1;
	if (ok(med,len))lo=med;
	else rr=med-1;
}
return lo;

}
int main()
{
	cin>>n>>nofships>>len;
	int y;
	cin>>y;
	s.insert(0);
	s.insert(n+1);

	int sum=get(1,n);
	for (int i=1;i<=y;i++){
		int x;
		cin>>x;
		auto it=s.upper_bound(x);
		int r=*it;
		int l=*--it;
		sum-=get(l,r);
		sum+=get(l,x-1);
		sum+=get(x+1,r);
		if (sum<nofships)return cout<< i,0;
		s.insert(x-1);
		s.insert(x);
		s.insert(x+1);
	}
	cout<< -1;

/*
*/
return 0;
}


/*|In The Name of Allah|*/
/* Dear GCC compiler:
*
* If my code doesn't compile, this doesn't mean it's wrong.
* It just mean that you don't understand what I want.
* Here's my safety pig, I hope my code compile and get accepted.
* _._ _..._ .-',     _.._(`))
*'-. `     '  /-._.-'    ',/
*   )         \            '.
*  / _    _    |             \
* |  a    a    /              |
* \   .-.                     ;
*  '-('' ).-'       ,'       ;
*     '-;           |      .'
*        \           \    /
*        | 7  .__  _.-\   \
*        | |  |  ``/  /`  /
*       /,_|  |   /,_/   /
*          /,_/      '`-'
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace  __gnu_pbds;

long long power(long long x, long long y){
if (y == 0)
	return 1;
long long ret = power(x , y >> 1) %1000000007 ;
if (y % 2 == 0)
	return (ret * ret) % 1000000007;
else
	return (x * (ret * ret % 1000000007)) % 1000000007;
}

pair<int, int> norm(pair<int, int> p)
{
	if(p.first < 0)
	{
		p.first *= -1;
		p.second *= -1;
	}
	else if (p.first == 0 && p.second < 0)
	{
		p.second *= -1;
	}
	int d = __gcd(abs(p.first), abs(p.second));
	p.first /= d;
	p.second /= d;
	return p;
}

/*

int parent[N], sz[N];
int n, m, components;

void init(){
  iota(parent, parent+n, 0);
  fill(sz, sz+n, 1);
  components = n;
}

int find(int u){
  if(parent[u] == u)  return u;
  return parent[u] = find(parent[u]);
}

void join(int u, int v){
  u = find(u), v = find(v);
  if(u == v)  return;
  if(sz[u] < sz[v]) swap(u, v);
  parent[v] = u;
  sz[u] += sz[v];
  --components;
}
int dst[N];
int vis[N];
int parent[N];
vector<vector<pair<int,ll>>>v(N);
void dikstra(){
	set<pair<ll,ll>>s;
	clr(dst,oo);
	clr(vis,0);
	clr(parent,-1);
	dst[1]=0;
	parent[1]=-1;
	s.insert( mp(0,1 ) );
	while(!s.empty()){

		pair<ll,ll> x=*s.begin();
		s.erase(s.begin());
		ll u=x.sc;
		ll d=x.fr;
		if (vis[u])continue;
		vis[u]=1;
		for (int i=0;i<v[u].size();i++){
			ll to=v[u][i].fr;
			ll cost=v[u][i].sc;
			if (vis[to]||d+cost>=dst[to])continue;
			dst[to]=d+cost;
			parent[to]=u;
			s.insert(mp(d+cost,to));
		}
	}

return;
}
void primeFactors(int n)
{
	while (n % 2 == 0){
		n = n/2;
	}

	for (int i = 3; i <= sqrt(n); i = i + 2)
	{
		while (n % i == 0){
			cout << i << " ";
			n = n/i;
		}
	}
	if (n > 2){

	}
}

void Theaf(){
isPrime[0]=1;
isPrime[1]=1;
for (int i=2;i*i<=N;i++){
	if (isPrime[i]==1)continue;
	for (int cnt=2;i*cnt<=N;cnt++)isPrime[ cnt*i ]=1;
}

}
void dfs_EdgeClassification(int node)
{
	start[node] = timer++;

	rep(i, adj[node])
	{
		int child = adj[node][i];
		if (start[child] == -1)	// Not visited Before. Treed Edge
			dfs_EdgeClassification(child);
		else {
			if(finish[child] == -1)// then this is ancestor that called us and waiting us to finish. Then Cycle. Back Edge
				anyCycle = 1;
			else if(start[node] < start[child])	// then you are my descendant
				;	// Forward Edge
			else
				;	// Cross Edge
		}
	}

	finish[node] = timer++;
}

vectorll factorization(ll n) 	 max n is 1e12
{	// O( sqrt(n) )

	vectorll primes;

	for (ll i = 2; i  i * i <= n; ++i)	 Improve start by i = 3.
		while (n % i == 0)
			primes.push_back(i), n /= i;	 Get every prime inside n.	n  i^j	is a new number

	 Two ways to prove that n will be prime number if n  1
	 1) Think in n  pi^x as a NEW sub-problem. If we went to its sqrt and % applied, then we are facing a prime number
	 2) Prove that, for any n either all its primes before sqrt(n), or only the biggest prime after sqrt(n).
	if (n  > 1)
		primes.push_back(n);

	return primes;
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

	ordered_set X;
	X.insert(1);
	X.insert(2);
	X.insert(4);
	X.insert(8);
	X.insert(16);

	0 1 2 3 4
	1 2 4 8 16
	cout<<*X.find_by_order(1)<<endl; // 2
	cout<<*X.find_by_order(2)<<endl; // 4
	cout<<*X.find_by_order(4)<<endl; // 16
	cout<<(end(X)==X.find_by_order(6))<<endl; // true

	cout<<X.order_of_key(-5)<<endl;  // 0
	cout<<X.order_of_key(1)<<endl;   // 0
	cout<<X.order_of_key(3)<<endl;   // 2
	cout<<X.order_of_key(4)<<endl;   // 2
	cout<<X.order_of_key(400)<<endl; // 5

int t = 0;

ordered_set me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

*/
const double Eps =(1e-7);
int dcmp(double x,double y){ return fabs(x-y)<=Eps? 0: x<y ?-1:1; }
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_setpair;
typedef long long  ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pair<int,int> > vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef pair<int, int> pii;
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define sll set <ll>
#define spii set <pii>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define el	'\n'
#define lp(i,n) for(int i = 0;i < int(n);i++)
#define lp1(i,n) for(int i = 1;i <= int(n);i++)
#define rlp(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rng(i,a,b) for(int i = int(a);i <= int(b);i++)
#define mp(x,y)  	make_pair((x),(y))
#define pb(x)    	push_back((x))
#define all(v)  	((v).begin()),((v).end())
#define sz(x)  		((int) (x).size())
#define bits(a) 	__builtin_popcountll(a)
#define fr first
#define sc second
#define pii pair<int, int>
#define sortva(v) sort(all(v))
#define sortvd(v) sort(v.rbegin(),v.rend())
#define sortaa(a,n) sort(a,a+n)
#define sortad(a,n) sort(a,a+n),reverse(a,a+n)
#define SS stringstream
#define ll long long
#define clr(x, y) memset(x, y, sizeof(x))
#define foreach(it,x) for(__typeof__((x).begin()) it = (x).begin(); it != (x).end(); ++it)
#define read freopen("input.in", "rt", stdin);
#define write freopen("output.in", "wt", stdout);
#define fastIO cout << fixed << setprecision(0), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
const int key = 37;
const int key2 = 59;
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int kx[] = { 2, 2, 1, -1, -2, -2, 1, -1 };
int ky[] = { 1, -1, 2, 2, 1, -1, -2, -2 };
ll gcd(ll a, ll b){if (a == 0)return b;return gcd(b % a, a);}
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

int const N = 5e5+9, mod = 998244353 ,  oo = 2e9+7;

//------------------------------------------------------------------------------------

set<int>s;
int n,nofships,len;

bool ok (int nofships,int total){
return (ll)nofships*(ll)len+(ll)(nofships-1)<=(ll)total;
}

int get(int l,int r){
if (l==0)l++;
if (r==n+1)r--;
int len=r-l+1;
int lo=0,rr=4e5,med;
while(lo<rr){
	med=(lo+rr+1)>>1;
	if (ok(med,len))lo=med;
	else rr=med-1;
}
return lo;

}
int main()
{
	cin>>n>>nofships>>len;
	int y;
	cin>>y;
	s.insert(0);
	s.insert(n+1);

	int sum=get(1,n);
	for (int i=1;i<=y;i++){
		int x;
		cin>>x;
		auto it=s.upper_bound(x);
		int r=*it;
		int l=*--it;
		sum-=get(l,r);
		sum+=get(l,x-1);
		sum+=get(x+1,r);
		if (sum<nofships)return cout<< i,0;
	}
	cout<< -1;

/*
*/
return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e5 + 7;

int segTree[4 * MAXN], n, m, a, k;

void update(int id, int l, int r, int p)
{
    if (p > r || p < l) return;
    if (l == r) return segTree[id] = 1, void();
    int mid = (l + r) >> 1, g = id << 1;
    update(g, l, mid, p);
    update(g | 1, mid + 1, r, p);
    segTree[id] = segTree[g] + segTree[g | 1];
}

int get(int id, int l, int r, int i, int j)
{
    if (i > r || j < l) return 0;
    if (i <= l && j >= r) return segTree[id];
    int mid = (l + r) >> 1, g = id << 1;
    return get(g, l, mid, i, j) + get(g | 1, mid + 1, r, i, j);
}

int main()
{
//    freopen("test.inp", "r", stdin);
//    freopen("test.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> k >> a >> m;
    update(1, 0, n + 1, 0);
    update(1, 0, n + 1, n + 1);
    int cnt = n / (a + 1) + (n % (a + 1) == a);
    set <int> S;
    S.insert(0);
    S.insert(n + 1);
    for (int i = 1, x; i <= m; ++i)
    {
        cin >> x;
        int p1 = x, p2 = x;
        auto itlow = S.lower_bound(x);
        if (itlow != S.end()) p1 = *itlow + 1;
        auto itup = S.lower_bound(x + 1);
        if (itup != S.end()) p2 = *itup - 1;
        cnt -= (p2 - p1 + 1) / (a + 1) + ((p2 - p1 + 1) % (a + 1) == a);
        cnt += ((x - 1) - p1 + 1) / (a + 1) + (((x - 1) - p1 + 1) % (a + 1) == a);
        cnt += (p2 - (x + 1) + 1) / (a + 1) + ((p2 - (x + 1) + 1) % (a + 1) == a);
        if (cnt < k) return cout << i, 0;
        update(1, 0, n + 1, x);
        S.insert(x);
    }
    cout << - 1;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e5 + 7;

int segTree[4 * MAXN], n, m, a, k;

void update(int id, int l, int r, int p)
{
    if (p > r || p < l) return;
    if (l == r) return segTree[id] = 1, void();
    int mid = (l + r) >> 1, g = id << 1;
    update(g, l, mid, p);
    update(g | 1, mid + 1, r, p);
    segTree[id] = segTree[g] + segTree[g | 1];
}

int get(int id, int l, int r, int i, int j)
{
    if (i > r || j < l) return 0;
    if (i <= l && j >= r) return segTree[id];
    int mid = (l + r) >> 1, g = id << 1;
    return get(g, l, mid, i, j) + get(g | 1, mid + 1, r, i, j);
}

int main()
{
//    freopen("test.inp", "r", stdin);
//    freopen("test.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> k >> a >> m;
    update(1, 0, n + 1, 0);
    update(1, 0, n + 1, n + 1);
    int cnt = n / (a + 1) + (n % (a + 1) == a);
    set <int> S;
    S.insert(0);
    S.insert(n + 1);
    for (int i = 1, x; i <= m; ++i)
    {
        cin >> x;
        int p1 = x, p2 = x;
        auto itlow = S.lower_bound(x);
        if (itlow != S.end() && itlow != S.begin() && *itlow > x) p1 = *--itlow + 1;
        else if (itlow != S.end()) p1 = *itlow + 1;
        auto itup = S.lower_bound(x + 1);
        if (itup != S.end()) p2 = *itup - 1;
        cnt -= (p2 - p1 + 1) / (a + 1) + ((p2 - p1 + 1) % (a + 1) == a);
        cnt += ((x - 1) - p1 + 1) / (a + 1) + (((x - 1) - p1 + 1) % (a + 1) == a);
        cnt += (p2 - (x + 1) + 1) / (a + 1) + ((p2 - (x + 1) + 1) % (a + 1) == a);
        if (cnt < k) return cout << i, 0;
        update(1, 0, n + 1, x);
        S.insert(x);
    }
    cout << - 1;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e5 + 7;

int segTree[4 * MAXN], n, m, a, k;

void update(int id, int l, int r, int p)
{
    if (p > r || p < l) return;
    if (l == r) return segTree[id] = 1, void();
    int mid = (l + r) >> 1, g = id << 1;
    update(g, l, mid, p);
    update(g | 1, mid + 1, r, p);
    segTree[id] = segTree[g] + segTree[g | 1];
}

int get(int id, int l, int r, int i, int j)
{
    if (i > r || j < l) return 0;
    if (i <= l && j >= r) return segTree[id];
    int mid = (l + r) >> 1, g = id << 1;
    return get(g, l, mid, i, j) + get(g | 1, mid + 1, r, i, j);
}

int main()
{
//    freopen("test.inp", "r", stdin);
//    freopen("test.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> k >> a >> m;
    update(1, 0, n + 1, 0);
    update(1, 0, n + 1, n + 1);
    int cnt = n / (a + 1) + (n % (a + 1) == a);
    for (int i = 1, x; i <= m; ++i)
    {
        cin >> x;
        int l = 1, r = x - 1, p1 = x, p2 = x;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            if (get(1, 0, n + 1, mid, x - 1)) l = mid + 1;
            else r = mid - 1, p1 = mid;
        }

        l = x + 1, r = n;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            if (get(1, 0, n + 1, x + 1, mid)) r = mid - 1;
            else l = mid + 1, p2 = mid;
        }

        cnt -= (p2 - p1 + 1) / (a + 1) + ((p2 - p1 + 1) % (a + 1) == a);
        cnt += ((x - 1) - p1 + 1) / (a + 1) + (((x - 1) - p1 + 1) % (a + 1) == a);
        cnt += (p2 - (x + 1) + 1) / (a + 1) + ((p2 - (x + 1) + 1) % (a + 1) == a);
        if (cnt < k) return cout << i, 0;
        update(1, 0, n + 1, x);
    }
    cout << - 1;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e5 + 7;

int segTree[4 * MAXN], n, m, a, k;

void update(int id, int l, int r, int p)
{
    if (p > r || p < l) return;
    if (l == r) return segTree[id] = 1, void();
    int mid = (l + r) >> 1, g = id << 1;
    update(g, l, mid, p);
    update(g | 1, mid + 1, r, p);
    segTree[id] = segTree[g] + segTree[g | 1];
}

int get(int id, int l, int r, int i, int j)
{
    if (i > r || j < l) return 0;
    if (i <= l && j >= r) return segTree[id];
    int mid = (l + r) >> 1, g = id << 1;
    return get(g, l, mid, i, j) + get(g | 1, mid + 1, r, i, j);
}

int main()
{
//    freopen("test.inp", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> k >> a >> m;
    update(1, 0, n + 1, 0);
    update(1, 0, n + 1, n + 1);
    int cnt = n / a;
    for (int i = 1, x; i <= m; ++i)
    {
        cin >> x;
        int l = 1, r = x - 1, p1 = x, p2 = x;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            if (get(1, 0, n + 1, mid, x - 1)) l = mid + 1;
            else r = mid - 1, p1 = mid;
        }

        l = x + 1, r = n;
        while (l <= r)
        {
            int mid = (l + r) >> 1;
            if (get(1, 0, n + 1, x + 1, mid)) r = mid - 1;
            else l = mid + 1, p2 = mid;
        }

        cnt -= (p2 - p1 + 1) / a;
        cnt += ((x - 1) - p1 + 1) / a + (p2 - (x + 1) + 1) / a;
        if (cnt < k) return cout << i, 0;
    }
    cout << - 1;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
using namespace std;

const int maxN = 2e5 + 5;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int n, m, i, k, a, X[maxN];
long long int l, r, mid;
vector <int> s;

bool isVal(int t){
	bool flag[] = {false, false};
	int cnt = 0;
	s.clear();
	for (i = 1; i <= t; i++){
		flag[0] |= (X[i] == 1);
		flag[1] |= (X[i] == n);
		s.push_back(X[i]);
	}
	if (!flag[0]){
		s.push_back(0);
	}
	if (!flag[1]){
		s.push_back(n + 1);
	}
	sort(s.begin(), s.end());
	for (i = 1; i < s.size(); i++){
		cnt += (s[i] - s[i - 1]) / (a + 1);
	}
	return (cnt >= k);
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> k >> a;
	cin >> m;
	for (i = 1; i <= m; i++){
		cin >> X[i];
	}
	if (n == 1){
		cout << 1 << endl;
		return 0;
	}
	l = 0;
	r = m + 1;
	while (r - l > 1){
		mid = (l + r) / 2;
		if (isVal(mid)){
			l = mid;
		}
		else{
			r = mid;
		}
	}
	cout << (r == m + 1 ? -1 : r) << endl;
	return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
using namespace std;

const int maxN = 2e5 + 5;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int n, m, i, k, a, X[maxN];
long long int l, r, mid;
vector <int> s;

bool isVal(int t){
	bool flag[] = {false, false};
	int cnt = 0;
	s.clear();
	for (i = 1; i <= t; i++){
		flag[0] |= (X[i] == 1);
		flag[1] |= (X[i] == n);
		s.push_back(X[i]);
	}
	if (!flag[0]){
		s.push_back(1);
	}
	if (!flag[1]){
		s.push_back(n);
	}
	sort(s.begin(), s.end());
	for (i = 1; i < s.size(); i++){
		if (s[i] - s[i - 1] < a){
			return false;
		}
		else{
			cnt += 1;
		}
		if (cnt > k){
			return false;
		}
	}
	return true;
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> k >> a;
	cin >> m;
	for (i = 1; i <= m; i++){
		cin >> X[i];
	}
	if (n == 1){
		cout << 1 << endl;
		return 0;
	}
	l = 0;
	r = m + 1;
	while (r - l > 1){
		mid = (l + r) / 2;
		if (isVal(mid)){
			l = mid;
		}
		else{
			r = mid;
		}
	}
	cout << (r == m + 1 ? -1 : r) << endl;
	return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
using namespace std;

const int maxN = 2e5 + 5;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int n, m, i, k, a, X[maxN];
long long int l, r, mid;
vector <int> s;

bool isVal(int t){
	bool flag[] = {false, false};
	int cnt = 0;
	s.clear();
	for (i = 1; i <= t; i++){
		flag[0] |= (X[i] == 1);
		flag[1] |= (X[i] == n);
		s.push_back(X[i]);
	}
	if (!flag[0]){
		s.push_back(1);
	}
	if (!flag[1]){
		s.push_back(n);
	}
	sort(s.begin(), s.end());
	for (i = 1; i < s.size(); i++){
		if (s[i] - s[i - 1] < a){
			return false;
		}
		else{
			cnt += 1;
		}
		if (cnt > k){
			return false;
		}
	}
	return true;
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> k >> a;
	cin >> m;
	for (i = 1; i <= m; i++){
		cin >> X[i];
	}
	l = 0;
	r = m + 1;
	while (r - l > 1){
		mid = (l + r) / 2;
		if (isVal(mid)){
			l = mid;
		}
		else{
			r = mid;
		}
	}
	cout << (r == m + 1 ? -1 : r) << endl;
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b)  for (__typeof((b)) i=(a);i<=(b);i++)
#define nrep(i,a,b)  for (__typeof((b)) i=(b);i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define ppi pair<int,int>
#define pppi pair<int,ppi>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define mod  998244353
#define debug(a)    cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define endl '\n'
#define reflex ios_base::sync_with_stdio(false)
#define si(x) scanf("%d",&x)
#define int long long
#define cin(a) int (a); cin>>(a);
using namespace std;
const int N = 200005;
int A[N];
int n,a,k;
bool fnc(int x){
    vi v;
    rep(i,1,x){
        v.pb(A[i]);
    }
    v.pb(n+1);
    sort(all(v));
    int l = 1;
    int ans = 0;
    for(int i=0;i<sz(v);i++){
        int r = v[i] - 1;
        if(r>=l){
            ans += ((r-l+2)/(a+1));
        }
        l = r+2;
    }
    return ans<k;
}
void solve(){
    int m;
    cin>>n>>k>>a;
    cin>>m;
    rep(i,1,m){
        cin>>A[i];
    }
    int low = 1;
    int high = m;
    int ans = -1;
    while(high-low>=0){
        int mid = (low+high)/2;
        if(fnc(mid)){
            ans = mid;
            high = mid - 1;
        }
        else
            low = mid + 1;
    }
    cout<<ans<<endl;
}
signed main(){
    int t;
    reflex;
    t = 1;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b)  for (__typeof((b)) i=(a);i<=(b);i++)
#define nrep(i,a,b)  for (__typeof((b)) i=(b);i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define ppi pair<int,int>
#define pppi pair<int,ppi>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define mod  998244353
#define debug(a)    cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define endl '\n'
#define reflex ios_base::sync_with_stdio(false)
#define si(x) scanf("%d",&x)
#define int long long
#define cin(a) int (a); cin>>(a);
using namespace std;
const int N = 200005;
int A[N];
int S1[N],S2[N],n,a,k;
bool fnc(int x){
    memset(S1,0,sizeof(S1));
    memset(S2,0,sizeof(S2));
    rep(i,1,x){
        int b1 = A[i];
        int a1 = max((int)1,b1-a+1);
        S1[a1]++;
        S1[b1+1]--;
    }
    int sum = 0;
    rep(i,1,n){
        sum += S1[i];
        if(!sum){
            int a1 = i;
            int b1 = i+a-1;
            S2[a1]++;
            S2[b1+1]--;
        }
    }
    sum = 0;
    int t = 0;
    rep(i,1,n){
        sum += S2[i];
        if(sum)
            t++;
    }
    return t<k*a;
}
void solve(){
    int m;
    cin>>n>>k>>a;
    cin>>m;
    rep(i,1,m){
        cin>>A[i];
    }
    int low = 1;
    int high = m;
    int ans = -1;
    while(high-low>=0){
        int mid = (low+high)/2;
        if(fnc(mid)){
            ans = mid;
            high = mid - 1;
        }
        else
            low = mid + 1;
    }
    cout<<ans<<endl;
}
signed main(){
    int t;
    reflex;
    t = 1;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b)  for (__typeof((b)) i=(a);i<=(b);i++)
#define nrep(i,a,b)  for (__typeof((b)) i=(b);i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define ppi pair<int,int>
#define pppi pair<int,ppi>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define mod  998244353
#define debug(a)    cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define endl '\n'
#define reflex ios_base::sync_with_stdio(false)
#define si(x) scanf("%d",&x)
#define int long long
#define cin(a) int (a); cin>>(a);
using namespace std;
const int N = 200005;
void solve(){
    int n,k,a;
    cin>>n>>k>>a;
    set<int> s;
    rep(i,1,n){
        if(i+a-1<=n)
            s.insert(i);
        else
            break;
    }
    cin(m);
    rep(i,1,m){
        cin(x);
        auto it = s.upper_bound(x);
        if(it==s.begin())
            continue;
        it--;
        int y = *it;
        while((x-y)<=a-1){
            s.erase(it);
            if(sz(s)<k){
                cout<<i<<endl;
                return;
            }
            it = s.upper_bound(y);
            if(it==s.begin())
                break;
            it--;
            y = *it;
        }
    }
    cout<<-1<<endl;
}
signed main(){
    int t;
    reflex;
    t = 1;
    while(t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b)  for (__typeof((b)) i=(a);i<=(b);i++)
#define nrep(i,a,b)  for (__typeof((b)) i=(b);i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define ppi pair<int,int>
#define pppi pair<int,ppi>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define mod  998244353
#define debug(a)    cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define endl '\n'
#define reflex ios_base::sync_with_stdio(false)
#define si(x) scanf("%d",&x)
#define int long long
#define cin(a) int (a); cin>>(a);
using namespace std;
const int N = 200005;
int A[N];
int S1[N],S2[N],n,a,k;
bool fnc(int x){
    memset(S1,0,sizeof(S1));
    memset(S2,0,sizeof(S2));
    rep(i,1,x){
        int b1 = A[i];
        int a1 = max((int)1,b1-a1+1);
        S1[a1]++;
        S1[b1+1]--;
    }
    int sum = 0;
    rep(i,1,n){
        sum += S1[i];
        if(!sum){
            int a1 = i;
            int b1 = i+a-1;
            S2[a1]++;
            S2[b1+1]--;
        }
    }
    sum = 0;
    int t = 0;
    rep(i,1,n){
        sum += S2[i];
        if(sum)
            t++;
    }
    return t<k*a;
}
void solve(){
    int m;
    cin>>n>>k>>a;
    cin>>m;
    rep(i,1,m){
        cin>>A[i];
    }
    int low = 1;
    int high = m;
    int ans = -1;
    while(high-low>=1){
        int mid = (low+high)/2;
        if(fnc(mid)){
            ans = mid;
            high = mid - 1;
        }
        else
            low = mid + 1;
    }
    cout<<ans<<endl;
}
signed main(){
    int t;
    reflex;
    t = 1;
    while(t--)
        solve();
    return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    //cout<<x<<" "<<c<<endl;
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=0,r=m;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid,ans=mid;
    else r=mid-1;
}
if(ans==m)
cout<<"-1";
else
cout<<ans+1;
return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    //cout<<x<<" "<<c<<endl;
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=1,r=m;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid,ans=mid;
    else r=mid-1;
}
if(ans==m)
cout<<"-1";
else if(ans==0)
cout<<"1";
else
cout<<l+1;
return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    //cout<<x<<" "<<c<<endl;
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=1,r=m;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid,ans=mid;
    else r=mid-1;
}
if(ans==m)
cout<<"-1";
else if(ans==0)
cout<<"1";
else
cout<<ans+1;
return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    //cout<<x<<" "<<c<<endl;
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=1,r=m;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid;
    else r=mid-1;
}
if(l==m)
cout<<"-1";
else
cout<<l+1;
return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    //cout<<x<<" "<<c<<endl;
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=0,r=m+10;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid,ans=mid;
    else r=mid-1;
}
if(ans==m)
cout<<"-1";
else
cout<<ans+1;
return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    //cout<<x<<" "<<c<<endl;
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=0,r=m;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid,ans=mid;
    else r=mid-1;
}
if(ans==m)
cout<<"-1";
else if(ans==0)
cout<<"1";
else
cout<<ans+1;
return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include <iostream>
#include <cmath>
#include <complex>
#include<queue>
#include <string>
#include<bits/stdc++.h>
#define pi 3.14159265
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<8> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//const double PI = acos(-1.0);
//const double EPS = 1e-9;
//typedef complex<double> point;
int n,k,a,m,v[200010],ans;
bool ok(int x)
{
    int c=k;
    vector<int>t;
    t.push_back(0);
    forr(i,1,x)
    t.push_back(v[i]);
    t.push_back(n+1);
    sort(t.begin(),t.end());
    forr(i,1,t.size()-1)
    {
        int d=t[i]-t[i-1]-1;
        int cc=(d+1)/(a+1);
        c-=cc;
    }
    if(c<=0)return 1;
    else return 0;
}
int main()
{
    //cout<<Pow((ll)1000000,(ll)110);
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);
//    char input[15];
//    scanf("%s", &input);
cin>>n>>k>>a;
cin>>m;
forr(i,1,m)
cin>>v[i];
//v[m+1]=n+1;
int l=1,r=m;
while(l<r)
{
    int mid=(l+r+1)/2;
    if(ok(mid))l=mid,ans=mid;
    else r=mid-1;
}
if(ans==m)
cout<<"-1";
else
cout<<ans+1;
return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define  ll long long
#define  ull unsigned long long
#define  ul unsigned long
#define all(v) v.begin(),v.end()
#define sz(n) (int)n.size()
#define pb(s) push_back(s);
#define format(n) fixed<<setprecision(n)
#define finl "\n"
#define Mohammed_Atef_Hassan fast();
#define INF LLONG_MAX
#define PI acos(-1)
#define clr(dp,n) memset(dp,n,sizeof dp)
#define ex(n) return cout<<n<<finl,0;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
void fast() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifdef ONLINE_JUDGE
	//	freopen("palindrome.in", "r", stdin);

	//freopen("palindrome.out", "w", stdout);
#endif
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
}
ll lt[(int)2e5 + 10], rt[(int)2e5 + 10];
ll sum[(int)2e5 + 10];
ll solve(ll sz, ll a)
{
	ll l = 1, r = 2e5 + 10; ll res = 0;
	while (l <= r)
	{
		ll mid = (l + r) >> 1;
		if (mid*a + mid - 1 <= sz)
		{
			res = mid;
			l = mid + 1;
		}
		else r = mid - 1;
	}
	return res;
}
int main()
{
	Mohammed_Atef_Hassan
		ll n, k, a,m,z;
	cin >> n >> k >> a;
	rt[0] = n + 1; lt[n + 1] = 0;
	sum[n + 1] = solve(n, a);
	ll number = sum[n + 1];
	set<ll>s = { 0,n + 1 };
	ll res = -1;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> z;
		ll val = *s.lower_bound(z);
		number -= sum[val];
		sum[z] = solve(z - lt[val]-1,a);
		sum[val] = solve(val - z - 1, a);
		number += sum[z] + sum[val];
		if (number < k&&res == -1)
			res = i + 1;
		rt[lt[val]] = z; lt[z] = lt[val];
		rt[z] = val;
		lt[val] = z;
		s.insert(z);
	}
	cout << res << finl;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define  ll long long
#define  ull unsigned long long
#define  ul unsigned long
#define all(v) v.begin(),v.end()
#define sz(n) (int)n.size()
#define pb(s) push_back(s);
#define format(n) fixed<<setprecision(n)
#define finl "\n"
#define Mohammed_Atef_Hassan fast();
#define INF LLONG_MAX
#define PI acos(-1)
#define clr(dp,n) memset(dp,n,sizeof dp)
#define ex(n) return cout<<n<<finl,0;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
void fast() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifdef ONLINE_JUDGE
	//	freopen("palindrome.in", "r", stdin);

	//freopen("palindrome.out", "w", stdout);
#endif
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
}
int vis[5];
int lt[(int)2e5 + 10], rt[(int)2e5 + 10];
int sum[(int)2e5 + 10];
int solve(int sz, int a)
{
	int l = 1, r = 2e5 + 10; int res = 0;
	while (l <= r)
	{
		int mid = (l + r) >> 1;
		if (mid*a + mid - 1 <= sz)
		{
			res = mid;
			l = mid + 1;
		}
		else r = mid - 1;
	}
	return res;
}
int main()
{
	Mohammed_Atef_Hassan
		int n, k, a,m,z;
	cin >> n >> k >> a;
	rt[0] = n + 1; lt[n + 1] = 0;
	sum[n + 1] = solve(n, a);
	int number = sum[n + 1];
	set<int>s = { 0,n + 1 };
	int res = -1;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> z;
		int val = *s.lower_bound(z);
		number -= sum[val];
		sum[z] = solve(z - lt[val]-1,a);
		sum[val] = solve(val - z - 1, a);
		number += sum[z] + sum[val];
		if (number < k&&res == -1)
			res = i + 1;
		rt[lt[val]] = z; lt[z] = lt[val];
		rt[z] = val;
		lt[val] = z;
		s.insert(z);
	}
	cout << res << finl;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define  ll long long
#define  ull unsigned long long
#define  ul unsigned long
#define all(v) v.begin(),v.end()
#define sz(n) (int)n.size()
#define pb(s) push_back(s);
#define format(n) fixed<<setprecision(n)
#define finl "\n"
#define Mohammed_Atef_Hassan fast();
#define mod 1000000007
#define INF LLONG_MAX
#define PI acos(-1)
#define clr(dp,n) memset(dp,n,sizeof dp)
#define ex(n) return cout<<n<<finl,0;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
void fast() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifdef ONLINE_JUDGE
	//	freopen("palindrome.in", "r", stdin);

	//freopen("palindrome.out", "w", stdout);
#endif
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	 freopen("output.out", "w", stdout);
#endif
}
int p[(int)2e5 + 10];
int solve(ll n,ll x,ll k,ll a)
{
	int l = x, r = n; int res = -1;
	while (l <= r)
	{
		int mid = (l + r) / 2;
		if (n - mid >= k * a + max(k - 1,0LL))
		{
			res = mid;
			l = mid + 1;
		}
		else
			r = mid - 1;
	}
	return res;
}
int q[(int)2e5 + 10];
int main()
{
	Mohammed_Atef_Hassan
		int n;ll k, a;
	cin >> n >> k >> a;
	int x = 0; bool b = true;
	if (a*k + max(k - 1, 0LL) > n)b = false;
	for (int i = 1; i <= n&&b; i++)
	{
		ll ret=solve(n, i, k, a);
		if (ret != -1)
			p[i]++, p[ret + 1]--;
		if (i - x==a)
			x = i+1, k--;
	}
	for (int i = 1; i <= n; i++)p[i] += p[i - 1];
	int qq;
	cin >> qq;
	for (int i = 0; i < qq; i++)cin >> q[i];
	for (int i = 0; i<qq; i++)
	{
		if (p[q[i]] == 0)ex(i+1);
	}
	ex(-1);
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define  ll long long
#define  ull unsigned long long
#define  ul unsigned long
#define all(v) v.begin(),v.end()
#define sz(n) (int)n.size()
#define pb(s) push_back(s);
#define format(n) fixed<<setprecision(n)
#define finl "\n"
#define Mohammed_Atef_Hassan fast();
#define mod 1000000007
#define INF LLONG_MAX
#define PI acos(-1)
#define clr(dp,n) memset(dp,n,sizeof dp)
#define ex(n) return cout<<n<<finl,0;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
void fast() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);

#ifdef ONLINE_JUDGE
	//	freopen("palindrome.in", "r", stdin);

	//freopen("palindrome.out", "w", stdout);
#endif
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	 freopen("output.out", "w", stdout);
#endif
}
int p[(int)2e5 + 10];
int solve(ll n,ll x,ll k,ll a)
{
	int l = x, r = n; int res = -1;
	while (l <= r)
	{
		int mid = (l + r) / 2;
		if (n - mid >= k * a + max(k - 1,0LL))
		{
			res = mid;
			l = mid + 1;
		}
		else
			r = mid - 1;
	}
	return res;
}
int q[(int)2e5 + 10];
int main()
{
	Mohammed_Atef_Hassan
		int n;ll k, a;
	cin >> n >> k >> a;
	int x = 0; bool b = true;
	for (int i = 1; i <= n; i++)
	{
		ll ret=solve(n, i, k, a);
		if (ret != -1)
			p[i]++, p[ret + 1]--;
		if (i - x==a)
			x = i+1, k--;
	}
	for (int i = 1; i <= n; i++)p[i] += p[i - 1];
	int qq;
	cin >> qq;
	for (int i = 0; i < qq; i++)cin >> q[i];
	for (int i = 0; i<qq; i++)
	{
		if (p[q[i]] == 0)ex(i+1);
	}
	ex(-1);
}


#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
#define CLR(a,b) memset(a,b,sizeof(a))
#define LL long long
int num[200000+5];
int main()
{
    int n,k,a;
    scanf ("%d %d %d",&n,&k,&a);
    int m;
    scanf ("%d",&m);
    for (int i = 1 ; i <= m ; i++)
        scanf ("%d",&num[i]);
    int ans = -1;
    int ant = (n+1) / (a+1);        //可以放战舰的数量
    set<int> d;
    d.insert(0);
    d.insert(n+1);      //加入上下界
    set<int>::iterator up,down;
    for (int i = 1 ; i <= n ; i++)
    {
        up = d.upper_bound(num[i]);
        down = --up;
        up++;
        ant = ant - (*up - *down) / (a+1) + (num[i] - *down) / (a+1) + (*up - num[i]) / (a+1);
        d.insert(num[i]);
        if (ant < k)
        {
            ans = i;
            break;
        }
    }
    printf ("%d\n",ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector<int >re;
set<int > s;
set<int >::iterator up,down;
int main()
{
    int n,k,a,m;
    cin >> n >>k>> a>> m;
    for(int i=0;i<m;i++)
    {
        int mid;
        scanf("%d",&mid);
        re.push_back(mid);
    }
    s.insert(0);
    s.insert(n+1);
    int cnt=(n+1)/(a+1);
    int ans=-1;
    for(int i=0;i<m;i++)
    {
        int mid=re[i];
        up=s.upper_bound(mid);
        down=(--up);
        up++;
        cnt=cnt-(*up-*down)/(a+1)+(mid-*down)/(a+1)+(*up-mid)/(a+1);
        s.insert(mid);
        if(cnt<k)
        {
            ans=i+1;
            break;
        }
    }
    cout <<ans <<endl;
}


#include <bits/stdc++.h>
using namespace std;
vector<int >re;
set<int > s;
set<int >::iterator up,down;
int main()
{
    int n,k,a,m;
    cin >> n >>k>> a>> m;
    for(int i=0;i<m;i++)
    {
        int mid;
        scanf("%d",&mid);
        re.push_back(mid);
    }
    s.insert(0);
    s.insert(n+1);
    int cnt=(n+1)/(a+1);
    int ans=-1;
    for(int i=0;i<m;i++)
    {
        int mid=re[i];
        up=upper_bound(s.begin(),s.end(),mid);
        down=(--up);
        up++;
        cnt=cnt-(*up-*down)/(a+1)+(mid-*down)/(a+1)+(*up-mid)/(a+1);
        s.insert(mid);
        if(cnt<k)
        {
            ans=i+1;
            break;
        }
    }
    cout <<ans <<endl;
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")
#pragma GCC optimize ("-fno-defer-pop")
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ipr pair<ll,ll>
#define ps push_back
#define fs first
#define sc second
#define endl "\n"
#define mod 1000000007
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	ll	i,j,k,l,n,a;
	cin>>n>>k>>a;
	ll m;
	cin>>m;
	ll ar[m];
	for(i=0;i<m;i++){
		cin>>ar[i];
	}

	if(n>=(a*k+(k-1))){
		//cout<<"@#";
		if(n%2==0){
			k=(n/2); l=(n/2)-1;
			int f=-1;
			for(i=0;i<m;i++){
				if(ar[i]==k){
					f=i+1;
					break;
				}
			}
			if(f!=-1){
				cout<<f;
			}
			else cout<<f;
		}
		else {
			k=ceil((n*1.0)/2.0);
			int f=-1;
			for(i=0;i<m;i++){
				if(ar[i]==k){
					f=i+1;
					break;
				}
			}
			if(f!=-1){
				cout<<f;
			}
			else cout<<f;
		}
	}
	else {
		cout<<"-1";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")
#pragma GCC optimize ("-fno-defer-pop")
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ipr pair<ll,ll>
#define ps push_back
#define fs first
#define sc second
#define endl "\n"
#define mod 1000000007
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	ll i,j,k,l,r,n,a;
	cin>>n>>k>>a;
	ll m;
	cin>>m;
	ll ar[m];
	for(i=0;i<m;i++){
		cin>>ar[i];
	}

	set< pair<ll,ll> > st;
	st.insert({n,1});
	ll an=(r-l+2)/(a+1);

	for(i=0;i<m;i++){
		auto it=st.lower_bound({ar[i],-1});
		l=it->sc; r=it->fs;
		ll x=ar[i];
		an-=(r-l+2)/(a+1);
		if(x-1>=l)
			an+=((x-1)-l+2)/(a+1);
		if(x+1<=r)
			an+=(r-(x+1)+2)/(a+1);

		if(an<k){
			cout<<(i+1);
			return 0;
		}
		st.erase(it);
		if(x-1>=l){
			st.insert({x-1,l});
		}
		if(x+1<=r){
			st.insert({x+1,r});
		}
	}
	cout<<"-1";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")
#pragma GCC optimize ("-fno-defer-pop")
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ipr pair<ll,ll>
#define ps push_back
#define fs first
#define sc second
#define endl "\n"
#define mod 1000000007
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	ll	i,j,k,l,n,a;
	cin>>n>>k>>a;
	ll m;
	cin>>m;
	ll ar[m];
	for(i=0;i<m;i++){
		cin>>ar[i];
	}

	if(n>=(a*k+(k-1))&&n<=(a*k+(k-1)+2)){
		//cout<<"@#";
		if(n%2==0){
			k=(n/2); l=(n/2)-1;
			int f=-1;
			for(i=0;i<m;i++){
				if(ar[i]==k){
					f=i+1;
					break;
				}
			}
			if(f!=-1){
				cout<<f;
			}
			else cout<<f;
		}
		else {
			k=ceil((n*1.0)/2.0);
			int f=-1;
			for(i=0;i<m;i++){
				if(ar[i]==k){
					f=i+1;
					break;
				}
			}
			if(f!=-1){
				cout<<f;
			}
			else cout<<f;
		}
	}
	else {
		cout<<"-1";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")
#pragma GCC optimize ("-fno-defer-pop")
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ipr pair<ll,ll>
#define ps push_back
#define fs first
#define sc second
#define endl "\n"
#define mod 1000000007
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	ll i,j,k,l,r,n,a;
	cin>>n>>k>>a;
	ll m;
	cin>>m;
	ll ar[m];
	for(i=0;i<m;i++){
		cin>>ar[i];
	}

	set< pair<ll,ll> > st;
	st.insert({n,1});
	ll an=(n-1+2)/(a+1);

	for(i=0;i<m;i++){
		auto it=st.lower_bound({ar[i],-1});
		l=it->sc; r=it->fs;
		ll x=ar[i];
		an-=(r-l+2)/(a+1);
		if(x-1>=l)
			an+=((x-1)-l+2)/(a+1);
		if(x+1<=r)
			an+=(r-(x+1)+2)/(a+1);

		if(an<k){
			cout<<(i+1);
			return 0;
		}
		st.erase(it);
		if(x-1>=l){
			st.insert({x-1,l});
		}
		if(x+1<=r){
			st.insert({r,x+1});
		}
	}
	cout<<"-1";
	return 0;
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) == 1)cout << -1 << " " << -1 << endl;
	else {
		cout << a << " " << b << endl;
	}
	}
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw=0;
	cin >> a >> b;
	For(i, a, b) {
		if (sw == 1)break;
		RFor(j, b) {
			if (lcm(i, j) < b) {
				cout << i << " " << j << endl;
				sw++;
				break;
			}
		}
	}
		if (sw == 0)cout << -1 << " " << -1;
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) <=1)cout << -1 << " " << -1 << endl;
	else {
				cout <<a << " " << a*2 << endl;

	}
	}
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) == 1)cout << -1 << " " << -1 << endl;
	else {
		cout << a << "" << a + 1 << endl;
	}
	}
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) <=1)cout << -1 << " " << -1 << endl;
	else {
				cout <<a << " " << a << endl;

	}
	}
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) <=1)cout << -1 << " " << -1 << endl;
	else {
				cout <<a << " " << b << endl;

	}
	}
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) == 1)cout << -1 << " " << -1 << endl;
	else {
	For(i, a, b) {
		if (sw == 1)break;
		RFor(j, b+1) {
			if (lcm(i, j) <= b) {
				cout << i << " " << j << endl;
				sw++;
				break;
			}
		}
	}

	} }
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (abs(a - b) == 1)cout << -1 << " " << -1 << endl;
	else {
	For(i, a, b) {
		if (sw == 1)break;
		For(j,i+1, b+1) {
			if (lcm(i, j) <= b) {
				cout << i << " " << j << endl;
				sw++;
				break;
			}
		}
	}

	} }
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;

int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	if (a * 2 > b)cout << -1 << " " << -1 << endl;
	else cout << a << " " << a * 2 << endl;
	}
}


#include<bits\stdc++.h>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define int long long int
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tcase int tt; cin>>tt; while (tt--)
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<" "; }
#define pb push_back
#define ve vector<int>
#define mp make_pair
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define RFor(i, n) for (int i = (n) - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define rSort(x) sort(all(x), greater<int>());
#define Sort(x) sort(all(x));
#define tos(x) to_string(x);
using namespace std;
int gcd(int a, int b)
{
	if (a == 0)
		return b;
	return gcd(b % a, a);
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}
int32_t main() {
	tcase{
		int a,b,sw = 0;
	cin >> a >> b;
	For(i, a, b) {
		if (sw == 1)break;
		RFor(j, b) {
			if (lcm(i, j) < b) {
				cout << i << " " << j << endl;
				sw++;
				break;
			}
		}
	}
		if (sw == 0)cout << -1 << " " << -1;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
signed main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		int x,y;
		if(r%2==1) r--;
		y=r;
		x=y/2;
		int lcm=x*y/gcd(x,y);
		if(lcm>=l && lcm<=r && x>=l && y<=r && x<y) cout<<x<<" "<<y<<"\n";
		else cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		bool flag=0;
		int j=l+1;
		while(j<=r)
		{
			if(j%l==0)
			{
				cout<<l<<" "<<j<<"\n";
				flag=1;
				break;
			}
			else j++;
		}
		if(!flag) cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <iostream>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		int x,y;
		bool flag=0;
		for(int i=l;i<=r;i++)
		{
			int lcm=l*(i+1)/gcd(l,i+1);
			if(lcm>=l && lcm<=r)
			{
				cout<<l<<" "<<i+1<<"\n";
				flag=1;
				break;
			}
		}
		if(!flag) cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		int x,y;
		if(r%2==1) r--;
		x=r/2;
		y=r;
		if(x*y/gcd(x,y)>=l && x*y/gcd(x,y)<=r && x>=l && y<=r && x<y) cout<<x<<" "<<y<<"\n";
		else cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		bool flag=0;
		while(r>l)
		{
			int lcm=l*r/gcd(l,r);
			if(lcm>=l && lcm<=r)
			{
				cout<<l<<" "<<r<<"\n";
				flag=1;
				break;
			}
			else r--;
		}
		if(!flag) cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		bool flag=0;
		while(r>l)
		{
			if(r%l==0)
			{
				cout<<l<<" "<<r<<"\n";
				flag=1;
				break;
			}
			else r--;
		}
		if(!flag) cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		int x,y;
		bool flag=0;
		for(int i=l+1;i<=r;i++)
		{
			int lcm=l*(i)/gcd(l,i);
			if(lcm>=l && lcm<=r)
			{
				cout<<l<<" "<<i<<"\n";
				flag=1;
				break;
			}
		}
		if(!flag) cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int l,r;
		cin>>l>>r;
		bool flag=0;
		int j=l+1;
		while(j<=r)
		{
			int lcm=l*j/gcd(l,j);
			if(lcm<=r)
			{
				cout<<l<<" "<<j<<"\n";
				flag=1;
				break;
			}
			else j++;
		}
		if(!flag) cout<<-1<<" "<<-1<<"\n";
	}
	exit(0);
}


  #include <iostream>
  #include <iomanip>
  using namespace std;

  int main()
  {
  #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
  #endif

    int t;
    cin >> t;
    while (t--)
    {
      int x, y;
      cin >> x >> y;

     if(x<=(y/2))
     {
        cout<<(x/2)<<" "<<x<<endl;
     }
     else
      cout<<-1<<" "<<-1;
    }

  }


#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
#endif

  int t;
  cin >> t;
  while (t--)
  {
    int x, y;
    cin >> x >> y;

    if (x <= y/2)
    {
      cout << x*2 << " " << (x) << endl;
    }
    else
      cout << -1 << " " << -1<<endl;
  }

}


  #include <iostream>
  #include <iomanip>
  using namespace std;

  int main()
  {
  #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
  #endif

    int t;
    cin >> t;
    while (t--)
    {
      int x, y;
      cin >> x >> y;

     if(x<=(y/2))
     {
        cout<<x<<" "<<(x*2)<<endl;
     }
     else
      cout<<-1<<" "<<-1;
    }

  }


  #include <iostream>
  #include <iomanip>
  using namespace std;

  int main()
  {
  #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
  #endif

    int t;
    cin >> t;
    while (t--)
    {
      int x, y;
      cin >> x >> y;

     if(x*2<=(y))
     {
        cout<<x<<" "<<(x*2)<<endl;
     }
     else
      cout<<-1<<" "<<-1;
    }

  }


#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
#endif

  int t;
  cin >> t;
  while (t--)
  {
    int x, y;
    cin >> x >> y;

    if (x <= y/2)
    {
      cout << x << " " << (x * 2) << endl;
    }
    else
      cout << -1 << " " << -1<<endl;
  }

}


#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
#endif

  int t;
  cin >> t;
  while (t--)
  {
    int x, y;
    cin >> x >> y;

    if (x * 2 <= y)
    {
      cout << x << " " << (x * 2) << endl;
    }
    else
      cout << -1 << " " << -1<<endl;
  }

}


#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
#endif

  int t;
  cin >> t;
  while (t--)
  {
    int x, y;
    cin >> x >> y;

    if (x <= (y / 2))
      cout << (y / 2) << " " << (y / 2) << endl;
    else
      cout << -1 << " " << -1 << endl;
  }

}


  #include <iostream>
  #include <iomanip>
  using namespace std;

  int main()
  {
  #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
  #endif

    int t;
    cin >> t;
    while (t--)
    {
      int x, y;
      cin >> x >> y;

     if(x<=(y<<1))
     {
        cout<<(x<<1)<<" "<<x<<endl;
     }
     else
      cout<<-1<<" "<<-1;
    }

  }


  #include <iostream>
  #include <iomanip>
  using namespace std;

  int main()
  {
  #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
  #endif

    int t;
    cin >> t;
    while (t--)
    {
      int x, y;
      cin >> x >> y;

     if(x<=(y/2))
     {
        cout<<(x)<<" "<<x/2<<endl;
     }
     else
      cout<<-1<<" "<<-1;
    }

  }


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    for(ll i=0;i<abs(r-l);++i){
        lcm = (x*y)/gcd(x,y);
        if(l<=lcm and lcm<=r){
            flag=1;
            break;
        }
        else
            y--;
    }
    if(flag)
        cout<<x<<" "<<y<<'\n';
    else
        cout<<"-1 -1"<<'\n';
}

int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    for(ll i=0;i<abs(r-l);++i){
        lcm = std::lcm(x,y);
        if(l<=lcm and lcm<=r){
            flag=1;
            break;
        }
        else
            y--;
    }
    if(flag)
        cout<<x<<" "<<y<<'\n';
    else
        cout<<"-1 -1"<<'\n';
}

int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    for(ll i=0;i<r-l;++i){
        lcm = (x*y)/gcd(x,y);
        if(l<=lcm and lcm<=r ){
            flag = 1;
            break;
        }
        else
            x++,y--;
    }
    if(flag)
        cout<<x<<" "<<y<<'\n';
    else
        cout<<-1<<" "<<-1<<'\n';
}
int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
void solution(){
    ll l,r;
    cin>>l>>r;
    if(abs(l-r) > 1)
        cout<<l+1<<" "<<r-1<<'\n';
    else
        cout<<"-1 -1"<<'\n';
}
int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    for(ll i=0;i<r-l;++i){
        lcm = (x*y)/gcd(x,y);
        if(l<=lcm and lcm<=r){
            flag = 1;
            break;
        }
        else
            x++,y--;
    }
    if(flag)
        cout<<l<<" "<<r<<'\n';
    else
        cout<<-1<<" "<<-1<<'\n';
}
int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    while(x < y){
        lcm = (x*y)/gcd(x,y);
        if(l<=lcm and lcm<=r){
            flag=1;
            break;
        }
        else
            y--;
    }
    if(flag)
        cout<<x<<" "<<y<<'\n';
    else
        cout<<"-1 -1"<<'\n';
}

int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    for(ll i=0;i<r-l;++i){
        lcm = (x*y)/gcd(x,y);
        if(l<=lcm and lcm<=r and x !=y){
            flag = 1;
            break;
        }
        else
            x++,y--;
    }
    if(flag)
        cout<<x<<" "<<y<<'\n';
    else
        cout<<-1<<" "<<-1<<'\n';
}
int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
void solution(){
    ll l,r;
    cin>>l>>r;
    ll x=l,y=r;
    ll lcm = 0;
    ll flag=0;
    lcm = (x*(y-(y%x)))/gcd(x,y-y%x);
    if((l<=lcm and lcm<=r) and x !=y-(y%x))
        cout<<x<<" "<<y-y%x<<'\n';
    else
        cout<<"-1 -1"<<'\n';
}

int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cerr.tie(0);
        ll t;
        cin>>t;
        while(t--)
                solution();
        return 0;
}


#include<iostream>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int a,b;
		cin>>a>>b;
		if(2*a<=b){
			cout<<a<<" "<<2*a<<endl;
		}
		else{
			cout<<-1<<" "<<-1<<endl;
		}
	}
}


#include<iostream>
using namespace std;
int gcd(int a, int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

// Function to return LCM of two numbers
  int lcm(int a, int b)
 {
    return (a*b)/gcd(a, b);
 }
int main(){
	int t;
	cin>>t;
	while(t--){
	int a,b;
	cin>>a>>b;
	int x=-1, y=-1;
	for(int i=a;i<=b;i++){
		for(int j=i+1;j<=b;j++){
			if(lcm(i,j)>=a && lcm(i,j)<=b){
				x=i;
				y=j;
				break;
			}
		}
	}
			cout<<x<<" "<<y<<endl;

}
}


#include<iostream>
using namespace std;
int gcd(int a, int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

// Function to return LCM of two numbers
  int lcm(int a, int b)
 {
    return (a*b)/gcd(a, b);
 }
int main(){
	int t;
	cin>>t;
	while(t--){
	int a,b;
	cin>>a>>b;
	int x=-1, y=-1;
	for(int i=a+1;i<=b;i++){
			if(lcm(a,i)>=a && lcm(a,i)<=b){
				y=i;
				x=a;
				break;
			}

	}
			cout<<x<<" "<<y<<endl;

}
}


#include<iostream>
using namespace std;
int gcd(int a, int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

// Function to return LCM of two numbers
  int lcm(int a, int b)
 {
    return (a*b)/gcd(a, b);
 }
int main(){
	int t;
	cin>>t;
	while(t--){
	int a,b;
	cin>>a>>b;
	int x=-1, y=-1;
	for(int i=a;i<b;i++){
		for(int j=i+1;j<=b;j++){
			if(lcm(i,j)>=a && lcm(i,j)<=b){
				x=i;
				y=j;
				break;
			}
		}
	}
			cout<<x<<" "<<y<<endl;

}
}


#include<iostream>
using namespace std;
int gcd(int a, int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

// Function to return LCM of two numbers
  int lcm(int a, int b)
 {
    return (a*b)/gcd(a, b);
 }
int main(){
	int t;
	cin>>t;
	while(t--){
	int a,b;
	cin>>a>>b;
	int x=-1, y=-1;
	for(int i=a;i<=b;i++){
		for(int j=i+1;j<b;j++){
			if(lcm(i,j)>=a && lcm(i,j)<=b){
				x=i;
				y=j;
				break;
			}
		}
	}
			cout<<x<<" "<<y<<endl;

}
}


#include<iostream>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int a,b;
		cin>>a>>b;
		if(a==b || b==a+1){
			cout<<-1<<endl;
		}
		else{
			cout<<a<<" "<<b<<endl;
		}
	}
}


#include<iostream>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int a,b;
		cin>>a>>b;
		if(a==b || b-a<=2){
			cout<<-1<<endl;
		}
		else{
			cout<<a+1<<" "<<b-1<<endl;
		}
	}
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int a,b;
		cin>>a>>b;
		if((2*a)<=b){
			cout<<a<<" "<<2*a<<endl;
		}
		else
		cout<<-1<<" "<<-1<<endl;
	}
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
ll t,n,i,j,a,b,k,x,y;
 ll lcM(ll a, ll b)
 {
    return (a*b)/gcd(a, b);
 }
int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

  cin>>t;
  while(t--){
      x=-1;
      y=-1;

      ll h=0;
      cin>>a>>b;
      for(i=a;i<b+1;i++){
          if(h==1)
          break;
          for(j=i+1;j<b+1;j++){k=lcM(i,j);
              if(k>=a&&k<=b){
                  x=i;
                  y=j;
                  h=1;
                  break;
              }
          }
      }

      cout<<x<<" "<<y<<endl;

  }
    return 0;
}


#include<iostream>
using namespace std;
#define ll long long
ll t,n,i,j,a,b,k,x,y;
 ll lcM(ll a, ll b)
 {
    return (a*b)/gcd(a, b);
 }
int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

  cin>>t;
  while(t--){
      x=-1;
      y=-1;

      ll h=0;
      cin>>a>>b;
      for(i=a;i<b+1;i++){
          if(h==1)
          break;
          for(j=i+1;j<b+1;j++){k=lcM(i,j);
              if(k>=a&&k<=b){
                  x=i;
                  y=j;
                  h=1;
                  break;
              }
          }
      }

      cout<<x<<" "<<y<<endl;

  }
    return 0;
}


#include <iostream>
#include <boost/math/common_factor.hpp>

using namespace std;
#define ll long long
ll t,n,i,j,a,b,k,x,y;
int main() {

  cin>>t;
  while(t--){
      x=-1;
      y=-1;

      ll h=0;
      cin>>a>>b;
      for(i=a;i<b+1;i++){
          if(h==1)
          break;
          for(j=i+1;j<b+1;j++){k=boost::math::lcm(i,j);
              if(k>=a&&k<=b){
                  x=i;
                  y=j;
                  h=1;
                  break;
              }
          }
      }
      if(x==-1)
      cout<<"-1"<<endl;
      else
      cout<<x<<" "<<y<<endl;

  }}


#include <iostream>
#include <numeric>

using namespace std;
#define ll long long
ll t,n,i,j,a,b,k,x,y;
int main() {

  cin>>t;
  while(t--){
      x=-1;
      y=-1;

      ll h=0;
      cin>>a>>b;
      for(i=a;i<b+1;i++){
          if(h==1)
          break;
          for(j=i+1;j<b+1;j++){k=std::lcm(i,j);
              if(k>=a&&k<=b){
                  x=i;
                  y=j;
                  h=1;
                  break;
              }
          }
      }

      cout<<x<<" "<<y<<endl;

  }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
ll t,n,i,j,a,b,k,x,y;
 ll lcM(ll a, ll b)
 {
    return (a*b)/gcd(a, b);
 }
int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

  cin>>t;
  while(t--){
      x=-1;
      y=-1;

      ll h=0;
      cin>>a>>b;
      if(b>=2*a)
    {  x=a;
      y=2*a;}

      cout<<x<<" "<<y<<endl;

  }
    return 0;
}