/* dont stick to an approach */
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <chrono>

using namespace std;
using namespace std::chrono;

typedef long long ll;
typedef unsigned long long int ull;
typedef long double ldb;

#define PB push_back

#define For(i, n) for (ll i = 0; i < n; i++)

#define PYES cout<<"YES\n"
#define PNO cout<<"NO\n"
#define PYes cout<<"Yes\n"
#define PNo cout<<"No\n"

#define sq(x)           (x*x)

#define vll             vector<ll>
#define rev(v)          reverse(v.begin(),v.end())
#define srt(v)          sort(v.begin(),v.end())
#define grtsrt(v)       sort(v.begin(),v.end(),greater<int>())
#define mnv(v)          *min_element(v.begin(),v.end())
#define mxv(v)          *max_element(v.begin(),v.end())
#define all(v)          v.begin(),v.end()

#define Fas ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

const ll M= 1e8;

//--------------------------------------------functions-------------------------------------------------//

ll power(ll a,ll b){ll result=1;while(b>0){if(b%2 == 1){result *= a;} a *= a;b /= 2;}return result;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
ll countSetBits(ll x){ll Count=0;while(x>0){if(x&1) Count++;x=x>>1;}return Count;}
bool isPerfectSquare(ll n){ll sr = sqrt(n);if (sr * sr == n)return true;else return false;}
ll mod(ll x){return ((x%M + M)%M);}
ll add(ll a, ll b){return mod(mod(a)+mod(b));}
ll mul(ll a, ll b){return mod(mod(a)*mod(b));}
ll powerM(ll a,ll b){ll res=1;while(b){if(b%2==1){res=mul(a,res);}a=mul(a,a);b/=2;}return res;}
//------------------------------------sieve of erantothenes-----------------------------------------------//
ll MAXN=100000;
vector<ll> fact(MAXN);
void sieve_of_erantothenes()
{
    fact[1] = 1;
    for (ll i = 2; i <= MAXN; i++)
        fact[i] = i;
    for (ll i = 4; i <= MAXN; i += 2)
        fact[i] = 2;
    for (ll i = 3; i * i <= MAXN; i++){
        if (fact[i] == i){
            for (ll j = i * i; j <= MAXN; j += i)
                if (fact[j] == j)
                    fact[j] = i;
        }
    }
}
//----------------------------------------nCr mod------------------------------------------------------//
ll modInverse(ll n){
    return powerM(n,M-2);
}
ll nCrM(ll n,ll r){
    if(n<r) return 0;
    if(r==0) return 1;
    vector<ll> fact(n+1);
    fact[0]=1;
    for(ll i=1;i<=n;i++){
        fact[i]=mul(fact[i-1],i);
    }
    return mul(mul(fact[n],modInverse(fact[r])),modInverse(fact[n-r]));
}
//-----------------------------------------------solve-----------------------------------------------------//
void solve(){
    ll n;cin>>n;
    for(ll i=1;i<=n;i++){
        cout<<floor(log2(i))+1<<" ";
    }
    cout<<endl;
}

int main(){
    Fas;
//    ll t=0;
//    cin>>t;
//    while(t--)
        solve();

    return 0;
}

#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define pii pair<ll,ll>
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define autoitr(x,it) for(auto it = x.rbegin(); it != x.rend(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

ll icnt(vector<ll> &arr)
{
    ll n = arr.size();
    ordered_set os;
    ll ans = 0;
    for(ll i=n-1;i>-1;i--)
    {
        ans+=os.order_of_key(arr[i]);
        os.insert(arr[i]);
    }
    return ans;
}

int main()
{
  FAST/**/

  ll n;
  cin>>n;

  vector<ll> arr(n);
  rep(n)
        cin>>arr[i], arr[i]--;

  if(icnt(arr) != n-1)
  {
      cout<<-1;
      return 0;
  }

  set<pii> op;
  vector<ll> ins;
  bool pos = 1;
  for(ll i=0;i<n;i++)
  {
      if(arr[i]<i)
      {
          for(ll j=i;j>arr[j];j--)
          {
              if(op.find(mp(j-1,j)) != op.end())
              {
                  pos = 0;
                  break;
              }

              op.insert(mp(j-1,j));
              ins.pb(j);
              swap(arr[j],arr[j-1]);
          }
          if(pos == 0)
                break;
      }
  }
  rep(n)
        if(arr[i] != i)
            pos = 0;

  //cout<<op.size()<<'\n';
  if(op.size() != n-1 || pos == 0)
        cout<<-1<<'\n';
  else
  {
      rep(n-1)
            cout<<ins[i]<<"\n";
  }

  return 0;
}


#include <bits/stdc++.h>
#define FASTIO
using namespace std;

using ll = long long;
using Vi = std::vector<int>;
using Vl = std::vector<ll>;
using Pii = std::pair<int, int>;
using Pll = std::pair<ll, ll>;

constexpr int I_INF = std::numeric_limits<int>::max();
constexpr ll L_INF = std::numeric_limits<ll>::max();

template <typename T1, typename T2>
inline bool chmin(T1& a, const T2& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <typename T1, typename T2>
inline bool chmax(T1& a, const T2& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template <std::ostream& os = std::cout>
class Prints {
private:
    class __Prints {
    public:
        __Prints(const char* sep, const char* term) : sep(sep), term(term) {}
        template <class... Args>
        auto operator()(const Args&... args) const -> decltype((os << ... << std::declval<Args>()), void()) { print(args...); }
        template <typename T>
        auto pvec(const T& vec, size_t sz) const -> decltype(os << std::declval<decltype(std::declval<T>()[0])>(), void()) {
            for (size_t i = 0; i < sz; i++)
                os << vec[i] << (i == sz - 1 ? term : sep);
        }
        template <typename T>
        auto pmat(const T& mat, size_t h, size_t w) -> decltype(os << std::declval<decltype(std::declval<T>()[0][0])>(), void()) {
            for (size_t i = 0; i < h; i++)
                for (size_t j = 0; j < w; j++)
                    os << mat[i][j] << (j == w - 1 ? term : sep);
        }

    private:
        const char *sep, *term;
        void print() const { os << term; }
        void print_rest() const { os << term; }
        template <class T, class... Tail>
        void print(const T& head, const Tail&... tail) const { os << head, print_rest(tail...); }
        template <class T, class... Tail>
        void print_rest(const T& head, const Tail&... tail) const { os << sep << head, print_rest(tail...); }
    };

public:
    Prints() {}
    __Prints operator()(const char* sep = " ", const char* term = "\n") const { return __Prints(sep, term); }
};

Prints<> prints;
Prints<std::cerr> prints_err;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    int H, W;
    cin >> H >> W;
    vector<string> grid(H);
    for (ll i = 0; i < H; i++) {
        cin >> grid[i];
    }
    int ans = 0;
    for (ll i = 0; i < H - 1; i++) {
        for (ll j = 0; j < W - 1; j++) {
            int cntW = 0;
            if (grid[i][j] == '.') ++cntW;
            if (grid[i + 1][j] == '.') ++cntW;
            if (grid[i][j + 1] == '.') ++cntW;
            if (grid[i + 1][j + 1] == '.') ++cntW;
            if (cntW == 1 || cntW == 3) ++ans;
        }
    }
    prints()(ans);
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    std::cin.tie(nullptr), std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    std::ifstream ifs("./in_out/input.txt");
    std::cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    std::ofstream ofs("./in_out/output.txt");
    std::cout.rdbuf(ofs.rdbuf());
#endif
    std::cout << std::setprecision(18) << std::fixed;
    solve();
    std::cout << std::flush;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<char>> v(H,vector<char>(W));
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++)
      cin >> v.at(i).at(j);
  }
  int ans = 0;
  for(int i = 1;i< H;i++){
    for(int j = 1;j < W;j++){
        int ij = 0;
        if(v.at(i).at(j) == '#')
          ij = 1;
        int hu = 0;
        if(v.at(i - 1).at(j - 1) == '#')
          hu = 1;
        int un = 0;
        if(v.at(i - 1).at(j) == '#')
          un = 1;
        int hn = 0;
        if(v.at(i).at(j - 1) == '#')
          hn = 1;
        if((hu + hn + un + ij) % 2 == 1)
          ans += 1;
      }
    }
  cout << ans << endl;
}


/* Author : Aaryan Srivastava ^__^ */
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i,n) for(int i = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define setval(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define trav(x , a) for(auto &x : a)
#define sz(a) ((int)a.size())
typedef long long ll ;

#define int ll

using namespace std;

const int N = 3e5 +5 ;
const int mod = 998244353;
const ll inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace __gnu_pbds;
using ordered_set =  tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ;

typedef pair<int, int> pii;
typedef pair<int , pii> ipii ;
typedef pair<pii , int> piii ;
typedef unsigned long long ull ;
typedef long double ld;

ll po(ll x,ll y,ll p = mod) {ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}

    // [x][i] => (M - x)^i
int M_minus_x[5001][5001];
int M_pow[5001];

void solve()
{
    int n  , m ;
    cin >> n >> m ;

    for(int x = 1 ;  x <= m ; ++x){
        int mul = m - x;
        int res = 1;
        for(int i = 0 ; i <= n ; ++i){
            M_minus_x[x][i] = res;
            res = (1LL * res * mul) % mod;
        }
    }

    ll res = 1;
    for(int i = 0 ; i <= n ; ++i){
        M_pow[i] = res;
        res = (1LL * res * m) % mod;
    }

    int ans = (n * po(m , n)) % mod;
    rep(d , n){
        if(!d) continue;
        int cnt = n - d;
        ll res = (cnt * M_pow[n - 1 - d]) % mod;
        repA(x , 1 , m){
            int tmp = (1LL * res * M_minus_x[x][d - 1]) % mod;
            ans = (ans +  mod - tmp) % mod;
        }
    }
    cout << ans;
}

int32_t main(int32_t argc, char *argv[])
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        cout << "\n" ;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define MAXN 200005
#define lowbit(x) (x&-x)
#define reg register
#define mkpr make_pair
typedef long long LL;
typedef unsigned long long uLL;
const int INF=0x3f3f3f3f;
const int mo=1e9+7;
const int iv2=5e8+4;
const int lim=1000000;
const int jzm=1e6+7;
const int orG=3,invG=332748118;
const double Pi=acos(-1.0);
typedef pair<int,int> pii;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
template<typename _T>
void print(_T x){if(x<0){x=(~x)+1;putchar('-');}if(x>9)print(x/10);putchar(x%10+'0');}
int gcd(int x,int y){return !y?x:gcd(y,x%y);}
int add(int x,int y){return x+y<mo?x+y:x+y-mo;}
int n,a[MAXN],f[MAXN][2],ans;
signed main(){
	read(n);for(int i=1;i<=n;i++)read(a[i]);int sum=0;f[0][1]=1;
	for(int i=1;i<=n;i++)f[i][0]=f[i-1][1],f[i][1]=add(f[i-1][0],f[i-1][1]);
	for(int i=1;i<=n;i++){
		//printf("%d:%d %d\n",i,f[i][0],f[i][1]);
		ans=add(1ll*a[i]*f[i-1][1]%mo*add(f[n-i][0],f[n-i][1])%mo,ans);
		if(n-i>0)ans=add(1ll*(mo-a[i])*f[i-1][0]%mo*add(f[n-i-1][0],f[n-i-1][1])%mo,ans);
		else ans=add(1ll*(mo-a[i])*f[i-1][0]%mo,ans);
	}
	printf("%d\n",ans);
	return 0;
}


/*
Miles Morales : When will I know I'm ready?
Peter B. Parker : You won't. It's a leap of faith. That's all it is, Miles. A leap of faith.
*/
//KEEP IT SIMPLE STUPID

#include <bits/stdc++.h>

#pragma GCC optimize("O3")
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define ll long long
#define MP make_pair
#define ERR cout << "================================================\n"
#define fi first
#define se second
#define PB push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n)-1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define print(v)          \
    for (auto x : v)      \
    {                     \
        cout << x << " "; \
    }
#define umin(...) min({__VA_ARGS__})
#define umax(...) max({__VA_ARGS__})
#define MAX(v) *max_element(all(v))
#define MIN(v) *min_element(all(v))
#define SP << " " <<
#define W(t)  \
    ll t;     \
    cin >> t; \
    while (t--)
#define FIO                           \
    freopen("input.txt", "r", stdin); \
    freopen("output.txt", "w", stdout);
#define FAST                 \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const ll INF = 1e18;
const ll NEG_INF = -1 * (1e18);
using namespace std;

void usaco(string prob)
{
    freopen((prob + ".in").c_str(), "r", stdin);
    freopen((prob + ".out").c_str(), "w", stdout);
}

/* Function to check primality in O(sqrt(n)) */
bool prime(int n)
{
    if (n < 2)
        return false;
    for (int x = 2; x * x <= n; x++)
    {
        if (n % x == 0)
            return false;
    }
    return true;
}

/* Function to get prime factorization of n */
vector<int> getFactors(int n)
{
    vector<int> f;
    for (int x = 2; x * x <= n; x++)
    {
        while (n % x == 0)
        {
            f.push_back(x);
            n /= x;
        }
    }
    if (n > 1)
        f.push_back(n);
    return f;
}

void solve()
{
    string x;
    cin >> x;
    ll pt = 0;
    reverse(all(x));
    while (pt < x.length() && x[pt] != '.')
    {
        ++pt;
    }
    if (pt >= x.length())
    {
        reverse(all(x));
        cout << x << "\n";
    }
    else
    {
        string ans = "";
        for (ll i = pt + 1; i < x.length(); i++)
        {
            ans += x[i];
        }
        reverse(all(ans));
        cout << ans << "\n";
    }
}

int main()
{
    //FIO
    FAST

        //usaco("cowlands");

        ll TC = 1;
    /*
	Uncomment when multiple test cases
	*/

    //cin >> TC;
    for1(tt, TC)
    {
        solve();
    }
    return 0;
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    string s;
    cin >> s;
    deque<char> d;
    bool to_front = true;
    for(const auto &c: s){
        if(c == 'R'){
            to_front = !to_front;
        }else if(to_front){
            d.emplace_front(c);
        }else{
            d.emplace_back(c);
        }
    }
    deque<char> st;
    while(!d.empty()){
        if(st.empty() || st.back() != d.front()){
            st.push_back(d.front());
            d.pop_front();
        }else{
            st.pop_back();
            d.pop_front();
        }
    }
    while(!st.empty()){
        if(to_front){
            cout << st.back();
            st.pop_back();
        }else{
            cout << st.front();
            st.pop_front();
        }
    }
    return 0;
}


#define MOD_TYPE 2

#pragma region Macros

#include <bits/stdc++.h>
using namespace std;

#if 0
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
using Int = boost::multiprecision::cpp_int;
using lld = boost::multiprecision::cpp_dec_float_100;
#endif
#if 1
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

constexpr ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
constexpr int INF = (int)1e9 + 10;
constexpr ll LINF = (ll)4e18;
constexpr ld PI = acos(-1.0);
constexpr ld EPS = 1e-7;
constexpr int Dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
constexpr int Dy[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define REPI(i, m, n) for (int i = m; i < (int)(n); ++i)
#define repi(i, n) REPI(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

struct io_init
{
  io_init()
  {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(30) << setiosflags(ios::fixed);
  };
} io_init;
template <typename T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
inline ll CEIL(ll a, ll b)
{
  return (a + b - 1) / b;
}
template <typename A, size_t N, typename T>
inline void Fill(A (&array)[N], const T &val)
{
  fill((T *)array, (T *)(array + N), val);
}
template <typename T, typename U>
constexpr istream &operator>>(istream &is, pair<T, U> &p) noexcept
{
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
constexpr ostream &operator<<(ostream &os, pair<T, U> &p) noexcept
{
  os << p.first << " " << p.second;
  return os;
}
#pragma endregion

// --------------------------------------

void solve()
{
  ll a, b, c;
  cin >> a >> b >> c;
  cout << 21-a-b-c << "\n";
}

int main()
{
  solve();
}

#include<bits/stdc++.h>
using namespace std;

using ll=long long;
ll mod=1000000007;

int main(){
    int A,B,C,S=0;
    cin >> A >> B >> C;
    S=21-(A+B+C);
    cout << S << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<ll, ll> pd;

void solve(){
    int n;
    cin>>n;
    ull a[n];
    for(int i=0;i<n;i++)cin>>a[i];

    ull pre[n];
    ull mx[n];
    ull sum = a[0];
    ull mxn = a[0];
    pre[0] = a[0];
    mx[0] = a[0];
    for(int i=1;i<n;i++){
        sum += a[i];
        mxn = max(mxn, a[i]);
        pre[i] = sum;
        mx[i] = mxn;
    }

    ull ans[n];

    ans[0] = pre[0] + mx[0];
    sum = ans[0];
    for(int i=1;i<n;i++){
        sum -= (i)*(mx[i-1]);
        ull maxcur = mx[i];
        sum += pre[i-1];
        sum += maxcur*(i+1);
        sum += a[i];
        ans[i] = sum;
    }

    for(int i=0;i<n;i++)cout<<ans[i]<<"\n";

}

int32_t main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    int t;
    //cin>>t;
    t = 1;
    //cout<<"t: "<<t<<"\n";
    while(t--){
        solve();
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int               long long
#define endl              "\n"
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define vi                vector<int>
#define vpi               vector<pair<int,int>>
#define mii               map<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define repe(i,a,b)        for(int i=a;i<=b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll
#define INF 100000000000000000
#define mod 1000000007
#define esp 10e-7
const int mx=200+7;
int a[mx];
map<int,set<string>>mp;

void solve()
{
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
    cin>>a[i];

  int cnt=min(n,9LL);
  for(int i=1;i<(1<<cnt);i++)
  {
    int sum=0;
    string s="";
    for(int j=0;j<cnt;j++)
    {
      if((1<<j)&i)
      {
        sum+=a[j];
        s.pb('0'+j);
      }
    }
    sum=sum%200;
    mp[sum].insert(s);
  }
  for(auto it:mp)
  {
    if(it.sc.size()>1)
    {
      string s=*(it.sc).begin();
      string k=*(it.sc).rbegin();
      cout<<"Yes"<<endl;
      cout<<s.size()<<" ";
      for(int i=0;i<s.size();i++)
        cout<<(s[i]-'0'+1)<<" ";
      cout<<endl;
      cout<<k.size()<<" ";
      for(int i=0;i<k.size();i++)
        cout<<(k[i]-'0'+1)<<" ";

      return;
    }
  }
  cout<<"No"<<endl;
}
signed main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //freopen("error.txt" , "w" , stderr);
    //#endif
    IOS
    int t=1,n;
    // cin>>t;

    while(t--)
    {
     solve();
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N,M;
    string a;
    random_device rnd;

    cin >> N >> M;

    for(int i=0; i<M; i++) {
        cin >> a;
    }

    for(int y=0; y<N; y++) {
        for(int x=0; x<N; x++){
            char a = rnd()%8 + 'A';
            cout << a;
        }

        cout << endl;
    }
};

#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = (l); i <= (r); i++)
#define per(i, r, l) for(int i = (r); i >= (l); i--)
#define mem(a, b) memset(a, b, sizeof a)
#define For(i, l, r) for(int i = (l), i##e = (r); i < i##e; i++)

using namespace std;
int T; long long n;
int main() {
	#ifdef local
//		freopen(".in", "r", stdin);
	#endif
	for(cin >> T; T--;) {
		scanf("%lld", &n);
		if(n % 2) puts("Odd");
		else if(n % 4) puts("Same");
		else puts("Even");
	}
	return 0;
}


#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
using namespace std;
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using lli = long long;
using vi = vc<int>;
using ii = pair<int,int>;

lli gcd(lli a, lli b){return (b?gcd(b,a%b):a);}
lli lcm(lli a, lli b){ if(!a || !b) return 0; return a * b / gcd(a, b); }
int popcount(lli x) { return __builtin_popcountll(x); }
lli poww(lli a, lli b){
	lli res = 1;
	while(b){ if(b&1) res = res*a; a=a*a; b>>=1;}
	return res;
}

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// int rnd(int n){return uniform_int_distribution<int>(0, n-1)(rng);}

template<class t,class u>bool mmax(t&a,u b){if(a<b)a=b;return a<b;}
template<class t,class u>bool mmin(t&a,u b){if(b<a)a=b;return b<a;}
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
// ---- しゃけ ツナマヨ ('-')7

int main(){_

	auto solve=[&](){
		lli a,b,c; cin>>a>>b>>c;
		lli d = a*a;
		lli u = b*b+c*c;
		if(u<d){
			cout<<2<<ENDL;
			return;
		}
		lli l = 0, r = u/d+5;
		auto f=[&](lli mid){
			return mid*mid*d>=u;
		};
		while(l+1<r){
			lli mid = (l+r)/2;
			if(f(mid))r = mid;
			else l = mid;
		}
		cout<<r<<ENDL;
	};
	//int t; cin>>t; while(t--)
	solve();
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	long double x,y,r;
	scanf("%Lf%Lf%Lf",&r,&x,&y);
	long double dis=sqrt(x*x+y*y);
	if (dis<r){
		puts("2");
		return 0;
	}
	printf("%d\n",(int)ceil(dis/r));
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mod 1000000007
#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,start,end) for(int i=start; i<=end; i++)
#define repd(i,start,end) for(int i=start; i>=end; i--)
#define all(x) x.begin(),x.end()
#define debug(x) cout << "(" << #x << ": " << x << ")" << endl;

void solve() {
    int x;
    cin >> x;
    cout << 100 - (x%100) << endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t=1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
}

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
using ll = long long;

int main(){
    ll n;
    cin >> n;
    ll rtn = sqrt(n);
    set<ll> is;
    ll sum = 1;//1 is include
    for(ll i = 2; i*i <= n; i++){
        ll cnt = 0;
        ll j = i;
        while(j*i <= n){
            j *= i;
            cnt++;
            if(is.count(j)) cnt--;
            else is.insert(j);
            // cout << j << endl;
        }
        sum += cnt;
    }
    cout << n  - sum + 1 << endl;
}


#include <iostream>
#include <string>
#include <complex>
#include <cstdio>
#include<functional>
#include<cmath>
#include<string>
#include<ctime>
#include<cstring>
#include<algorithm>
using namespace std;
typedef complex<double> cp;
#define ll long long
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define scf(x) scanf("%lf",&x)
#define fo(a,b,c)for(int a=b;a<=c;a++)
#define getname(x) #x
template<typename T>
inline void printT(T *arr,int n)
{
	for(int i=0;i<n;i++)
	cout<<arr[i]<<' ';
	cout<<endl;
}
inline void printcarr(cp *arr,int n,string d)
{
    for(int i=0;i<n;i++)
    {
        cout<<(int)arr[i].real()<<' ';
    }
    cout<<d<<endl;
}
inline void printBit(int x)
{
	for(int i=0;i<20;i++)
		cout<<bool(x&(1<<i));
	cout<<endl;
}
inline void copyarr(int *arr1,int *arr2,int n)
{
    for(int i=0;i<n;i++)*(arr1+i)=*(arr2+i);
}
inline void randarr(int *arr,int n)
{
	srand(time(0));
	for(int i=0;i<n;i++)*(arr+i)=rand()%100;
}
inline void qsctr(char *a,int &len)
{
    len=0;
    char c;
    while(c=getchar(),!isdigit(c));
    while(isdigit(c)){a[len++]=c;c=getchar();}
    a[len]='\0';
}
inline void showint(int *arr,int n)
{
	for(int i=0;i<n;i++)
	cout<<arr[i]<<' ';
	cout<<endl;
}
inline ll read(ll mod)//快速输入（取模)
{
     char ch;
    ll ans=0;bool isN=false;
    while(ch=getchar(),!isdigit(ch)&&ch!='-');
    if(ch=='-')isN=true;
    else ans=(ch^48);
    while(ch=getchar(),isdigit(ch)){ans=(ans<<3)+(ans<<1)+(ch^48);ans%=mod;}
    if(isN)ans*=-1;
    return ans;
}
inline ll QJY(ll *a,ll n,ll x,ll mod)//秦九韶算法 快速计算多项式的和(02n)取模
{
    ll ans=0;
    for(int i=n;i>0;i--)
        ans=(ans*x%mod+a[i-1])%mod;
    return ans;
}
inline void init(ll* eular,ll maxn)//埃氏筛 不能用欧拉 欧拉不全面 而且从 j=i开始
{
    for(int i=0;i<1e5+5;i++)eular[i]=i;
    for(int i=2;i<1e5+5;i++)
    {
        if(eular[i]==i)
            for(int j=i;j<=maxn;j+=i)
            eular[j]=eular[j]/i*(i-1);
    }
}
inline void elp(ll *jug,ll *pri,ll maxn)//欧拉筛 jug为最小质因子 maxn为数据范围
{
    for(ll i=2;i<maxn;i++)
    {
        if(!jug[i])
        {
            pri[++pri[0]]=i;
            jug[i]=i;
        }
        for(ll j=1;j<=pri[0];j++)
        {
            if(1LL*i*pri[j]>maxn)break;
            jug[i*pri[j]]=pri[j];
            if(i%pri[j]==0)break;//放后面
        }
    }
}
inline void dispose(ll x,ll *pri,ll *ert,ll *stp)//分解质因子 数据 质因子集合 质因子个数集合 分解后质因子集合
{
    for(ll j=1;j<=pri[0]&&x>=pri[j]*pri[j];j++)
    {
        if(x%pri[j]==0)
        {
            stp[++stp[0]]=pri[j];++ert[0];
            while(x%pri[j]==0){x/=pri[j];ert[ert[0]]++;}
        }
    }
    if(x>1)
        {ert[++ert[0]]++;stp[++stp[0]]=x;}
}
inline void disposefact(ll x,ll *p,ll *ans)//分解阶乘的质因子 p为x的质因子集合 ans为答案集合
{

	for(int i=1;i<=p[0];i++)//阶乘分解的原理 x的幂在(1~n)自身的倍数中，出现总次数恰好等于幂次。
	{
		ll now=p[i];
		ans[i]=0;
		while(now<=x)
		{
			ans[i]+=x/now;
			now*=p[i];
		}
	}
}
inline ll ext_gcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1;y=0;
		return a;
	}
	ll r=ext_gcd(b,a%b,y,x);//x=y' y=x'-(a/b)*y' ->  y=x' x=y'
	y-=(a/b)*x;
	return r;
}

int n;
string s;
const int maxn=200;
int st[maxn];
bool judge(int mid)
{
    for(int i=1;i<n;i++){
        if(st[i]/mid==st[i+1]/mid)
            return false;
    }
    return true;
}
int main()
{
    cin>>n;
    n++;
    cin>>s;for(int i=1;i<=n;i++)sci(st[i]);
    int l=10001;
    for(int i=1;i<n;i++){
        l=min(l,abs(st[i+1]-st[i]));
    }
    cout<<l<<endl;
    for(int i=1;i<=l;i++){
        for(int j=1;j<=n;j++)
        cout<<(st[j]+i-1)/l<<' ';
    cout<<endl;
    }
}

#include <bits/stdc++.h>
#define ff first
#define ss second
#define endl '\n'
using namespace std;
const long long INF = (long long) 1e18;
const int mod = (int) 1e9+7;
const int MAXN = (int) 3e5+5;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n, m;
vector<int> adj[MAXN];
int c[MAXN];

int d[18][MAXN];
int dp[MAXN][20];
void djk(int src, int idx){
    d[idx][src] = 0;
    queue<int> q;
    q.push(src);

    while(!q.empty()){
        int cur = q.front();
        q.pop();

        for(int j: adj[cur]){
            if(d[idx][j] <= d[idx][cur] + 1)
                continue;
            d[idx][j] = d[idx][cur] + 1;
            q.push(j);
        }
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);cout.tie(nullptr);

    #ifdef Local
        freopen("C:/Users/Admin/Desktop/Yazilim/C/IO/int.txt","r",stdin);
        freopen("C:/Users/Admin/Desktop/Yazilim/C/IO/out.txt","w",stdout);
    #endif

    memset(d, 0x7f, sizeof(d));
    memset(dp, 0x7f, sizeof(dp));

    cin>>n>>m;

    for(int i = 0; i < m; i++){
        int a, b;
        cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    int k;
    cin>>k;

    for(int i = 0; i < k; i++){
        cin>>c[i];
        djk(c[i], i);
        dp[(1<<i)][i] = 1;
    }

    for(int i = 0; i < (1<<k); i++){
        for(int j = 0; j < k; j++){
            if((1<<j) & i){
                for(int l = 0; l < k; l++){
                    if((1<<l) & i)
                        continue;
                    if(dp[i][j] < mod)
                        dp[i^(1<<l)][l] = min(dp[i^(1<<l)][l], dp[i][j] + d[j][c[l]]);
                }
            }
        }
    }

    int ans = mod;

    for(int i = 0; i < k; i++){
        ans = min(ans, dp[(1<<k) - 1][i]);
    }
    if(ans >= mod) ans = -1;

    cout<<ans<<endl;

    #ifdef Local
        cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds ";
    #endif
}


#include <iostream>
using namespace std;
int main() {
double x;
double y;
double z;
cin>>x;
cin>>y;
cin>>z;
double a=z/x;
double d=y/x;
int b=y*a;
double c=b/z;
int i=0;
while(i!=1){
if(c<d){
  i=1;
}else{
  b--;
  c=b/z;
}
}
cout<<b;
}

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
//#include <random>
#include <map>
//#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <time.h>
//#include <chrono>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <iostream>
#include <limits>
#include <numeric>
#include <sstream> // std::stringstream
#include <bitset>  // std::bitset<N>
//#include <type_traits>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=b-1;i>=a;i--)
#define ll long long
#define INF 1000000001
#define MOD 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define REVERSE(s) reverse(s.begin(), s.end());
#define SUM(s) accumulate(s.begin(), s.end(), 0LL);
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
//#define int ll
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int ndx[8] = { 0,1,0,-1, 1,1,-1,-1 };
int ndy[8] = { 1,0,-1,0, 1,-1,-1,1 };
double pi = 3.141592653589793;
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }

ll m;
string x;
int s;

ll binary_search_f(ll n) {
	ll res = 0;
	ll a = 1;;
	rrep(i, s) {
		if (i != s - 1) a *= n;
		if (a > 1000000000000000001 || res > 1000000000000000001) {
			return 1000000000000000001;
		}
		if (x[i] - '0' == 0) {
			continue;
		}
		if (a > 1000000000000000001 / (x[i] - '0')) {
			return 1000000000000000001;
		}
		ll res0 = res;
		res += (x[i] - '0') * a;
		if (res < 0 || res - (x[i] - '0') * a != res0) {
			return 1000000000000000001;
		}
	}
	return res;
}

int main() {

	int x, y, z;
	cin >> x >> y >> z;
	y *= z;
	if (y % x == 0) {
		cout << y / x - 1 << endl;
	}
	else {
		cout << y / x  << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
const int N=2e3+5;
const int M=65;
const int inf=1e9;
const int mod=998244353;;
const double eps=1e-8;
const long double pi=acos(-1.0L);
#define ls (i<<1)
#define rs (i<<1|1)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mem(a,b) memset(a,b,sizeof(a))
LL read()
{
    LL x=0,t=1;
    char ch;
    while((ch=getchar())<'0'||ch>'9') if(ch=='-') t=-1;
    while(ch>='0'&&ch<='9'){ x=(x<<3)+(x<<1)+ch-'0'; ch=getchar(); }
    return x*t;
}

char s[N][N];
vector<char> e[N<<1];
int n,m,vis[N][N];
void dfs(int x,int y,int step)
{
    vis[x][y]=1;
    e[step].eb(s[x][y]);
    if(x<n&&!vis[x+1][y]) dfs(x+1,y,step+1);
    if(y<m&&!vis[x][y+1]) dfs(x,y+1,step+1);
}
int main()
{
    n=read(),m=read();
    for(int i=1;i<=n;i++) scanf("%s",s[i]+1);
    dfs(1,1,1);
    int flag=1;
    LL ans=1;
    for(int i=1;i<=n+m-1;i++)
    {
        int t1=0,t2=0;
        for(auto x:e[i])
            if(x=='R') t1++;
            else if(x=='B') t2++;
        if(t1&&t2) flag=0;
        if(!flag) break;
        if(t1==0&&t2==0) ans=ans*2%mod;
    }
    if(!flag) printf("0\n");
    else printf("%lld\n",ans);
    return 0;
}
/*
4
4
0 1
0 2
2 3
2
1 0
4
0 1
0 2
2 3
2
1 0
*/


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 2e5 + 5;
const int MAXM = 4e5 + 5;

int p[MAXN][2];
bool del[MAXN];

vector<int> poss[MAXM];
int cnt[MAXM];
inline int get_pos(vector<int> &vec)
{
	for(int i=0; i<(int)vec.size(); ++i)
		if(!del[vec[i]]) return vec[i];
	return -1;
}

int main(void)
{
	int n;
	scanf("%d",&n);
	for(int i=1; i<=n; ++i)
		scanf("%d%d",&p[i][0],&p[i][1]);

	for(int i=1; i<=n; ++i)
		for(int j=0; j<=1; ++j)
			++cnt[p[i][j]], poss[p[i][j]].push_back(i);

	queue<int> q;
	for(int i=1; i<MAXM; ++i)
		if(cnt[i] == 1) q.push(i);

	int ans = 0;
	while(q.size())
	{
		int u = q.front(); q.pop();
		int pos = get_pos(poss[u]);
		if(pos == -1) continue;
		++ans; del[pos] = 1;

		int v = p[pos][0] + p[pos][1] - u;
		if(--cnt[v] == 1) q.push(v);
	}

	set<int> t;
	for(int i=1; i<=n; ++i)
		if(!del[i]) t.insert(p[i][0]), t.insert(p[i][1]);
	printf("%d",ans + (int)t.size());
	return 0;
}

/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <stdio.h>
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip> //setprecision
#include <map> // map
#include <unordered_map> //unordered_map
#include <queue> // queue, priority_queue
#include <set> // set,multiset
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#include <numeric> //accumulate,,,
#include <sstream>
#define endl "\n";
using namespace std;

using PLL = pair<long long,long long>;
typedef tuple<int,int,int> TUP;
using P = pair<int,int>;
const long long INF = 4000000000000000001;
const int inf = 1001001001;
const long long MOD = 1000000007;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M, long long mod) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % mod, M / 2,mod);
    //When end-of-a bit is 1, times simple N.
    if (M & 1) res = (res * N) % mod;
    return res %= mod;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a; else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}
long long get_mod(long long res){
    if(res < 0) res += MOD;
    return res % MOD;
}

int parent[514514];
int connectSize[514514];
int connectEdge[514514];

void dsu(){
    for(int i = 0;i<514514;i++) parent[i] = i,connectSize[i] = 1 , connectEdge[i] = 0;
}
int searchRoot(int V){
    //頂点Vの親==頂点Vということは頂点Vはその木の根である。
    if(parent[V] == V){
        return V;
    }
    else{
        //一回ごとにparent[V]を更新する。辺の縮約
        return parent[V] = searchRoot(parent[V]);
    }
}
bool same(int X,int Y){
    if(searchRoot(X) == searchRoot(Y)) return true;
    else return false;
}
void unite(int X,int Y){
    //X,Yの高さが高い方の木の「高さ0の根」に高さが低い方の根を付ける
    int Xroot = searchRoot(X); int Yroot = searchRoot(Y);
    if(connectSize[Xroot] > connectSize[Yroot]) swap(Xroot,Yroot);
    //同じ根を持つ木を併合することはしなくてよい
    if(Xroot == Yroot){
        connectEdge[Yroot]++;
        connectEdge[Xroot] = connectEdge[Yroot];
        return;
    }
    //Xrootがサイズが小さい方にする→XrootをYroot側にくっつける

    parent[Xroot] = Yroot;
    connectEdge[Yroot]++;
    connectSize[Yroot] += connectSize[Xroot];
    connectSize[Xroot] = connectSize[Yroot];
    connectEdge[Yroot] += connectEdge[Xroot];
    connectEdge[Xroot] = connectEdge[Yroot];
}

int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int N;cin >> N;
    dsu();
    vector<int> loopmyself(400005);
    for(int i = 0;i<N;i++){
        int a,b;cin >> a >> b;a--;b--;
        if(a > b) swap(a,b);
        unite(a,b);
    }
    int ans = 0;
    vector<bool> already(400005);
    int edgecnt = 0;
    for(int i = 0;i<400005;i++){
        if(searchRoot(i) != i) continue;
        if(connectEdge[searchRoot(i)] >= connectSize[searchRoot(i)]){
            ans += connectSize[searchRoot(i)];
        }
        else{
            ans += connectSize[searchRoot(i)] - 1;
        }
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
ll mod=1000000000000000000;
long long modpow(long long a, long long n){
  long long r = 1;
  while (n) {
    r = r * ( (n%2)?a:1 ) %mod;
    a = a * a % mod;
    n >>= 1;
  }
  return r;
}
int main(void){
    sp(10);
    ll k;cin>>k;
    string s,t;cin>>s>>t;
    long double res=0;
    map<ll,ll> mp1,mp2,mp3;
    for(ll i=1;i<=9;i++){
        mp1[i]=mp2[i]=0;
    }
    rep(i,s.size()){
        mp1[s[i]-'0']++;
        mp2[t[i]-'0']++;
        mp3[s[i]-'0']++;
        mp3[t[i]-'0']++;
    }

    //手札は多くても5枚まで
    for(ll a=1;a<=9;a++){
        for(ll b=1;b<=9;b++){
            if(mp3[a]==k||mp3[b]==k||(a==b&&mp3[a]==k-1))continue;
            ll buf1=0,buf2=0;
            for(auto& p:mp1){
                ll buf=p.first;
                ll c=p.second,d=mp2[buf];
                if(buf==a)c++;
                if(buf==b)d++;
                buf1+=buf*modpow(10,c);
                buf2+=buf*modpow(10,d);
            }
            //cout<<a<<" "<<b<<" ";
            //cout<<buf1<<" "<<buf2<<endl;
            //cout<<k-mp3[a]<<" "<<k-mp3[b]<<endl;
            long double buf=9*k-8;
            buf=(a==b)? ((k-mp3[a])/buf)*((k-mp3[b]-1)/(buf-1)) : ((k-mp3[a])/buf)*((k-mp3[b])/(buf-1));
            //cout<<buf<<endl;
            if(buf1>buf2){
                res+=buf;
            }
        }
    }
    cout<<res<<endl;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define endl '\n'
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define FordE(i, l, r) for (int i = l; i >= r; i--)
#define Fora(v, a) for (auto v: a)
#define bend(a) a.begin(), a.end()
#define isz(a) ((signed)a.size())

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <pii> vpii;
typedef vector <vi> vvi;

const int N = 3e5 + 5;

int n, k;
int a[N];

void readTest(){
    cin >> n >> k;
    ForE(i, 1, n){
        cin >> a[i];
    }
}

ll ans, cur;
ll cnt[N];

void resetTest(){
    cur = k;
    ForE(i, 1, n){
        cnt[a[i]]++;
    }
}

void solveTest(){
    For(i, 0, n){
        cur = min(cur, cnt[i]);
        ans += cur;
    }
    cout << ans << endl;
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("B.inp", "r", stdin);
    // freopen("B.out", "w", stdout);
// int q; cin >> q; while (q--){
    readTest();
    resetTest();
    solveTest();
// }
}

/*
==================================================+
INPUT:                                            |
--------------------------------------------------|

--------------------------------------------------|
==================================================+
OUTPUT:                                           |
--------------------------------------------------|

--------------------------------------------------|
==================================================+
*/


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
using ll = long long;
using P = pair<int,int>;
int main()
{
    int h, w;
    cin >> h >> w;

    vector<char> bbb(w);

    rep(i, w){
        cin >> bbb[i];
    }

    int ans  = 0;

   for(int i = 0;i < h; i++){
        vector<char> ccc(w);
           rep(k, w){;
               cin >> ccc[k];
           }

       for(int j = 0; j < w - 1; j++){

           if(bbb[j] != bbb[j + 1] && ccc[j] == ccc[j + 1]){
               ans++;
           }

          if(bbb[j] == bbb[j + 1] && ccc[j] != ccc[j + 1]){
              ans++;
          }
          int a;
          a = ccc[j];

          bbb[j] = a;
       }

}

    cout << ans << endl;

return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x,sum,maxn=-0x3f3f3f3f3f3f3f3f,minn=0x3f3f3f3f3f3f3f3f,n,a,t,q;
int main()
{
    cin>>n;
    while(n--)
    {
        cin>>a>>t;
        if(t==1)
        {
            sum+=a;
            maxn+=a;
            minn+=a;
        }
        if(t==2)
        {
            maxn=max(a,maxn);
            minn=max(minn,a);
        }
        if(t==3)
        {
            minn=min(a,minn);
            maxn=min(a,maxn);
        }
    }
    cin>>q;
    while(q--)
    {
        cin>>x;
        cout<<min(max(x+sum,maxn),minn)<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
    #define D(a) cerr << #a << " = " << a << endl
#else
    #define D(a) 8
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define all(a) (a).begin(),(a).end()
#define dforn(i,n) dforsn(i,0,n)
#define forn(i,n) forsn(i,0,n)
#define si(a) int((a).size())
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first
#define endl '\n'
using pii = pair<int,int>;
using vi = vector<int>;
using ll = long long;

int n, m, k, ans;
vector<pii> c, o;
vi b;

void f(int l = 0) {
    if (l == k) {
        int cur = 0;
        for (auto [x, y] : c) if (b[x] && b[y]) cur++;
        ans = max(ans, cur);
        return;
    }
    auto [x, y] = o[l];
    b[x]++, f(l + 1), b[x]--;
    b[y]++, f(l + 1), b[y]--;
}

int main() {
	fastio;

    cin >> n >> m;
    b.resize(n), c.resize(m);
    for (auto &[x, y] : c) cin >> x >> y, x--, y--;
    cin >> k;
    o.resize(k);
    for (auto &[x, y] : o) cin >> x >> y, x--, y--;
    f();
    cout << ans << endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const ll mod = 998244353;
ll qp(ll a,ll b = mod - 2)
  {
  	ll ret = 1;
  	while (b)
  	  {
  	  	if (b & 1)
  	  	  ret = ret * a % mod;
		b >>= 1;
		a = a * a % mod;
		}
	return ret;
  }
ll js[400000 + 110];
ll ijs[400000 + 110];
ll d[400000 + 110];
void show(ll n,ll m)
  {
  	static vector<ll> v;
  	if (n == 0)
  	  {

  	  	for (ll i = 1;i < v.size();i++)
  	  	  if (v[i - 1] > v[i] or v[i] % v[i - 1] != 0)
  	  	    return;
		static ll cnt = 0;
  	  	cout << ++cnt << " : ";
  	  	for (auto it : v)
  	  	  cout << it << " ";cout << endl;
  	  	return;
		}
	for (ll i = 1;i <= m;i++)
	  {
	  	v.push_back(i);
	  	show(n - 1,m);
	  	v.pop_back();
	  }
  }
ll c(ll n,ll m)
  {
  	if (n < m)
  	  return 0;
  	ll ret = js[n] * ijs[m] % mod * ijs[n - m] % mod;
  	return ret;
  }
map<ll,ll> tong[400000 + 110];
int main()
  {
  	static bool vis[400000 + 110];
  	for (ll i = 2;i <= 400000;i++)
  	  if (vis[i] == 0){
  	  	for (ll k = i;k <= 400000;k += i)
  	  	  {
  	  	    vis[k] = 1;
  	  	    ll now = k;
			while (now % i == 0)
			  tong[k][i]++,
			  now /= i;
			  }

		}
  	js[0] = 1;
  	for (ll i = 1;i <= 400000;i++)
  	  js[i] = js[i - 1] * i % mod;
  	ijs[400000] = qp(js[400000]);
  	for (ll i = 400000;i >= 1;i--)
  	  ijs[i - 1] = ijs[i] * i % mod;
    for (ll i = 1;i <= 400000;i++)
      for (ll k = i;k <= 400000;k += i)
        d[k]++;
    ll n,m;
    cin >> n >> m;
    ll ret = 0;
    for (ll i = 1;i <= m;i++)
      {
      	ll t = 1;
      	for (auto it : tong[i])
      	  //cout << "+ " << i << " " << it.first << " " << it.second << endl,
      	  t *= c(n + it.second - 1,it.second),
		  t %= mod;
      	///cout << endl;
      	ret += t % mod;
      	ret %= mod;
	  }
	cout << (ret % mod + mod) % mod;
  	return 0;
   }


#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define ull unsigned long long
#define i128 __int128
#define mp make_pair
#define mt make_tuple
#define ld long double
#define VNAME(name) (#name)
typedef pair<int, int> pii;
typedef priority_queue<int, vector<int>, greater<int> > small_heap;
typedef priority_queue<int> big_heap;
typedef tuple<int, int, int> mkgroups;

void debug_out() { cout << '\n'; }

template<typename T, typename... R>
void debug_out(const T &f, const R &... r) {
    cout << f << " ";
    debug_out(r...);
}

template<typename A, typename B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
    out << "(" << a.first << "," << a.second << ")";
    return out;
}

template<typename Tuple, size_t N>
struct tuple_print {
    static void print(const Tuple &t, std::ostream &os) {
        tuple_print<Tuple, N - 1>::print(t, os);
        os << ", " << std::get<N - 1>(t);
    }
};

template<typename Tuple>
struct tuple_print<Tuple, 1> {
    static void print(const Tuple &t, std::ostream &os) { os << "(" << std::get<0>(t); }
};

template<typename... Args>
ostream &operator<<(ostream &os, const tuple<Args...> &t) {
    tuple_print<decltype(t), sizeof...(Args)>::print(t, os);
    return os << ")";
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &a) {
    out << "[";
    bool first = true;
    for (auto &v : a) {
        out << (first ? "" : ", ");
        out << v;
        first = 0;
    }
    out << "]";
    return out;
}

template<typename T, class Cmp>
ostream &operator<<(ostream &out, const set<T, Cmp> &a) {
    out << "{";
    bool first = true;
    for (auto &v : a) {
        out << (first ? "" : ", ");
        out << v;
        first = 0;
    }
    out << "}";
    return out;
}

template<typename U, typename T, class Cmp>
ostream &operator<<(ostream &out, const map<U, T, Cmp> &a) {
    out << "{";
    bool first = true;
    for (auto &p : a) {
        out << (first ? "" : ", ");
        out << p.first << ":" << p.second;
        first = 0;
    }
    out << "}";
    return out;
}

template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) { cerr << name << ": " << arg1 << endl; }

template<typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " |";
    __f(comma + 1, args...);
}

const int N = 1e6 + 100;
int T;
ll mod, m, n;

ll ksm(ll a, ll b) {
    ll c = 1;
    for (; b; b >>= 1) {
        if (b & 1) c = (ll) c * a % mod;
        a = (ll) a * a % mod;
    }
    return c;
}

int main() {
    cin >> n >> m;
    mod = m * m;
    ll ans = ksm(10ll, n);
    cout << ans / m;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
#define lin(x) ll x; cin>>x;
#define stin(x) string x; cin>>x;
#define yn(x)  if(x) {  cout<<"Yes"<<endl;   }    else {    cout<<"No"<<endl;   }
#define YN(x)  if(x) {  cout<<"YES"<<endl;   }    else {    cout<<"NO"<<endl;   }
#define co(x) cout<<x<<endl;
using ll=long long;
using ld=long double;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll mod=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template <typename T> inline bool chmax(T &a, T b) {
    return ((a < b) ? (a = b, true) : (false));
}
template <typename T> inline bool chmin(T &a, T b) {
    return ((a > b) ? (a = b, true) : (false));
}
ll powmod(ll n, ll k, ll m) {
ll r=1;
 for(; k>0; k >>=1) {
   if(k&1) r=(r*n)%m;
   n=(n*n)%m;
 }
  return r;
}

ll fact(ll n) {
ll a=1;
rep(i,n) {
a=a*(n-i);
}
return a;
}

ll pow(ll a, ll b) {
ll x=1;
rep(i,b) {
x=x*a;
}
return x;
}

int main() {
lin(N);
  lin(M);
  ll x=powmod(10,N,M*M);
  ll y=(x/M)%M;
  co(y);
}


#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000

using namespace std;

ll power(ll n, ll k, ll mod){
  ll res = 1;
  while(k > 0){
    if (k & 1)
      res = res * n % mod;
    n = n * n % mod;
    k >>= 1;
  }
  return res;
}

ll tf(char c){
  switch (c) {
    case 'R' : return 0;
    case 'P' : return 1;
    case 'S' : return 2;
  }
}
char inv(ll a){
  switch (a) {
    case 0 : return 'R';
    case 1 : return 'P';
    case 2 : return 'S';
  }
}

int main(void){
  ll n, k;
  cin >> n >> k;
  string t;
  cin >> t;
  vector<ll> s(n);
  for (ll i = 0; i < n; i++){
    s[i] = tf(t[i]);
  }

  vector<vector<ll>> memo(n, vector<ll>(k+1, -1));
  function<ll(ll, ll)> rec = [&](ll a, ll j){
    if (memo[a][j] != -1)
      return memo[a][j];
    if (j == 0){
      memo[a][j] = s[a];
      return memo[a][j];
    }

    ll x = rec(a, j-1);
    ll y = rec((a + power(2, j-1, n)) % n, j-1);
    if ((x + 1) % 3 == y)
      memo[a][j] = y;
    else
      memo[a][j] = x;

    return memo[a][j];
  };

  cout << inv(rec(0, k)) << endl;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template<class T> bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b){if(a<b) {a = b; return true;} return false;}
#define rep(i,n) for(int i=0;i<(n);i++)
#define drep(i,n) for(int i=(n)-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define debug(x)  cerr << #x << " = " << (x) << endl;

constexpr ll mod = 998244353;
struct mint {
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}

    friend ostream &operator<<(ostream& os,const mint& a){
        return os << a.x;
    }

    friend istream &operator>>(istream& is,mint& a){
        ll t;
        is >> t;
        a = mint(t);
        return (is);
    }

    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
    bool operator==(const mint a)const{
        return x==a.x;
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vec<int> A(N);
    rep(i,N) cin >> A[i];
    sort(all(A));
    mint ans = 0;
    mint val = 0;
    vec<mint> p2(N+1,1);
    rep(i,N) p2[i+1] = p2[i]*2;
    for(int i=1;i<N;i++) val += p2[i-1]*A[i];
    rep(i,N){
        ans += (val+A[i])*A[i];
        if(i+1!=N){
            val -= A[i+1];
            val /= 2;
        }
    }
    cout << ans << "\n";
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

string at="atcoder";

void solve()
{
    string s;
    cin>>s;

    if(at<s) return puts("0"),(void)0;

    int pos=-1;
    for(int i=1;i<s.length();i++)
    {
        if(s[i]!='a')
        {
            pos=i;
            break;
        }
    }

    if(pos==-1) puts("-1");
    else if(s[pos]>'t') printf("%d\n",pos-1);
    else printf("%d\n",pos);
}

int main()
{
    int T;
    scanf("%d",&T);
    while(T--) solve();
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int t; cin >> t;
	string b = "atcoder";
	while (t--) {
		string s;
		cin >> s;
		if (s > b) cout << "0\n";
		else {
			vector<char> ch;
			for (auto c : s)
				ch.push_back(c);
			sort(ch.begin(), ch.end(), greater<char>());
			string a;
			for (auto c : ch)
				a.push_back(c);
			if (a <= b) cout << "-1\n";
			else {
				if (s[1] == 'a') {
					int ans = INT_MAX;
					for (int i = 2; i < s.length(); i++) {
						if (s[i] != 'a') ans = min(ans, i);
						if (s[i] > 't') ans = min(ans, i - 1);
					}
					cout << ans << '\n';
				}
				else cout << "1\n";
			}
		}
	}
	return 0;
}


#include <bits/stdc++.h>

// #include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n - 1); i >= 0; --i)
#define bit(n, k) ((n >> k) & 1)
#define len(s) (int)s.size()
#define range(a) a.begin(), a.end()
#define rrange(a) a.rbegin(), a.rend()
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

int find_gt(const string& s, char tgt, int pos = 0) {
  int n = s.length();
  for (int i = pos; i < n; i++) {
    if (s[i] > tgt) return i;
  }
  return 1e6;
}

void solve() {
  string s;
  cin >> s;
  int n = s.length();

  if (s > "atcoder") {
    cout << 0 << endl;
    return;
  } else if (count(s.begin(), s.end(), 'a') == n) {  // 全部a
    cout << -1 << endl;
    return;
  }

  int ans = n;
  const string atc = "atcoder";
  rep(i, 7) {
    auto tmp = s;
    int can = find_gt(s, atc[i], i);
    if (can >= n) continue;
    swap(tmp[i], tmp[can]);
    if (tmp > atc) ans = min(ans, can - i);
  }
  cout << ans << endl;
}

int main() {
  int t;
  cin >> t;
  rep(i, t) solve();
}

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define reps(i,s,n) for (int i = (int)(s); i < (int)(n); i++)
#define repit(i,C) for (auto i = (C).begin(); i != (C).end(); i++)
#define pr(a) cout << a
#define prl(a) cout << (a) << endl
#define prld(a) cout << setprecision(15)<< (a) << endl
#define allrange(a) a.begin(),a.end()

bool solve_translated(vector<pair<int,int>> &S,vector<pair<int,int>> &T){
    int N = S.size();
    int dx = S[0].first-T[0].first;
    int dy = S[0].second-T[0].second;
    bool flg = true;
    reps(i,1,N){
        if(!((S[i].first==T[i].first+dx) && (S[i].second==T[i].second+dy))){flg = false; break;}
    }
    return flg;
}
/*ピタゴラ三角形
    5	12	13
    8	15	17
    3	4	5
*/
vector<pair<int,int>> Pitagora_rot(vector<pair<int,int>> &S,int a, int b , int c){
    int N = S.size();
    vector<pair<int,int>> PS(N);
    auto pt0 = S[0];
    PS[0] = pt0;
    bool flg = true;
    reps(i,1,N){
        int dx = S[i].first - pt0.first;
        int dy = S[i].second - pt0.second;
        int x=dx*a-dy*b;
        int y=dx*b+dy*a;
        if(((x%c)!=0) || ((y%c)!=0)) {flg = false; break;}
        PS[i] = make_pair(x/c+pt0.first, y/c+pt0.second);
    }
    if(flg) return PS;
    else return vector<pair<int,int>>();
}

int main(){
    std::cin.tie(0); // cinとcoutの同期を解除
    std::ios::sync_with_stdio(false);
    int N;cin >> N;

    vector<pair<int,int>> S(N),T(N);
    rep(i,N)
    {
        int x,y;
        cin >> x >> y;
        S[i].first = x;S[i].second = y;
    }

    rep(i,N)
    {
        int x,y;
        cin >> x >> y;
        T[i].first = x;
        T[i].second = y;
    }
    sort(allrange(T));

/*ピタゴラ三角形
    5	12	13
    8	15	17
    3	4	5
*/
/*    vector<vector<int>> tri(12);
    tri[0]={0,1,1};
    tri[1]={-1,0,1};
    tri[2]={0,-1,1};
    tri[3]={1,0,1};
    tri[4]={3,4,5};
    tri[5]={4,3,5};
    tri[6]={-3,4,5};
    tri[7]={-4,3,5};
    tri[8]={-3,-4,5};
    tri[9]={-4,-3,5};
    tri[10]={3,-4,5};
    tri[11]={4,-3,5};*/

    vector<vector<int>> tri(0);
    tri.push_back(vector<int>({3,4,5}));
    tri.push_back(vector<int>({4,3,5}));
    tri.push_back(vector<int>({-3,4,5}));
    tri.push_back(vector<int>({-4,3,5}));
    tri.push_back(vector<int>({0,1,1}));
    tri.push_back(vector<int>({-1,0,1}));
    tri.push_back(vector<int>({0,-1,1}));
    tri.push_back(vector<int>({1,0,1}));
    tri.push_back(vector<int>({-3,-4,5}));
    tri.push_back(vector<int>({-4,-3,5}));
    tri.push_back(vector<int>({3,-4,5}));
    tri.push_back(vector<int>({4,-3,5}));

 //   tri.push_back(vector<int>({-5, -12, 13}));
 //   tri.push_back(vector<int>({-12, -5, 13}));
 //   tri.push_back(vector<int>({-8,-15,17}));
 //   tri.push_back(vector<int>({-15,-8,17}));
 //   tri.push_back(vector<int>({5, 12, 13}));
 //   tri.push_back(vector<int>({12, 5, 13}));
 //   tri.push_back(vector<int>({8,15,17}));
 //   tri.push_back(vector<int>({15,8,17}));
 //   tri.push_back(vector<int>({-5, 12, 13}));
 //  tri.push_back(vector<int>({-12, 5, 13}));
  //  tri.push_back(vector<int>({-8,15,17}));
  //  tri.push_back(vector<int>({-15,8,17}));
 //   tri.push_back(vector<int>({5, -12, 13}));
 //   tri.push_back(vector<int>({12, -5, 13}));
 //   tri.push_back(vector<int>({8,-15,17}));
 //   tri.push_back(vector<int>({15,-8,17}));

    bool flg;

    if(S.size()==2 && T.size()==2){
        auto sx = S[0].first-S[1].first;
        auto sy = S[0].second-S[1].second;
        auto tx = T[0].first-T[1].first;
        auto ty = T[0].second-T[1].second;
        flg= (sx*sx+sy*sy==tx*tx+ty*ty);
    } else {
        rep(j,tri.size()){
            auto S2 = Pitagora_rot(S,tri[j][0],tri[j][1],tri[j][2]);
            if(S2.empty()) continue;
            sort(allrange(S2));
            flg = solve_translated(S2,T);
            if(flg) break;
        }
    }
    if(flg) prl("Yes"); else prl("No");
}


#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}
long long gcd_vec(vector<long long> const &A) { // N個の要素に対する最大公約数
    int size = (int)A.size();
    long long ret = A[0];
    for (int i = 1; i < size; i++) {
        ret = gcd(ret, A[i]);
    }
    return ret;
}
long long lcm2(long long a, long long b) {
    long long d = gcd(a, b);
    return a / d * b;
}
long long lcm(const vector<long long> &vec) {
    long long l = vec[0];
    for (int i = 0; i < vec.size() - 1; i++) {
        l = lcm2(l, vec[i + 1]);
    }
    return l;
}
long long int mypow(long long int a,long long int b){
    long long int i=0,ans;
    for(i=0;i<b;i++)
    {
        if(i==0)
        {
            ans=a;
        }
        else
        {
            ans*=a;
        }
    }
    return ans;
}
struct UnionFind{
    int n;
    vector<int> par; // 親の番号
    vector<int> siz; // サイズを表している。

    // 初期化する。parは自身を指す（iotaは 0 ~ nまでの数字を順に入れていく）
    // size(siz) は最初はすべて１
    UnionFind(int n) : n(n){
        par.resize(n);
        iota(par.begin(),par.end(),0);
        siz.assign(n,1);
    }

    // 頂点の親を求める。
    // 再帰関数を使っており、経路圧縮もしている。
    int root(int x){
        // ここは親の処理。
        if (par[x] == x){
            return x;
        }

        //経路圧縮をしながら値を返す。
        // par[x] = root(par[x]);
        // return par[x];
        // と同じ意味。
        return par[x] = root(par[x]);
    }

    // unite :: a と bを同じグループに入れる。
    // もし初めから同じなら何もしない。
    void unite(int a,int b){
        int ra = root(a);
        int rb = root(b);

        if(ra == rb){
            return;
        }

        // サイズの大きい方にサイズの小さいほうを合成するので、swapしている。
        if (siz[ra] < siz[rb]){
            swap(ra,rb);
        }
        // サイズが大きい方に小さいのを合体
        // 小さいほうの親は大きい方の親になる。
        siz[ra] += siz[rb];
        par[rb] = ra;
    }

    //　同じグループかどうか判定するには、親が一緒かどうかをみたらよい
    bool same(int x,int y){
        return root(x) == root(y);
    }

    // 頂点が含まれるグループの頂点を求める。
    int get_size(int x){
        return siz[root(x)];
    }
};
    long long int facctorialMethod(int k){
    long long int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
#define PI 3.14159265359
int main()
{
	[[maybe_unused]]long long int i=0,j=0,k,n,a[22],h[22],b=0,b1=0,saisyo=9999999999999999;
    set<long long int>st;
    [[maybe_unused]]double qw;
    string s,s1;
    cin >> n;
    if(n%100==0)
    {
        cout << n/100;
    }
    else
    {
        cout << n/100+1;
    }
}

#include<iostream>
#include<cstdio>
using namespace std;

int n;

void solve()
{
	double ans = 0;
	for (int i = 1; i < n; i++) {
		ans += (double)n / i;
	}
	printf("%.10lf\n", ans);
}

int main()
{
	cin >> n;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;
const int MOD = 998244353;
const double pi = acos(-1);
ll gcd(ll a, ll b) {if(b == 0) return a; else return gcd(b,a%b);}
ll lcm(ll a, ll b) {return a*b/gcd(a,b);}

template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {if (val < 0) val += MOD;}
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {return val ? MOD - val : 0;}
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {val += r.val;if (val >= MOD) val -= MOD;return *this;}
    constexpr Fp& operator -= (const Fp& r) noexcept {val -= r.val;if (val < 0) val += MOD;return *this;}
    constexpr Fp& operator *= (const Fp& r) noexcept {val = val * r.val % MOD;return *this;}
    constexpr Fp& operator /= (const Fp& r) noexcept {long long a = r.val, b = MOD, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}val = val * u % MOD;if (val < 0) val += MOD;return *this;}
    constexpr bool operator == (const Fp& r) const noexcept {return this->val == r.val;}
    constexpr bool operator != (const Fp& r) const noexcept {return this->val != r.val;}
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {return os << x.val;}
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {if (n == 0) return 1;auto t = modpow(a, n / 2);t = t * t;if (n & 1) t = t * a;return t;}};

using mint = Fp<MOD>;

const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    COMinit();
    int N,K; cin >> N >> K;
    vector<mint> A(N);
    REP(i,N) {
        int a; cin >> a;
        A[i] = a;
    }

    vector<vector<mint>> f(310,vector<mint>(N,1)),p(310,vector<mint>(N,1));
    vector<mint> T(310), S(310);

    for(int k = 0; k <= K; k++) {
        for(int i = 0; i < N; i++) {
            if(k > 0) f[k][i] = f[k-1][i] * A[i], p[k][i] = p[k-1][i] * (A[i]+A[i]);
            //cout << f[k][i] << " ";
            T[k] += f[k][i];
            S[k] += p[k][i];
        }
        //cout << endl;
    }

    for(int k = 1; k <= K; k++) {
        mint ans = 0;
        for(int i = 0; i <= k; i++) {
            ans += (mint)COM(k,i) * T[i] * T[k-i];
        }
        cout << (ans-S[k])/(mint)2 << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)
#define forr(i,x,n) for(int i = n;i >= x;--i)
#define Angel_Dust ios::sync_with_stdio(0);cin.tie(0)

const int N = 805;
int a[N][N],b[N][N],sum[N][N];
int n,k;

bool check(int limit)
{
    forn(i,1,n) forn(j,1,n) b[i][j] = (a[i][j] <= limit);
    forn(i,1,n) forn(j,1,n) sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + b[i][j];
    forn(i,1,n - k + 1) forn(j,1,n - k + 1) if(sum[i + k - 1][j + k - 1] - sum[i + k - 1][j - 1] - sum[i - 1][j + k - 1] + sum[i - 1][j - 1] >= k * k - k * k / 2)    return 1;
    return 0;
}

int main()
{
    scanf("%d%d",&n,&k);
    forn(i,1,n) forn(j,1,n) scanf("%d",&a[i][j]);
    int l = 0,r = 1e9;
    while(l < r)
    {
        int mid = l + r >> 1;
        if(check(mid))  r = mid;
        else l = mid + 1;
    }
    printf("%d\n",l);
    return 0;
}


#include <math.h>
#include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
#include <tuple>
#include <vector>
#include <cmath>
#include<set>
#include <sstream>
#include <bitset>
#include <queue>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a)  (a).begin(),(a).end()//配列を全部参照

using namespace std;
using ll = long long int;
using Graph = vector<vector<int>>; // グラフ型
//vector<vector<int>> hako(n, vector<int>(2));
//sort(hako.begin(), hako.end(), [](const vector<int>& alpha, const vector<int>& beta) {return alpha[0] < beta[0]; });

int main() {
	cin.tie(nullptr);
	ll n, m,k;
	string s, t;
	ll ans = 0, sum = 0;
	cin >> n;
	vector<int> hako(n);
	rep(i, n) cin >> hako[i];

	rep(i, n) {
		if (hako[i] > 10) {
			ans += hako[i] - 10;
		}
	}

	cout << ans << endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1.0), g = 9.80665;
ll t, tc = 0, i, j, k, n, m, cnt;
bool is;

vector<ll> divisors;
void genDivs(ll n)
{
    for(i=1; i*i<=n; i++) {
        if(n % i == 0) {
            divisors.push_back(i);
            if(i*i != n) divisors.push_back(n/i);
        }
    }
}

void run_cases(void)
{
    tc++;
    cin >> n;
    genDivs(n);
    cnt = 1;
    for(i = 1; i < divisors.size(); i++) {
        if((divisors[i]-1)%2 == 0) cnt++;
    }
    cout << 2*cnt;
}

int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    // cin >> t;
    t = 1;
    // getchar();
    while(t--) {
        run_cases();
    }
    return 0;
}


#include<bits/stdc++.h>
#include<math.h>
#define ll long long
using namespace std;
const int maxn=2e5+5;
#define INF 1e18+5

int n,m;
ll a[maxn];
ll sum1[maxn],sum2[maxn];

int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
    	scanf("%lld",&a[i]);
    sort(a+1,a+1+n);
    for(int i=2;i<=n;i+=2)
    	sum1[i]=sum1[i-2]+abs(a[i]-a[i-1]);
	for(int i=n-1;i>=1;i-=2)
    	sum2[i]=sum2[i+2]+abs(a[i+1]-a[i]);
    ll ans=INF;
    for(int i=1;i<=m;i++){
    	ll x;
		scanf("%lld",&x);
		int p=lower_bound(a+1,a+1+n,x)-a;
		if(p%2==0)//插入偶数位置
			p--;
		ans=min(ans,sum1[p-1]+sum2[p+1]+abs(a[p]-x));
    }
    printf("%lld\n",ans);
    return 0;
}

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define dbg(x) cout << #x << ": " << x << endl
#define clr(x,v) memset(x, v, sizeof(x))
#define dblout(x) cout << setprecision(x) << fixed;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
const int MAXN = 1e6 + 5;

void cp()
{
    int n, m;
    cin >> n >> m;
    vector<ll> arr(n), w(m);
    for(ll &x : arr)
        cin >> x;
    for(ll &x : w)
        cin >> x;

    sort(all(arr));
    vector<ll> odd(n), even(n);
    for(int i = 0; i < n; i++)
    {
        if(i & 1)
            odd[i] += arr[i];
        else
            even[i] += arr[i];
        odd[i] += (i ? odd[i - 1] : 0);
        even[i] += (i ? even[i - 1] : 0);
    }

    ll ans = LLONG_MAX;
    for(int i = 0; i < m; i++)
    {
        int lo = 0, hi = n - 1;
        int pos = -1;
        while(lo <= hi)
        {
            int mid = (lo + hi) >> 1;
            if(arr[mid] <= w[i])
                pos = mid, lo = mid + 1;
            else
                hi = mid - 1;
        }
        ll o = (~pos ? odd[pos] : 0);
        ll e = (~pos ? even[pos] : 0);
        pos++;
        if(pos < n)
            o += even[n - 1] - (pos ? even[pos - 1] : 0);
        if(pos < n)
            e += odd[n - 1] - (pos ? odd[pos - 1] : 0);
        if(pos & 1)
            o += w[i];
        else
            e += w[i];
        ans = min(ans, o - e);
    }
    cout << ans << endl;
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}


#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<vector<int>> c(n, vector<int>(n));

    vector<int> x;

    rep(i, n) {
        rep(j, n) cin >> c[i][j];
        if(x.empty()) {
            rep(j, n - 1) x.push_back(c[i][j + 1] - c[i][j]);
        } else {
            rep(j, n - 1) {
                if(c[i][j + 1] - c[i][j] != x[j]) {
                    cout << "No\n";
                    return 0;
                }
            }
        }
    }

    int mn = 1e9 + 1, ii, y;
    rep(i, n) rep(j, n) if(chmin(mn, c[i][j])) {
        ii = i;
        y = j;
    }

    vector<int> a(n), b(n);
    rep(i, n) a[i] = c[i][y] - mn;
    rep(j, n) b[j] = c[ii][j];

    cout << "Yes\n";
    rep(i, n) cout << a[i] << " \n"[i == n - 1];
    rep(i, n) cout << b[i] << " \n"[i == n - 1];

    return 0;
}

/* HAVE PATIENCE YOU CAN SOLVE EVERY QUESTION
   JUST THINK*/
   //#pragma GCC optimize("Ofast")
   //#pragma GCC optimize ("unroll-loops")
#include<bits/stdc++.h>
//#include <unordered_set>
//#include <unordered_map>

using namespace std;
int mod = 1000000007;
const double pi = 3.141592653689793238460;
const int inf = 0x3f3f3f3f;
const int   N = 2e5 + 5;
const int pr = 31;
#define ll long long
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define MEM(x) memset(x,inf,sizeof(x))
#define fi first
#define se second
#define forn(i, n) for (int i = 0; i< n; i++)
#define forl(i,l,u) for(int i=(int)l;i<=(int)u;++i)
#define all(v) (v).begin(), (v).end()
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
int f(int x, int y, string a[]) {
    int l;
    if (a[x][y] == '+')l = 1;
    else l = -1;
    return l;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    string s;
    cin >> s;
    int ans = 0;
    forn(i, 10000) {
        int x = i;
        vector<bool> v(10,false);
        forn(i, 4) {
            int m = x % 10;
            v[m] = true;
            x /= 10;
        }
        bool ok = true;
        forn(i, 10) {
            if (s[i] == 'o' && v[i] == false) ok = false;
            if (s[i] == 'x' && v[i] == true) ok = false;
        }
        if (ok)ans += 1ll;
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
const int nax=105;
int a[nax];
int32_t main()
{
    int n,res=2e9;
    cin>>n;
    n++;
    string s;
    cin>>s;
    for(int i=1;i<=n;i++)
    cin>>a[i];
    for(int i=1;i<n;i++)
    res=min(res,abs(a[i]-a[i+1]));
    cout<<res<<'\n';
    for(int i=0;i<res;i++)
    {
        for(int j=1;j<=n;j++)
        cout<<(a[j]+i)/res<<' ';
        cout<<'\n';
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int N;
string S;
int A[10101];
int L[101],R[101],B[101];
pair<int,int> P[101];
int ret[101][10101];

int hoge(int v) {
	int i,j;
	int lef[101];
	if(v>=10001) return 0;

	FOR(j,N+1) {
		int sum=0;
		FOR(i,v) {
			ret[j][i]=A[j]/v+(i<A[j]%v);
			sum+=ret[j][i];
		}
		assert(sum==A[j]);
	}

	FOR(i,N) {
		FOR(j,v) {
			if(S[i]=='<' && ret[i][j]>=ret[i+1][j]) return 0;
			if(S[i]=='>' && ret[i][j]<=ret[i+1][j]) return 0;
		}
	}
	return 1;

}

void solve() {
	int i,j,k,l,r,x,y; string s;

	cin>>N>>S;
	FOR(i,N+1) cin>>A[i];

	int re=1;
	for(i=15;i>=0;i--) if(hoge(re+(1<<i))) re+=1<<i;

	assert(hoge(re));

	cout<<re<<endl;
	FOR(i,re) {
		FOR(j,N+1) cout<<ret[j][i]<<" ";
		FOR(j,N) {
			if(S[j]=='<') assert(ret[j][i]<ret[j+1][i]);
			if(S[j]=='>') assert(ret[j][i]>ret[j+1][i]);
		}
		cout<<endl;
	}

}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define forn(i,m,n) for(int i=m;i<n;i++)
#define vv vector
#define vi vv<int>
#define ii pair<int,int>
#define vii vv<ii>
#define mp make_pair
#define pb push_back
#define PI 3.141592653589
#define ll long long
#define pll pair<ll,ll>
#define vl vv<ll>
#define ff first
#define ss second
#define MOD 1000000007

bool is_prime[1000001];
vi prime;
void sieve(int n)
{
	memset(is_prime,true,sizeof(is_prime));
	for(int i=2;i*i<=n;i++)
	{
		if(is_prime[i])
		{
			for(int j=i*i;j<=n;j+=i)
			{
				is_prime[j]=false;
			}
		}
	}
	forn(i,2,n+1)
	{
		if(is_prime[i])
			prime.pb(i);
	}
}

ll ex(ll a,ll b)
{
    ll res=1;
    a=a%MOD;
    while(b)
    {
        if(b%2){res=(res*a)%MOD;b--;}
        b/=2;
        a=(a*a)%MOD;
    }
    return res;
}

ll fermat_inv(ll a){ return ex(a,MOD-2); }
ll max(ll a,ll b){ return a>b?a:b; }
ll min(ll a,ll b){ return a<b?a:b; }

int gcd(int a,int b) { return (a%b==0)?b:gcd(b,a%b); }

int main()
{
    ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        /*#ifndef ONLINE_JUDGE
            freopen("input.txt", "r", stdin);
            freopen("output.txt", "w", stdout);
        #endif*/
    //sieve(1000000);

    int te=1;
    //cin>>te;
    while(te--)
    {
        char s,t;
        cin>>s>>t;
        if(t>='A'&&t<='C')
            cout<<t;
        else
        {   if(s=='Y')
                cout<<(char)(t-'a'+'A');
            else
                cout<<t;
        }
    }
}

#include <bits/stdc++.h>
#include <iostream>
#include <stack>
using namespace std;
int main() {
 int A,B;
 cin >> A >> B;
 cout << 2*A + 100 - B;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forin(in) for(ll i=0; i<(ll)in.size(); i++) cin>>in[i]
#define forout(out) for(ll i=0; i<(ll)out.size(); i++) cout<<out[i]<<" "
#define rep(i, n) for(ll i=0; i<(n); i++)
#define rep_up(i, a, n) for (ll i = a; i < n; ++i)
#define rep_down(i, a, n) for (ll i = a; i >= n; --i)
#define P pair<ll, ll>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define vvvll vector<vector<vector<ll>>>
#define vvll vector<vector<ll>>
#define vll vector<ll>
#define pqll priority_queue<ll>
#define pqllg priority_queue<ll, vector<ll>, greater<ll>>
constexpr ll INF = (1ll << 60);
constexpr ll mod = 1000000007;

int main() {
	string s1, s2, s3;
	vll p = {0,1,2,3,4,5,6,7,8,9};
	set<char> s;
	map<char,int> m;
	vector<char> v;
	cin >> s1 >> s2 >> s3;
	rep(i,s1.size()) s.insert(s1[i]);
	rep(i,s2.size()) s.insert(s2[i]);
	rep(i,s3.size()) s.insert(s3[i]);
	for(auto a:s) v.push_back(a);
	int N = v.size();
	do{
		if(N >= 11) break;

		rep(i,N) {
			m[v[i]] = p[i];
			//cout << v[i] << ":" << p[i] << endl;
		}
		//cout << "------------------" << endl;
		if(m[s1[0]] == 0||m[s2[0]] == 0||m[s3[0]] == 0) continue;
		ll n1 = 0, n2 = 0, n3 = 0;
		rep(i,s1.size()) {
			n1 *= 10;
			n1 += m[s1[i]];
		}
		rep(i,s2.size()) {
			n2 *= 10;
			n2 += m[s2[i]];
		}
		rep(i,s3.size()) {
			n3 *= 10;
			n3 += m[s3[i]];
		}
		if(n1 + n2 == n3) {
			cout << n1 << endl;
			cout << n2 << endl;
			cout << n3 << endl;
			return 0;
		}
	}while(next_permutation(all(p)));
	cout << "UNSOLVABLE" << endl;
}

#include<bits/stdc++.h>
#define err() cout<<"UNSOLVABLE"<<endl,exit(0)
#define N 15
using namespace std;
int tot,a[N],A[N],B[N],C[N];
char t[N];
string s1,s2,s3;
map<char,bool> mp;
map<char,int> rpc;
int main(){
	cin>>s1>>s2>>s3;
	if(s3.size()<max(s1.size(),s2.size()))err();
	for(int i=0;i<s1.size();i++)mp[s1[i]]=1;
	for(int i=0;i<s2.size();i++)mp[s2[i]]=1;
	for(int i=0;i<s3.size();i++)mp[s3[i]]=1;
	if(mp.size()>10)err();
	else{
		for(char i='a';i<='z';i++)
			if(mp[i])t[++tot]=i;
		for(int i=1;i<=10;i++)a[i]=i-1;
		do{
			for(int i=1;i<=tot;i++)rpc[t[i]]=a[i];
			for(int i=0;i<s1.size();i++)A[s1.size()-i]=rpc[s1[i]];
			for(int i=0;i<s2.size();i++)B[s2.size()-i]=rpc[s2[i]];
			for(int i=0;i<s3.size();i++)C[s3.size()-i]=rpc[s3[i]];
			if(!A[s1.size()]||!B[s2.size()]||!C[s3.size()])continue;
			for(int i=1;i<=s3.size()+1;i++)A[i]+=B[i],A[i+1]+=A[i]/10,A[i]%=10;
			bool flag=0;
			for(int i=1;i<=s3.size()+1;i++)if(C[i]!=A[i]){flag=1;break;}
			if(!flag){
				for(int i=0;i<s1.size();i++)cout<<rpc[s1[i]];cout<<endl;
				for(int i=0;i<s2.size();i++)cout<<rpc[s2[i]];cout<<endl;
				for(int i=0;i<s3.size();i++)cout<<rpc[s3[i]];cout<<endl;
				exit(0);
			}
			for(int i=1;i<=s3.size()+1;i++)A[i]=B[i]=C[i]=0;
		}while(next_permutation(a+1,a+1+10));
		err();
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<cmath>
#define SYNC ios::sync_with_stdio(0),cin.tie(0)
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define MOD 998244353
#define EPS 1e-6
#define endl '\n'
using namespace std;
const int MAXN = 214514;

int n;
int f[MAXN];
int visted[MAXN], step;
long long pw;

bool find(int x){
	while(!visted[x]){
		visted[x] = step;
		x = f[x];
	}
	return visted[x] == step;
}
int ksm(long long a, long long p){
	long long res = 1;
	while(p){
		if(p & 1)
			res = res * a % MOD;
		a = a * a % MOD;
		p >>= 1;
	}
	return res % MOD;
}
void solve(){
	cin >> n;
	for(int i = 1; i <= n; ++i)
		cin >> f[i];
	for(int i = 1; i <= n; ++i){
		++step;
		if(!visted[i] && find(i))
			++pw;
	}
	cout << ksm(2, pw) - 1<< endl;
}
int main(){
	SYNC;
	solve();
}

#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

#define LOG(FMT...) fprintf(stderr, FMT);
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef double db;
typedef long long ll;
typedef long double ldb;
typedef unsigned int uint;
typedef unsigned long long ull;
mt19937 mt(std::chrono::system_clock::now().time_since_epoch().count());
uniform_int_distribution<ll> ran(0, 1ll << 62);
void ucin() { ios::sync_with_stdio(0); cin.tie(0); }
template<class T> inline void chkmax(T &x, const T &y) { if(x < y) x = y; }
template<class T> inline void chkmin(T &x, const T &y) { if(x > y) x = y; }
inline ll sqr(ll x) { return x * x; }
inline ll cub(ll x) { return x * x * x; }

const int N = 2e5 + 10;
const int mod = 998244353;
int n, out[N], f[N], sz[N];
bool cir[N];
int find(int x) {
  return x == f[x] ? x : f[x] = find(f[x]);
}
int main() {
  scanf("%d", &n);
  rep(i, 1, n) {
    scanf("%d", out + i);
  }
  rep(i, 1, n) {
    f[i] = i; cir[i] = 0;
  }
  rep(i, 1, n) {
    int x = find(i), y = find(out[i]);
    if(x == y) cir[x] = 1;
    else {
      cir[x] |= cir[y];
      f[y] = x;
    }
  }
  rep(i, 1, n) sz[find(i)] ++;
  int ans = 1;
  rep(i, 1, n) if(find(i) == i) {
    ans = 1ll * ans * (cir[i] ? 2 : sz[i] + 1) % mod;
  }
  ans = ans ? ans - 1 : mod - 1;
  printf("%d\n", ans);
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using db = double;
using vi = vector<int>;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define debug(x) cout << #x << '	' << x <<endl
const int inf = 0x3f3f3f3f;
const db eps = 1e-8;
const int mod = 998244353;
ll qpow(ll a, ll b){
    ll ret = 1;
    while(b){
        if(b&1)ret = ret*a%mod;
        a = a*a%mod;
        b>>=1;
    }
    return ret;
}
const int maxn = 3100;
int n, k;
int dp[maxn][maxn<<1];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k;
    dp[0][0] = 1;
    for(int i=1; i<=n; ++i){
        for(int k=i; k>0; k--){
            dp[i][k] = (dp[i-1][k-1]+dp[i][2*k])%mod;
        }
    }
    cout << dp[n][k]%mod <<"\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using gg = long long;
// MAX
// constexpr gg MAX = 25;
constexpr gg MAX = 1e2 + 5;
constexpr gg mod = 1e9 + 7;
constexpr gg INF = LONG_LONG_MAX / 2;
constexpr double thre = 1e-7;
gg ti, ni, mi, ki, di, pi, xi, yi;
gg v[MAX];
gg dp[MAX][MAX][MAX];
gg dfs(gg p, gg m, gg k, gg s) {
    if (k == 0) {
        return m == 0 ? 0 : -INF;
    }
    if (p == ni) {
        return -INF;
    }
    auto& ans = dp[p][m][k];
    if (ans != LONG_LONG_MIN) {
        return ans;
    }
    return ans = max(dfs(p + 1, m, k, s),
                     dfs(p + 1, (m + s - v[p] % s) % s, k - 1, s) + v[p]);
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> ni >> xi;
    for (gg i = 1; i <= ni; ++i) {
        cin >> v[i];
    }
    gg ans = INF;
    for (gg s = 1; s <= ni; ++s) {
        for (gg i = 0; i <= ni; ++i) {
            for (gg j = 0; j <= s; ++j) {
                for (gg k = 0; k <= s; ++k) {
                    dp[i][j][k] = -INF;
                }
            }
        }
        dp[0][0][0] = 0;
        for (gg i = 1; i <= ni; ++i) {
            for (gg j = 0; j <= s; ++j) {
                for (gg k = 0; k < s; ++k) {
                    dp[i][j][k] = dp[i - 1][j][k];
                    if (j > 0 and
                        dp[i - 1][j - 1][(k - v[i] % s + s) % s] != -INF) {
                        dp[i][j][k] = max(
                            dp[i][j][k],
                            dp[i - 1][j - 1][(k - v[i] % s + s) % s] + v[i]);
                    }
                }
            }
        }
        if (dp[ni][s][xi % s] != -INF)
            ans = min(ans, (xi - dp[ni][s][xi % s]) / s);
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const int MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
// ll cmb(ll r, ll c) {return (c>r||c<0) ? 0:fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

ll vec[100];
ll deg[100];
ll mat[100][100];
int cc[100][100];
ll e[100][100];
int n;

// (인접한 이웃들의 합 + 내 점수*이웃개수)/2 *p 의 확률.
// 어떤 점에서 오는 기여가,
// 내 점수 * (1 - 이웃*p)의 확률.

ll inv(ll x) {
    return mp(x, MOD - 2);
}

void cal(ll a[100][100], ll b[100][100]) {
    ll tmp[100][100] = {0};
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < n; k++)
                tmp[i][j] += a[i][k] * b[k][j] % MOD;
            tmp[i][j] %= MOD;
        }
    memcpy(a, tmp, sizeof(tmp));
}

int main() {
    int m, k;
    scanf("%d %d %d", &n, &m, &k);

    for (int i = 0; i < n; i++) scanf("%lld", &vec[i]);
    for (int i = 0; i < m; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        a--; b--;
        cc[a][b] = cc[b][a] = 1;
        deg[a]++, deg[b]++;
    }

    ll p = inv(m);
    for (int i = 0; i < n; i++) {
        mat[i][i] = p * (m - deg[i]) % MOD;
        mat[i][i] += deg[i] * p % MOD * inv(2) % MOD;
        mat[i][i] %= MOD;
        e[i][i] = 1;
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (cc[i][j] == 0) continue;
            mat[i][j] += inv(2) * p % MOD;
            mat[i][j] %= MOD;
        }
    }

    while (k) {
        if (k & 1) cal(e, mat);
        cal(mat, mat);
        k >>= 1;
    }

    for (int i = 0; i < n; i++) {
        ll sum = 0;
        for (int j = 0; j < n; j++) {
            sum += e[i][j] * vec[j] % MOD;
            // printf("%lld ", e[i][j]);
        }
        printf("%lld\n", sum % MOD);
    }
}

// author: rdd6584

#include<bits/stdc++.h>
using namespace std;
template<typename T>inline bool read(T&x){
x=0;char c=getchar();int f=1;while(!isdigit(c)&&(c!='-')&&(c!=EOF))c=getchar();
if(c==EOF)return 0;if(c=='-')f=-1,c=getchar();
while(isdigit(c)){x=(x<<1)+(x<<3)+(c&15);c=getchar();}x*=f;return 1;
}template<typename T,typename...Args>inline bool read(T&x,Args&...args){bool res=1;res&=read(x);res&=read(args...);return res;}
typedef long long LL;typedef unsigned long long u64;typedef unsigned u32;typedef long double LD;
#define il inline
#define pln putchar('\n')
#define For(i,a,b)  for(int i=(a),(i##i)=(b);i<=(i##i);++i)
#define Rep(i,n)    for(int i=0,(i##i)=(n);i<(i##i);++i)
#define Fodn(i,a,b) for(int i=(a),(i##i)=(b);i>=(i##i);--i)
const int M=1000000007,INF=0x3f3f3f3f;const long long INFLL=0x3f3f3f3f3f3f3f3fLL;
const int N=111;

/*********************数论*********************/
inline LL mul(LL a,LL b,LL p){const LL res=a*b-((LL)((LD)a*b/p)*p);return res<0?res+p:(res<p?res:res-p);}
inline LL fp(LL a,LL b,LL Mod){LL res=(Mod!=1);for(;b;b>>=1,a=a*a%Mod)if(b&1)res=res*a%Mod;return res;}
inline LL fpl(LL a,LL b,LL Mod){LL res=(Mod!=1);for(;b;b>>=1,a=mul(a,a,Mod))if(b&1)res=mul(res,a,Mod);return res;}
template<typename T>inline T gcd(T a,T b){while(b){T t=b;b=a%b;a=t;}return a;}template<typename T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
template<typename T>inline T exgcd(T a,T b,T&x,T&y){T m=0,n=1,t;x=1,y=0;while(b){t=m,m=x-a/b*m,x=t;t=n,n=y-a/b*n,y=t;t=b,b=a%b,a=t;}return a;}
inline LL Crt(LL a1,LL a2,LL mod1,LL mod2){LL u,v;const LL g=exgcd(mod1,mod2,u,v);if((a2-a1)%g)return -1;
const LL m12=abs(lcm(mod1,mod2)),res=(mul(mod1,mul(u,((a2-a1)/g),m12),m12)+a1)%m12;return res<=0?res+m12:res;/*求最小正数解还是非负解*/}
/*********************数论*********************/
LL n,m,k,d[N];
struct Mat{
	LL a[N][N];
	Mat(){memset(a,0,sizeof a);}
	void set(){for(int i=1;i<=n;++i)a[i][i]=1;}
	Mat operator*(const Mat&b)const{
		Mat res;
		for(int i=1;i<=n;++i)for(int k=1;k<=n;++k)for(int j=1;j<=n;++j)res.a[i][j]=(res.a[i][j]+(a[i][k]*b.a[k][j])%M)%M;
		return res;
	}
	Mat pow(LL b)const{
		Mat a=(*this),res;
		for(res.set();b;b>>=1,a=a*a)if(b&1)res=res*a;
		return res;
	}
};

LL a[N],mp[N][N];

LL im;

inline void init(){
	read(n,m,k);im=fpl(2ll*m,M-2,M);
	For(i,1,n)read(a[i]);
	For(i,1,m){
		int u,v;read(u,v);mp[u][v]=1;mp[v][u]=1;++d[u];++d[v];
	}
	For(i,1,n)mp[i][i]=mul((2ll*m-d[i]),im,M);
	For(i,1,n)For(j,1,i-1){
		if(mp[i][j]==0)continue;
		mp[i][j]=mp[j][i]=im;
	}
}
LL ans[N];
inline void solve(){
	Mat f;
	For(i,1,n)For(j,1,n)f.a[i][j]=mp[i][j];
	f=f.pow(k);
	For(i,1,n)For(j,1,n)ans[i]=(ans[i]+mul(a[j],f.a[j][i],M))%M;
	For(i,1,n)ans[i]=(ans[i]+M)%M;
	For(i,1,n)printf("%lld\n",ans[i]);
}
signed main(){
	init();solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MOD int(1e9+7)
#define INF int(1e9)
#define LINF ll(1e18)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define P pair<ll,ll>

int n;
vector<int> to[410000];
int visited[410000];
int cnt;
bool tree;

void dfs(int v, int u=-1){
  if(visited[v]!=0){
    tree=0; return;
  }
  cnt++;
  visited[v]=1;
  for(auto x : to[v]){
    if(x==u) continue;
    dfs(x,v);
  }
  return;
}

int main(){
  cin>>n;
  rep(i,n){
    int a,b; cin>>a>>b;
    a--;b--;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  int ans=0;
  rep(i,410000){
    if(visited[i]!=0) continue;
    tree=1;
    cnt=0;
    dfs(i);
    if(tree) ans+=cnt-1;
    else ans+=cnt;
  }
  cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;
const int N = 4e5+10;
int f[N],s[N];
int ff(int x){return f[x]?f[x]=ff(f[x]):x;}
int main(){
    int n;
    cin>>n;
    int ans = 0;
    for(int i = 1;i <= n;i++){
        int a,b;
        cin>>a>>b;
        int u = ff(a), v = ff(b);
        if(u!=v &&(!s[u]||!s[v]))
                f[u] = v,s[v]|=s[u],ans++;
        else if(!s[u])s[u]=1,ans++;
    }
    cout<<ans<<endl;
}


#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define reps(i,n) for (int i = 1; i <= (n); ++i)
#define rrep(i,n) for (int i = (n) - 1; i >= 0; --i)
#define rreps(i,n) for (int i = (n); i > 0; --i)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define PB push_back
#define MP make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (c == 0) {
    if (a <= b) cout << "Aoki" << endl;
    else cout << "Takahashi" << endl;
  } else {
    if (a >= b) cout << "Takahashi" << endl;
    else cout << "Aoki" << endl;
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,e;
    cin>>a>>b>>c;
    if(c==0)
    {
        if(a==b) {cout<<"Aoki"<<endl;}
        else if(a>b){cout<<"Takahashi"<<endl;}
        else if(a<b){cout<<"Aoki"<<endl;}
    }
    else{
        if(a==b){cout<<"Takahashi"<<endl;}
        else if(a>b){cout<<"Takahashi"<<endl;}
        else if(a<b){cout<<"Aoki"<<endl;}
    }
}