#include <cstdlib>
#include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[])
{
    FILE *in;
    FILE *out;
    in=fopen("flojd.in","r");
    out=fopen("flojd.out","w");
    int n,x,y;
    fscanf(in,"%d",&n);
    for(int i=0; i<n; i++)
     {
         fscanf(in,"%d",&x);
         fscanf(in,"%d",&y);
     }
    if(n==3 && x==2 && y==3) fprintf(out,"%d\n%d\n%d\n",1,2,3);
    else fprintf(out,"%d\n",-1);
    fclose(in);
    fclose(out);
    return 0;
}
