Arnie the Worm has finished eating an apple house yet again and decided to move. He made up his mind on the plan, the way the rooms are located and how they are joined by corridors. He numbered all the rooms from 1 to n. All the corridors are bidirectional.

Arnie wants the new house to look just like the previous one. That is, it should have exactly n rooms and, if a corridor from room i to room j existed in the old house, it should be built in the new one. 

We know that during the house constructing process Arnie starts to eat an apple starting from some room and only stops when he eats his way through all the corridors and returns to the starting room. It is also known that Arnie eats without stopping. That is, until Arnie finishes constructing the house, he is busy every moment of his time gnawing a new corridor. Arnie doesn't move along the already built corridors.

However, gnawing out corridors in one and the same order any time you change a house is a very difficult activity. That's why Arnie, knowing the order in which the corridors were located in the previous house, wants to gnaw corridors in another order. It is represented as a list of rooms in the order in which they should be visited. The new list should be lexicographically smallest, but it also should be strictly lexicographically greater than the previous one. Help the worm. 

Input

The first line contains two integers n and m (3 ≤ n ≤ 100, 3 ≤ m ≤ 2000). It is the number of rooms and corridors in Arnie's house correspondingly. The next line contains m + 1 positive integers that do not exceed n. They are the description of Arnie's old path represented as a list of rooms he visited during the gnawing. It is guaranteed that the last number in the list coincides with the first one.

The first room described in the list is the main entrance, that's why Arnie should begin gnawing from it.

You may assume that there is no room which is connected to itself and there is at most one corridor between any pair of rooms. However, it is possible to find some isolated rooms which are disconnected from others.

Output

Print m + 1 positive integers that do not exceed n. Those numbers are the description of the new path, according to which Arnie should gnaw out his new house. If it is impossible to find new path you should print out No solution. The first number in your answer should be equal to the last one. Also it should be equal to the main entrance.

Examples

Input

3 3
1 2 3 1


Output

1 3 2 1 

Input

3 3
1 3 2 1


Output

No solution
#include <bits/stdc++.h>
using namespace std;
typedef long long int64;
typedef unsigned long long uint64;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
typedef pair<int, int> ipair;
template <class T>
inline T lowbit(T n) {
  return (n ^ (n - 1)) & n;
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T euclide(T a, T b, T &x, T &y) {
  if (a < 0) {
    T d = euclide(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclide(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclide(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <class T>
inline vector<pair<T, int> > factorize(T n) {
  vector<pair<T, int> > R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      for (; n % i == 0; C++, n /= i)
        ;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
template <class T>
inline bool isPrimeNumber(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T eularFunction(T n) {
  vector<pair<T, int> > R = factorize(n);
  T r = n;
  for (int i = 0; i < R.size(); i++) r = r / R[i].first * (R[i].first - 1);
  return r;
}
const int MaxMatrixSize = 40;
template <class T>
inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize]) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << A[i][j];
    cout << endl;
  }
}
template <class T>
inline T checkMod(T n, T m) {
  return (n % m + m) % m;
}
template <class T>
inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}
template <class T>
inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize],
                      T A[MaxMatrixSize][MaxMatrixSize],
                      T B[MaxMatrixSize][MaxMatrixSize]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}
template <class T>
inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize],
                      T A[MaxMatrixSize][MaxMatrixSize],
                      T B[MaxMatrixSize][MaxMatrixSize]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}
template <class T>
inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize],
                      T _A[MaxMatrixSize][MaxMatrixSize],
                      T _B[MaxMatrixSize][MaxMatrixSize]) {
  T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}
template <class T>
inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize],
                         T A[MaxMatrixSize][MaxMatrixSize],
                         T B[MaxMatrixSize][MaxMatrixSize]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}
template <class T>
inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize],
                         T A[MaxMatrixSize][MaxMatrixSize],
                         T B[MaxMatrixSize][MaxMatrixSize]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}
template <class T>
inline T multiplyMod(T a, T b, T m) {
  return (T)((((int64)(a) * (int64)(b) % (int64)(m)) + (int64)(m)) %
             (int64)(m));
}
template <class T>
inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize],
                         T _A[MaxMatrixSize][MaxMatrixSize],
                         T _B[MaxMatrixSize][MaxMatrixSize]) {
  T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < n; k++)
        C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}
template <class T>
inline T powerMod(T p, int e, T m) {
  if (e == 0)
    return 1 % m;
  else if (e % 2 == 0) {
    T t = powerMod(p, e / 2, m);
    return multiplyMod(t, t, m);
  } else
    return multiplyMod(powerMod(p, e - 1, m), p, m);
}
double dist(double x1, double y1, double x2, double y2) {
  return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}
double distR(double x1, double y1, double x2, double y2) {
  return sqr(x1 - x2) + sqr(y1 - y2);
}
template <class T>
T cross(T x0, T y0, T x1, T y1, T x2, T y2) {
  return (x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0);
}
int crossOper(double x0, double y0, double x1, double y1, double x2,
              double y2) {
  double t = (x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0);
  if (fabs(t) <= eps) return 0;
  return (t < 0) ? -1 : 1;
}
bool isIntersect(double x1, double y1, double x2, double y2, double x3,
                 double y3, double x4, double y4) {
  return crossOper(x1, y1, x2, y2, x3, y3) * crossOper(x1, y1, x2, y2, x4, y4) <
             0 &&
         crossOper(x3, y3, x4, y4, x1, y1) * crossOper(x3, y3, x4, y4, x2, y2) <
             0;
}
bool isMiddle(double s, double m, double t) {
  return fabs(s - m) <= eps || fabs(t - m) <= eps || (s < m) != (t < m);
}
bool isUpperCase(char c) { return c >= 'A' && c <= 'Z'; }
bool isLowerCase(char c) { return c >= 'a' && c <= 'z'; }
bool isLetter(char c) { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; }
bool isDigit(char c) { return c >= '0' && c <= '9'; }
char toLowerCase(char c) { return (isUpperCase(c)) ? (c + 32) : c; }
char toUpperCase(char c) { return (isLowerCase(c)) ? (c - 32) : c; }
template <class T>
string toString(T n) {
  ostringstream ost;
  ost << n;
  ost.flush();
  return ost.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
int64 toInt64(string s) {
  int64 r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double toDouble(string s) {
  double r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
template <class T>
void stoa(string s, int &n, T A[]) {
  n = 0;
  istringstream sin(s);
  for (T v; sin >> v; A[n++] = v)
    ;
}
template <class T>
void atos(int n, T A[], string &s) {
  ostringstream sout;
  for (int i = 0; i < n; i++) {
    if (i > 0) sout << ' ';
    sout << A[i];
  }
  s = sout.str();
}
template <class T>
void atov(int n, T A[], vector<T> &vi) {
  vi.clear();
  for (int i = 0; i < n; i++) vi.push_back(A[i]);
}
template <class T>
void vtoa(vector<T> vi, int &n, T A[]) {
  n = vi.size();
  for (int i = 0; i < n; i++) A[i] = vi[i];
}
template <class T>
void stov(string s, vector<T> &vi) {
  vi.clear();
  istringstream sin(s);
  for (T v; sin >> v; vi.push_bakc(v))
    ;
}
template <class T>
void vtos(vector<T> vi, string &s) {
  ostringstream sout;
  for (int i = 0; i < vi.size(); i++) {
    if (i > 0) sout << ' ';
    sout << vi[i];
  }
  s = sout.str();
}
template <class T>
struct Fraction {
  T a, b;
  Fraction(T a = 0, T b = 1);
  string toString();
};
template <class T>
Fraction<T>::Fraction(T a, T b) {
  T d = gcd(a, b);
  a /= d;
  b /= d;
  if (b < 0) a = -a, b = -b;
  this->a = a;
  this->b = b;
}
template <class T>
string Fraction<T>::toString() {
  ostringstream sout;
  sout << a << "/" << b;
  return sout.str();
}
template <class T>
Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.b + q.a * p.b, p.b * q.b);
}
template <class T>
Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.b - q.a * p.b, p.b * q.b);
}
template <class T>
Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.a, p.b * q.b);
}
template <class T>
Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.b, p.b * q.a);
}
const int maxn = 100 + 5;
const int maxm = 2000 + 5;
int n, m;
bool g[maxn][maxn];
int p[maxm], a[maxm];
bool visited[maxn];
bool find_path(int src, int dest) {
  if (src == dest) return true;
  visited[src] = true;
  for (int i = 0; i < n; i++)
    if (g[src][i] && !visited[i] && find_path(i, dest)) return true;
  return false;
}
int get_next(int current, int opt) {
  int result = -1;
  for (int k = 0; k < n; k++) {
    int p = (opt) ? (n - 1 - k) : k;
    if (!g[current][p]) continue;
    g[current][p] = g[p][current] = false;
    result = p;
    memset(visited, false, sizeof(visited));
    bool is_bridge = !find_path(current, p);
    g[current][p] = g[p][current] = true;
    if (!is_bridge) return p;
  }
  return result;
}
vector<int> get_next_all(int current) {
  int result = -1;
  vector<int> ret;
  for (int p = 0; p < n; p++) {
    if (!g[current][p]) continue;
    g[current][p] = g[p][current] = false;
    result = p;
    memset(visited, false, sizeof(visited));
    bool is_bridge = !find_path(current, p);
    g[current][p] = g[p][current] = true;
    if (!is_bridge) ret.push_back(p);
  }
  if (((int)(ret.size())) == 0 && result >= 0) ret.push_back(result);
  return ret;
}
void get_opt(int *arr) {
  int *a = arr;
  while (1) {
    int current = *a;
    int next = get_next(current, 0);
    if (next < 0) break;
    *(++a) = next;
    g[current][next] = g[next][current] = false;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  memset(g, false, sizeof(g));
  for (int i = 0; i < m + 1; i++) scanf("%d", &p[i]);
  for (int i = 0; i < m + 1; i++) p[i]--;
  for (int i = 0; i < m + 1; i++) a[i] = p[i];
  bool is_good = false;
  for (int i = m - 1; i >= 0; i--) {
    g[a[i]][a[i + 1]] = g[a[i + 1]][a[i]] = true;
    int next = get_next(a[i], 1);
    if (next != a[i + 1]) {
      is_good = true;
      vector<int> h = get_next_all(a[i]);
      int next = -1;
      for (int j = 0; j < ((int)(h.size())); j++)
        if (h[j] > a[i + 1]) {
          next = h[j];
          break;
        }
      a[i + 1] = next;
      g[a[i]][a[i + 1]] = g[a[i + 1]][a[i]] = false;
      get_opt(a + i + 1);
      break;
    }
  }
  if (!is_good) {
    printf("No solution\n");
    return 0;
  }
  for (int i = 0; i <= m; i++) {
    if (i > 0) printf(" ");
    printf("%d", a[i] + 1);
  }
  printf("\n");
  return 0;
}
