//By prj22
#include<iostream>
#include<queue>
#include<stack>
#include<algorithm>
#include<set>
#include<cstdio>
class graph
{
//The class represents a directed graph
public :
std::vector< std::vector<int> > adj ; //The adjacencly list for the graph
int v ; //The number of vertices
int *indegree ; //The array to store the indegree of vertices
//Vertices are assumed to be starting with number 1
graph(int v)
{
this->v = v ; //Assigning the number of vertices
//Allocating memory to arrays
indegree = new int[v+1] ;
//Initialising the adjacency list
for(int i=0 ; i<=v ; i++)
{
std::vector<int> data ;
adj.push_back(data);
indegree[i] = 0 ; //Initialisation
}
}
void addEdge(int u , int v)
{
adj.at(u).push_back(v); //adding the edge u-->v
indegree[v]++ ; //Incrementing the indegree of v
}
void toposort()
{
std::set<int> q ; //Creating a set do that always smallest vertex is popped first
//Inserting in queue the vertices with indegree 0 (vertex indexing starting from 1)
for(int i=1 ; i<=v ; i++)
if(indegree[i] == 0)
q.insert(i);
int count = 0 ; //To count the number of vertices arranged in topological order
std::vector<int> topo_order ; //The vector to store the topological order of vertices
while(!q.empty())
{
int vertex = *q.begin() ; //Getting the first element of the set
q.erase(q.begin());
topo_order.push_back(vertex); //Adding the vertex to the ordering
//Iterating through all the neighbours of the vertex popped, decrementing their indegree by 1
//and if their indegree becomes 0, they are pushed onto queue
std::vector<int> neighbours = adj.at(vertex);
std::vector<int>::iterator it ;
for(it = neighbours.begin() ; it!=neighbours.end() ; ++it)
{
indegree[(*it)]--;
if(indegree[(*it)] == 0)
q.insert(*it);
}
count++; //Incrementing the count of vertex added to topological order
}
if(count != v) //Then all the vertex have not beem emtered and there is a cycle in the directed graph
printf("Sandro fails.\n");
else
{
for(int i=0 ; i<topo_order.size() ; ++i)
printf("%d ",topo_order[i]);
printf("\n");
}
}
};
int main()
{
int n , m , u , v ;
scanf("%d%d",&n,&m);
graph g(n);
for(int i=0 ; i<m ; i++)
{
scanf("%d%d",&u,&v);
g.addEdge(u,v);
}
g.toposort();
return 0 ;
}