#include "islands.h"
#include <bits/stdc++.h>
#include <variant>
#include <vector>
using namespace std;
class dsu {
public:
vector<int> p;
int n;
dsu(int _n) : n(_n) {
p.resize(n);
iota(p.begin(), p.end(), 0);
}
int get(int x) {
if (p[x] == x) {
return x;
}
return (p[x] = get(p[x]));
}
bool unite(int x, int y) {
x = get(x);
y = get(y);
if (x != y) {
p[y] = x;
return true;
}
return false;
}
};
variant<bool, vector<int>> find_journey(int n, int m, vector<int> u, vector<int> v) {
vector<int> uu(2);
vector<int> z, o;
for (int i = 0; i < m; i++) {
++uu[u[i]];
if (u[i] == 0) {
z.push_back(i);
} else {
o.push_back(i);
}
}
if (uu[0] >= 2 && uu[1] >= 1) {
vector<int> ans;
ans.push_back(z[0]);
ans.push_back(o[0]);
ans.push_back(z[1]);
ans.push_back(z[0]);
ans.push_back(o[0]);
ans.push_back(z[1]);
return true;
}
return false;
}