static int N, M, indegree[], u, v;
static StringBuilder sb = new StringBuilder(); // 위상정렬 결과 저장
static Queue<Integer> q = new LinkedList<>();
static ArrayList<ArrayList<Integer>> list = new ArrayList<>();
static ArrayList<Integer> get = new ArrayList<>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt(); M = sc.nextInt();
indegree = new int[N+1];
for(int i=0; i<=N; i++){list.add(new ArrayList<>());}
// 1. 모든 간선을 읽으며 indegree[]를 채운다.
for(int i=0; i<M; i++){
u = sc.nextInt(); v = sc.nextInt();
list.get(u).add(v); // u가 v보다 앞에 있어야 함
indegree[v]++; // indegree 값 1 증가
}
// 2. indegree가 0인 정점들을 모두 큐에 넣는다.
for(int i=1; i<=N; i++){if(indegree[i]==0)q.add(i);}
// 3. 큐가 빌 때까지 반복수행한다.
while(!q.isEmpty()){
// 3-1. 큐에서 정점을 꺼내어 결과를 sb에 추가한다.
int node = q.poll();
sb.append(node + " ");
// 3-2. 정점과 연결된 모든 정점의 indegree 값을 1 감소시킨다.
get = list.get(node); // 정점과 연결된 모든 정점 리스트
for(int i=0; i<get.size(); i++){
int t = get.get(i);
indegree[t]--;
// indegree 값이 0이라면 큐에 추가한다.
if(indegree[t]==0) q.add(t);
}
}
System.out.println(sb);
}