#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <limits.h>
#include <set>
#include <string>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <deque>
#include <map>
#include <chrono>
#include <random>
#include <bitset>
#include <tuple>
#define SZ(x) int(x.size())
#define FR(i,a,b) for(int i=(a);i<(b);++i)
#define FOR(i,n) FR(i,0,n)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define A first
#define B second
#define mp(a,b) make_pair(a,b)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef unsigned __int128 U128;
typedef __int128 I128;
typedef std::pair<int,int> PII;
typedef std::pair<LL,LL> PLL;
using namespace std;
signed main(){
int p,n; cin>>p>>n;
if (p==1){
int k=n;
cout<<k<<"\n";
FR(i,1,n){
int a; cin>>a;
cout<<i<<"\n";
}
}
if (p==2){
int ord[n+1];
memset(ord,-1,sizeof(ord));
int g1=-1, g2=-1;
FR(i,1,n+1){
int a; cin>>a;
if (ord[a]!=-1){
g1=i;
g2=ord[a];
}
else ord[a]=i;
}
cout<<g1<<" "<<g2;
}
return 0;
}