#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e6 + 5, mod = 1e9 + 7;
int dx[] = {0, 0, -1, 1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, -1, 1};
class Binary_Trie
{
struct Node
{
Node *bit[2];
int freq[2], idx;
Node()
{
memset(bit, 0, sizeof bit);
memset(freq, 0, sizeof freq);
idx = -1;
}
};
public:
Node *root = new Node();
Binary_Trie()
{
// insert(0);
}
void insert(int x, int j)
{
Node *cur = root;
for (int i = 30; ~i; i--)
{
int on = (((1 << i) & x) > 0);
if (cur->bit[on] == 0)
{
cur->bit[on] = new Node();
}
if (cur->idx == -1)
cur->idx = j;
cur->freq[on]++;
cur = cur->bit[on];
}
}
void remove(int x, int i, Node *cur)
{
if (!~i)
return;
int on = (((1 << i) & x) > 0);
remove(x, i - 1, cur->bit[on]);
cur->freq[on]--;
if (cur->freq[on] == 0)
{
delete cur->bit[on];
cur->bit[on] = 0;
}
}
int mx_xor(int x)
{
int ret = 0;
Node *cur = root;
for (int i = 30; ~i; i--)
{
int on = (((1 << i) & x) > 0);
if (cur->bit[on ^ 1] == 0)
{
cur = cur->bit[on];
}
else
{
cur = cur->bit[on ^ 1];
ret |= (1 << i);
}
}
return ret;
}
int query(int x)
{
int ret = 1e9;
Node *cur = root;
for (int i = 30; ~i; i--)
{
int on = (((1 << i) & x) > 0);
if (cur->bit[on] == 0)
{
break;
}
if (cur->bit[on ^ 1] != 0)
{
ret = min(ret, cur->freq[on ^ 1]);
}
cur = cur->bit[on];
}
return ret;
}
};
void solve()
{
int n, x;
cin >> n >> x;
int a[n];
Binary_Trie tr;
int mx = 0, st = -1;
for (int i = 0; i < n; i++)
{
cin >> a[i];
if (i)
a[i] ^= a[i - 1];
int ans = tr.query(a[i] ^ x);
if (ans != 1e9 && (!mx || (i - ans + 1) > mx))
mx = i - ans + 1, st = ans;
tr.insert(a[i], i);
}
cout << st + 1 << " " << mx;
}
int32_t main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
if (fopen("input.txt", "r"))
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
int t = 1;
// cin >> t;
while (t--)
{
solve();
cout << '\n';
}
return 0;
}