#include <iostream>

using namespace std;

int main()
{
    int n, m;

    cin >> n >> m;

    int a, b, t;
    for (int i = 0; i < m; i++)
        cin >> a >> b >> t;

    int Mika, Laza;
    cin >> Mika >> Laza;

    cout << -1;

    return 0;
}