//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    string s; cin>>s;
    vector<int> v(26,0);
    for(auto ch:s) v[ch-'a']=1;
    rep(i,26){
        if(v[i]==0){
            cout<<(char)('a'+i)<<endl;
            return 0;
        }
    }
    cout<<"None"<<endl;
}

#include <iostream>
#include <vector>

template<typename T>
void Dump(const std::vector<T>& xs)
{
  for (int i = 0; i < xs.size()-1; ++i)
  {
    std::cout << xs[i] << ' ';
  }
  std::cout << xs.back() << std::endl;
}

template<typename T>
int BubbleSort(std::vector<T>* src)
{
  std::vector<T>& xs = *src;
  bool change {true};
  int count = {0};
  while (change) {
    change = false;
    for (int i = xs.size()-1; i > 0; --i)
    {
      if (xs[i] < xs[i-1]) {
        T buf = xs[i];
        xs[i] = xs[i-1];
        xs[i-1] = buf;

        change = true;
        ++count;
      }
    }
  }
  return count;
}

int main()
{
  int n {};
  std::vector<int> xs {};
  std::cin >> n;
  xs.resize(n);
  for (int i = 0; i < n; ++i)
  {
    std::cin >> xs[i];
  }

  int cnt{BubbleSort(&xs)};

  Dump(xs);
  std::cout << cnt << std::endl;

  return 0;
}