#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000002;
const long long INFLL = 100000000000000000ll;
const long long MOD = 1000000007;
bool Forbid[20][20], R[20][20], Used[20];
int Curr[25], M;
long long DP[132000], Y;
string S;
vector<string> L;
vector<int> solve(int n, long long seek) {
  int actual[20];
  for (int i = (1); i <= (16); i++) actual[i] = i;
  int cnt = 0;
  for (int i = (1); i <= (16); i++) {
    if (Used[i]) continue;
    actual[cnt++] = i;
  }
  for (int first = (0); first <= (n - 1); first++) {
    if (Forbid[n - 1][actual[first]]) continue;
    for (int m = (0); m <= ((1 << n) - 1); m++) DP[m] = 0;
    DP[0] = 1;
    for (int m = (0); m <= ((1 << n) - 1); m++) {
      int turn = __builtin_popcount(m);
      if (turn == first) {
        bool can = true;
        for (int j = (0); j <= (n - 1); j++)
          if (m & (1 << j) && R[n - 1][j]) can = false;
        if (can) DP[m + (1 << (n - 1))] += DP[m];
      } else
        for (int i = (0); i <= (n - 1); i++)
          if (!(m & (1 << i))) {
            if (Forbid[i][actual[turn]]) continue;
            bool can = true;
            for (int j = (0); j <= (n - 1); j++)
              if (m & (1 << j) && R[i][j]) can = false;
            if (can) DP[m + (1 << i)] += DP[m];
          }
    }
    if (DP[(1 << n) - 1] >= seek) {
      for (int i = (0); i <= (n - 1); i++) {
        if (R[n - 1][i])
          for (int num = (0); num <= (actual[first] - 1); num++)
            Forbid[i][num] = true;
        if (R[i][n - 1])
          for (int num = (actual[first] + 1); num <= (16); num++)
            Forbid[i][num] = true;
      }
      Used[actual[first]] = true;
      vector<int> ret = {actual[first]};
      vector<int> temp = solve(n - 1, seek);
      for (int k : temp) ret.push_back(k);
      return ret;
    }
    seek -= DP[(1 << n) - 1];
  }
  return {};
}
int main() {
  int N;
  cin >> N >> Y >> M;
  for (int i = (1); i <= (M); i++) {
    int a, b;
    cin >> a >> b;
    R[N - a][N - b] = true;
  }
  vector<int> ans = solve(N, Y - 2000);
  if (ans.empty()) {
    cout << "The times have changed";
    return 0;
  }
  for (int k : ans) cout << k << " ";
  return 0;
  set<int> s;
  for (int i = (1); i <= (N); i++) s.insert(i);
  for (int k : ans) {
    int idx = 0;
    for (int num : s) {
      if (idx == k) {
        cout << num << " ";
        s.erase(num);
        break;
      }
      idx++;
    }
  }
}
