#include <bits/stdc++.h>
using namespace std;
int g[201][201], deg[201], seq[3001], n, m;
int ans[3001];
void dfs(int dep, int j) {
  if (dep == m + 1 && ans[m] == seq[0]) {
    if (j) {
      for (int i = 0; i <= m; ++i) {
        printf("%d%s", ans[i], i == m ? "" : " ");
      }
      printf("\n");
      exit(0);
    }
  } else {
    int a = ans[dep - 1];
    for (int i = j ? 1 : seq[dep]; i <= n; ++i) {
      if (g[a][i]) {
        int b = i;
        ans[dep] = b;
        deg[a] = !deg[a];
        deg[b] = !deg[b];
        g[a][b] = g[b][a] = 0;
        if (count(deg + 1, deg + n, 1) <= 2) {
          dfs(dep + 1, j ? 1 : i > seq[dep]);
        }
        deg[a] = !deg[a];
        deg[b] = !deg[b];
        g[a][b] = g[b][a] = 1;
      }
    }
  }
}
int main() {
  int a, b;
  scanf("%d%d", &n, &m);
  scanf("%d", &a);
  seq[0] = a;
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &b);
    g[a][b] = g[b][a] = 1;
    ++deg[a];
    ++deg[b];
    seq[i] = b;
    a = b;
  }
  for (int i = 1; i <= n; ++i) {
    deg[i] %= 2;
  }
  ans[0] = seq[0];
  dfs(1, 0);
  puts("No solution");
  return 0;
}
