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>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int a, b, c, d, i, j, n, m, k, last;
bool sm[101][101], was[101][101], bad[101][101], br[101][101];
int mas[2006], st[4006];
vector<int> sm2[101];
vector<int> cur(0);
bool used[101];
int ls[101];
pair<int, int> bd[4006];
void dfs(int v) {
  if (used[v]) return;
  used[v] = 1;
  for (int _n(((int)((sm2[v]).size())) - 1), i(0); i <= _n; i++) {
    if (was[v][sm2[v][i]] || used[sm2[v][i]]) continue;
    dfs(sm2[v][i]);
    bad[v][sm2[v][i]] = 1;
    bd[k++] = make_pair(v, sm2[v][i]);
  }
}
void dfs2(int v) {
  if (used[v]) return;
  used[v] = 1;
  for (int _n(((int)((sm2[v]).size())) - 1), i(0); i <= _n; i++) {
    if (was[v][sm2[v][i]] || bad[v][sm2[v][i]]) continue;
    dfs2(sm2[v][i]);
  }
}
inline void bridges(int v) {
  k = 0;
  memset((used), 0, sizeof(used));
  dfs(v);
  memset((used), 0, sizeof(used));
  dfs2(v);
  for (int _n(((int)((sm2[v]).size())) - 1), j(0); j <= _n; j++) {
    if (!used[sm2[v][j]]) br[v][sm2[v][j]] = 1;
  }
  for (int _n((k)-1), i(0); i <= _n; i++) bad[bd[i].first][bd[i].second] = 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int _n((m + 1) - 1), i(0); i <= _n; i++) scanf("%d", &mas[i]), --mas[i];
  for (int _n((m)-1), i(0); i <= _n; i++)
    sm[mas[i]][mas[i + 1]] = sm[mas[i + 1]][mas[i]] = 1;
  for (int _n((n)-1), i(0); i <= _n; i++)
    for (int _n((n)-1), j(0); j <= _n; j++)
      if (sm[i][j]) {
        sm2[i].push_back(j);
        ++st[i];
      }
  last = 0;
  for (int _n((m - 1)), i(1); i <= _n; i++) {
    if (i > 1) {
      int ov = mas[i - 2];
      for (int _n(((int)((sm2[ov]).size())) - 1), j(0); j <= _n; j++)
        br[ov][sm2[ov][j]] = 0;
    }
    int v = mas[i - 1];
    bridges(v);
    bool ok = 0;
    for (int _n(n - 1), j(mas[i] + 1); j <= _n; j++) {
      if (!j) continue;
      if (!st[j] || !sm[v][j] || was[v][j]) continue;
      if (br[v][j] && st[v] > 1) continue;
      a = j;
      ok = 1;
      break;
    }
    if (ok) {
      last = i;
      b = a;
    }
    a = mas[i];
    was[v][a] = was[a][v] = 1;
    --st[v];
    --st[a];
  }
  if (last == 0) {
    puts("No solution");
    exit(0);
  }
  memset((was), 0, sizeof(was));
  memset((br), 0, sizeof(br));
  for (int _n((last - 1) - 1), i(0); i <= _n; i++)
    sm[mas[i]][mas[i + 1]] = sm[mas[i + 1]][mas[i]] = 0;
  mas[last] = b;
  sm[mas[last - 1]][b] = sm[b][mas[last - 1]] = 0;
  memset((st), 0, sizeof(st));
  for (int _n((n)-1), i(0); i <= _n; i++) sm2[i].clear();
  for (int _n((n)-1), i(0); i <= _n; i++)
    for (int _n((n)-1), j(0); j <= _n; j++)
      if (sm[i][j]) {
        sm2[i].push_back(j);
        ++st[i];
      }
  for (int _n(m - 1), i(last + 1); i <= _n; i++) {
    if (i > 1) {
      int ov = mas[i - 2];
      for (int _n(((int)((sm2[ov]).size())) - 1), j(0); j <= _n; j++)
        br[ov][sm2[ov][j]] = 0;
    }
    int v = mas[i - 1];
    bridges(v);
    bool ok = 0;
    for (int _n(n - 1), j(0); j <= _n; j++) {
      if (!st[j] || !sm[v][j] || was[v][j]) continue;
      if (br[v][j] && st[v] > 1) continue;
      a = j;
      ok = 1;
      break;
    }
    if (!ok) {
      a /= 0;
    }
    mas[i] = a;
    was[v][a] = was[a][v] = 1;
    --st[v];
    --st[a];
  }
  for (int _n((m + 1) - 1), i(0); i <= _n; i++) {
    if (i) printf(" ");
    printf("%d", mas[i] + 1);
  }
  printf("\n");
}
