#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <ctime>

const int iter = 100000;

using namespace std;

int main()
{
	srand(time(NULL));
	freopen("crystals.in", "r", stdin);
	freopen("crystals.out", "w", stdout);
	int n;
	cin >> n;
	vector<long long> a(n), b(n);
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++)
	{   
		cin >> b[i];
		if (a[i] == b[i])
		{
			 cout << "1\n" << i + 1 << "\n";
			 return 0;
		}	 
	}
	int j = 1;
	while (j < n - 1 && (a[0] - b[0])  * (a[j] - b[j]) > 0) j++;
	if (j == n - 1)
	{
		cout << "-1\n";
		return 0;
	}
	cout << 0 << endl;
	return 0;
}
