#include <bits/stdc++.h>
using namespace std;
int N;
int bad[20];
bool graph[20][20];
long long dp[(1 << 16)];
long long func(void) {
  int mask, i, j;
  for ((mask) = 0; (mask) < (int)((1 << N)); (mask)++) dp[mask] = 0;
  dp[0] = 1;
  for ((mask) = 0; (mask) < (int)((1 << N)); (mask)++)
    if (dp[mask] > 0) {
      int cnt = __builtin_popcount(mask);
      for ((i) = 0; (i) < (int)(N); (i)++)
        if (graph[i][cnt] && !(mask & (1 << i)) && !(mask & bad[i])) {
          long long tmp = dp[mask ^ (1 << i)] + dp[mask];
          if (tmp >= (1ll << 60)) tmp = (1ll << 60);
          dp[mask ^ (1 << i)] = tmp;
        }
    }
  return dp[(1 << N) - 1];
}
int main(void) {
  int K, i, j, a, b;
  long long X;
  cin >> N >> X >> K;
  X -= 2001;
  for ((i) = 0; (i) < (int)(K); (i)++) {
    cin >> a >> b;
    bad[a - 1] |= (1 << (b - 1));
  }
  for ((i) = 0; (i) < (int)(N); (i)++)
    for ((j) = 0; (j) < (int)(N); (j)++) graph[i][j] = true;
  long long total = func();
  if (!(X < total)) {
    cout << "The times have changed" << endl;
    return 0;
  }
  for ((i) = 0; (i) < (int)(N); (i)++) {
    int low = 0, high = N;
    while (high - low > 1) {
      int mid = (low + high) / 2;
      for ((j) = 0; (j) < (int)(N); (j)++) graph[i][j] = (j < mid);
      if (X < func())
        high = mid;
      else
        low = mid;
    }
    for ((j) = 0; (j) < (int)(N); (j)++) graph[i][j] = (j < low);
    X -= func();
    for ((j) = 0; (j) < (int)(N); (j)++) graph[i][j] = (j == low);
  }
  for ((i) = 0; (i) < (int)(N); (i)++) {
    for ((j) = 0; (j) < (int)(N); (j)++)
      if (graph[i][j]) cout << j + 1;
    if (i == N - 1)
      cout << endl;
    else
      cout << ' ';
  }
  return 0;
}
