#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <map>
#include <algorithm>

#define REP(i,k,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define mp make_pair

using namespace std;

int main()
{

	int n,m;
	cin >> n >> m;

	vector<vector<char> > v;
	v.resize(n);
	map<char,int> ma;

	rep(i,n)
	{
		char c = '1'+i;
		ma[c] = 0;
	}

	bool isSelected[21];
	rep(i,21) isSelected[i] = false;


	rep(i,m)
	{
		char c1,c2;
		cin >> c1 >> c2;

		v[c1-'1'].pb(c2);
		ma[c2]++;
	}

	rep(i,n)
	{
		rep(j,n)
		{
			if(isSelected[j]) continue;
			char c = '1' + j;
			if(ma[c] == 0)
			{
				cout << c << endl;

				rep(k,v[j].size()) ma[v[j][k]]--;

				isSelected[j] = true;
			}
		}
	}

	return 0;
}