#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bitset>
#include <math.h>

using namespace std;
////using Graph = vector<vector<int>>;
//using Graph = vector<vector<int>>;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef long long LL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<string, int> P;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define REP(i,n)  for(int i=0; i<(n); i++)

//constant
//--------------------------------------------
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const LL MOD = 1e9+7;
//vector <vector<int>> x(20, vector<int> (20)), y(20,vector<int> (20));
/*int counter_1 (int x) {
    if(x == 0) return 0;
    return counter_1(x >> 1) + (x & 1);
}*/

//int Counter(int x)
/*int factorial(int n) {
    if (n > 0) {
        return n * factorial(n - 1);
    } else {
        return 1;
    }
}*/
/*int factorial(int n) {
    if (n > 0) {
        return n * factorial(n - 1);
    } else {
        return 1;
    }
}
LL sum(LL a, LL b){
    LL cnt=0;
    cnt=(b-a+1)*(a+b)/2;
    return cnt;
}
LL yaku(int x){
    vector<pair<LL, LL> a=[];
    LL xh;
    if(x==1){
        pair<LL, LL> tmp;
        tmp=MP(1,1);
        return tmp;
    }
    else{
        FOR(i, 1, x/2+1){
            if(x%i==0){
                a.append(MP(i,x/i));
            }
        }
    }
    return a;

}*/
LL cul(int a, int b){
    LL f = pow(a,4)+pow(a,3)*b+pow(a,2)*pow(b,2)+a*pow(b,3)+pow(b,4);
    return f;
}
//using Graph = vector<vector<int>>;
//int H, W;
/*vector<tuple<int,int,int> G;
VI color;
bool dfs(const VVI &G, int v, int iro = 0) {
    color[v]=0// v を訪問済にする
    for(auto next_v : G[v]){
        if(color[next_v] != -1){
            if
        }
        dfs(nh, nw, cnt); // 再帰的に探索
    }
}*/
int main(){
    char s,t;
    cin >> s;
    cin >> t;
    if(s=='Y'){
        t-=32;
    }
    cout << t <<endl;
}

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

// 定義
typedef long long         ll;
typedef pair<ll, ll>      P;
#define ALL(x)            (x).begin(),(x).end()
#define REP(i, n)         for(ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)     for(ll i = m ; i < (ll)n ; ++i)
#define VL                vector<ll>
#define VVL               vector<vector<ll>>
#define VVVL              vector<vector<vector<ll>>>
#define INF               (ll)2e9
#define INF_LL            1LL<<60
//#define MOD             998244353
#define MOD               1000000007

ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
ll FloorN(ll x, ll n)     { return (x - x % n); }
bool IsOdd(ll x)          { return ((x & 1) == 1); }
bool IsEven(ll x)         { return ((x & 1) == 0); }

// dfs
ll ansOne = 0;
vector<vector<int>>	G;
vector<bool>		isUsed;
void dfs(int from, int to)
{
	ansOne++;
	for (auto nextTo : G[to]) {
		if (from != nextTo) {
			if (!isUsed[nextTo]) {
				isUsed[nextTo] = true;
				dfs(to, nextTo);
			}
		}
	}
}

// 処理
void Solve()
{
	ll N, M;
	cin >> N >> M;
	G.clear();
	G.resize(N);
	REP(i, M) {
		ll a, b;
		cin >> a >> b;
		a--; b--;
		G[a].emplace_back(b);
	}

	int ans = 0;
	REP(i, N) {
		isUsed.clear();
		isUsed.resize(N, false);
		isUsed[i] = true;
		ansOne = 0;
		dfs(-1, i);
		ans += ansOne;
	}

	cout << ans << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int check(int n,int base)
{
    int flag=0;
    while(n!=0)
    {
        int rem=(n%base);
        if(rem==7)
        {
            flag=1;
            break;
        }
        n/=base;
    }
    return flag;
}
int main()
{
    int n;
    cin>>n;
    char a[32];
    string b;
    int count=0;
    for(int i=1;i<=n;i++)
    {
        if(check(i,8)==0&&check(i,10)==0)
        count++;
    }
    cout<<count;
    return 0;
}

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

#define fr(i,n) for(int i = 0; i<n; i++)
#define sz(v) (int)(v.size())
#define prin(a) cout << #a << " = " << a << endl
#define prinv(v) cout << #v << " = "; for(auto it : v) cout << it << ", "; cout << endl
#define all(v) (v).begin(),(v).end()

typedef long long ll;

#define rmin(a,b) a = min<ll>(a,b)
#define rmax(a,b) a = max<ll>(a,b)

#define fi first
#define se second

bool not7(ll x, ll b){
	while(x){
		if(x%b==7) return 0;
		x/=b;
	}
	return 1;
}

bool ok(int x){
	return not7(x,8) and not7(x,10);
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;

	ll ans = 0;

	for(int i = 1; i<=n; i++) if(ok(i)) ans++;
	cout << ans << "\n";
}


#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

using ll = long long int;

int N;
const int MAXN=205;
int A[MAXN];
bool dp[MAXN][MAXN][MAXN];
int  ans[MAXN][MAXN][MAXN];
bool dp2[MAXN][MAXN];
int ans2[MAXN][MAXN];

int main(){

    scanf("%d",&N);
    for(int i=1;i<=N;i++)
        scanf("%d",A+i);

    dp2[0][0]=true;
    for(int i=0;i<N;i++){
        for(int j=0;j<200;j++){
            if (!dp2[i][j]) continue;
            int v=A[i+1]%200;
            dp2[i+1][j]=true;
            dp2[i+1][(j+v)%200]=true;
            ans2[i+1][(j+v)%200]=1;
        }
    }

    vector<int> x,y;
    int curv=0;
    for(int i=N;i>0;i--){

        if (ans2[i][curv]==1){
            x.push_back(i);
            curv=(curv+200-(A[i]%200))%200;
        }else x.push_back(i),y.push_back(i);
    }

    if (x.size()!=y.size()&&y.size()!=0&&x.size()!=0){
        puts("Yes");
        printf("%d ",(int)x.size());
        while(!x.empty()) printf("%d ",x.back()),x.pop_back();
        putchar('\n');
        printf("%d ",(int)y.size());
        while(!y.empty()) printf("%d ",y.back()),y.pop_back();
        putchar('\n');
        return 0;
    }

    dp[0][0][0]=true;
    for(int i=0;i<N;i++){
        for(int j=0;j<200;j++){
            for(int k=0;k<200;k++){
                const auto& cur=dp[i][j][k];
                if (!cur) continue;
                int v=A[i+1]%200;

                if (!dp[i+1][j][k]){
                    dp[i+1][j][k]=true;
                    ans[i+1][j][k]=0;
                    // printf("%d %d\n",j,k);
                }
                if (!dp[i+1][(j+v)%200][k]||ans[i][j][k]!=1||ans[i+1][(j+v)%200][k]==0){
                    dp[i+1][(j+v)%200][k]=true;
                    ans[i+1][(j+v)%200][k]=1;
                    // printf("%d %d\n",(j+v)%200,k);
                }
                if (!dp[i+1][j][(k+v)%200]||ans[i][j][k]!=2||ans[i+1][j][(k+v)%200]==0){
                    dp[i+1][j][(k+v)%200]=true;
                    ans[i+1][j][(k+v)%200]=2;
                    // printf("%d %d\n",j,(k+v)%200);
                }
            }
        }
    }

    vector<int> X,Y;
    int ANS=0;
    for(int i=199;i>=0;i--){
        if (dp[N][i][i]){
            // printf("i=%d\n",i);
            int a=i,b=i;
            ANS=i;

            for(int i=N;i>0;i--){
                // printf("a=%d b=%d\n",a,b);
                // printf("ans=%d\n",ans[i][a][b]);
                int v=A[i]%200;
                if (ans[i][a][b]==1){
                    X.push_back(i);
                    a=(a+200-v)%200;
                }else if (ans[i][a][b]==2){
                    Y.push_back(i);
                    b=(b+200-v)%200;
                }
            }

            break;
        }
    }

    // printf("%d %d\n",(int)X.size(),(int)Y.size());
    if (X.size()!=0&&Y.size()!=0){
        puts("Yes");
        printf("%d ",(int)X.size());
        while(!X.empty()) printf("%d ",X.back()),X.pop_back();
        putchar('\n');
        printf("%d ",(int)Y.size());
        while(!Y.empty()) printf("%d ",Y.back()),Y.pop_back();
        putchar('\n');
    }
    // }else if (ANS==0&&(X.size()+Y.size())!=N&&(X.size()+Y.size())!=0){
    //     puts("Yes");

    //     for(int i=1;i<=N;i++)
    //         if (find(X.begin(),X.end(),i)==X.end()&&find(Y.begin(),Y.end(),i)==Y.end()){
    //             X.push_back(i),Y.push_back(i);
    //         }
    //     sort(X.begin(),X.end());
    //     sort(Y.begin(),Y.end());
    //     printf("%d ",(int)X.size());
    //     while(!X.empty()) printf("%d ",X.back()),X.pop_back();
    //     putchar('\n');
    //     printf("%d ",(int)Y.size());
    //     while(!Y.empty()) printf("%d ",Y.back()),Y.pop_back();
    //     putchar('\n');
    // }
    else puts("No");

    return 0;
}

#pragma region head
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using vv = vector<vector<T>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rrepi(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bit(n) (1LL << (n))
template <class T>
inline bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
const int INF = 1002003004;
const ll LINF = 1002003004005006007ll;
struct preprocess {
    preprocess() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} ____;
#pragma endregion head

#pragma region library
#pragma endregion library

int main() {
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    ll ans = 0;
    int er = -1;
    queue<int> wait;
    int cnt = 0;
    rep(i, n) {
        if (s[i] == '1') cnt++;
        if (t[i] == '1') cnt--;
    }
    if (cnt < 0 || cnt % 2) {
        cout << -1 << '\n';
        return 0;
    }
    rep(i, n) {
        if (er != -1) {
            if (t[i] == '1') {
                wait.push(i);
            }
            if (s[i] == '1') {
                ans += i - er;
                er = -1;
            }
        } else {
            if (t[i] == '1') {
                wait.push(i);
            }
            if (s[i] == '1') {
                if (wait.empty()) {
                    er = i;
                } else {
                    ans += i - wait.front();
                    wait.pop();
                }
            }
        }
    }
    if (er != -1 || !wait.empty()) {
        cout << -1 << '\n';

    } else {
        cout << ans << '\n';
    }
}


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

int main() {
	string S;
	cin >> S;
	bool unreadable = true;;
	int s = S.length();
	for(int i = 0;i < s;i++) {
		if(i%2==0){
			if(!islower(S[i])){
			unreadable=false;
			}
		}else{
			if(!isupper(S[i])){
				unreadable=false;
			}
		}
	}
		if(unreadable) {
			cout << "Yes";
		}
		else{
			cout << "No";
		}

		return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <random>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#include <unordered_map>
#include <iomanip>
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define pi 3.141592653589793
#define prique priority_queue
constexpr auto mod=1000000007;
constexpr auto MOD=1000000000000000;
using namespace std;
int gcd(int a,int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a*b/gcd(a,b);
}
bool prime(int n){
    int cnt=0;
    for(int i=1;i<=sqrt(n);i++){
        if(n%1==0)cnt++;
    }
    if(cnt!=1) return false;
    else return n!=1;
}
void syou(int a,double b){
    cout<<setprecision(a)<<b<<endl;
}
void Ye(){
    cout<<"Yes"<<endl;
}
void No(){
    cout<<"No"<<endl;
}
void YE(){
    cout<<"YES"<<endl;
}
void NO(){
    cout<<"NO"<<endl;
}
struct UnionFind{
    vector<int> r;
    UnionFind(int N){
        r=vector<int>(N,-1);
    }
    int root(int x){
        if(r[x]<0) return x;
        return r[x]=root(r[x]);
    }
    bool unite(int x,int y){
        x=root(x);
        y=root(y);
        if(x==y) return false;
        if(r[x]>r[y]) swap(x,y);
        r[x]+=r[y];
        r[y]=x;
        return true;
    }
    int size(int x){
        return -r[root(x)];
    }
};
struct Edge{
    int to;
    int weight;
};
struct fenwick_tree {
    typedef int T;
    T n;
    vector<T> bit;
    fenwick_tree(T num) : bit(num+1, 0) { n = num; }
    void add(T i, T w) {
        for (T x = i; x <= n; x += x & -x) {
            bit[x] += w;
        }
    }
    T sum(T i) {
        T ret = 0;
        for (T x = i; x > 0; x -= x & -x) {
            ret += bit[x];
        }
        return ret;
    }
    T sum(T left, T right) {
        return sum(right) - sum(left);
    }
};
bool flag;
int n,m,cnt=0,ans=0,aa[330000];
pair<int,int> pp[220000];
string s,sa,ss[220000];
queue<int> que;
vector<int> v;
signed main(){
    cin>>s;
    rep(i,s.size()){
        if(i%2==0&&s[i]<='Z'){
            cout<<"No"<<endl;
            return 0;
        }elif(i%2==1&&s[i]>='a'){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


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

int main(){

    long long ans = 0;

    long long N;
    cin >> N;
    long long A[N], B[N], C[N];
    for(int i = 0; i < N; i++){
        cin >> A[i];
        A[i]--;
    }
        for(int i = 0; i < N; i++){
        cin >> B[i];
        B[i]--;
    }
        for(int i = 0; i < N; i++){
        cin >> C[i];
        C[i]--;
    }

    long long A_num[N] = {0};
    for(int i = 0; i < N; i++){
        A_num[A[i]]++;
    }

    long long C_num[N] = {0};
    for(int i = 0; i < N; i++){
        C_num[C[i]]++;
    }

    for(int i = 0; i < N; i++){
        if(C_num[i] != 0){
            ans += (C_num[i] * A_num[B[i]]);
        }
    }

    cout << ans << endl;
}

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

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

//MACROS
#define ll long long
//to be excluded in critical cases(thanks to @Amank2854) https://codeforces.com/contest/1538/submission/119014768
#define int ll
#define endl "\n"
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define umap unordered_map
#define all(v) v.begin() , v.end()
#define min3(a1,b1,cost) min(a1,min(b1,cost))
#define min4(a1,b1,cost,d ) min(a1 , min(b1 , min(cost,d)))
#define max3(a1,b1,cost) max(a1 , max(b1,cost))
#define max4(a1,b1,cost,d) max(max(a1,b1) , max(cost,d))
#define vecti vector<int>
#define ld long double
#define debug(a) cout<<a<<endl;
#define debugtwo(a1,b1) cout<<a1<<" "<<b1<<endl;
#define pq priority_queue
#define pii pair<int,int>
#define frq(NN)  for(int UUU=0;UUU<(NN);UUU++)
#define minvec *min_element
#define maxvec *max_element
#define fori(II,GG,HH) for(int II=(GG);II<(HH);II++)
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define rep(RRR,FFF)  for(auto &RRR:FFF)
#define sz(AA)  (int)((AA).size())
#define minus cout<<"-1\n";
#define zero cout<<"0\n";
#define print(x) cout<<(x)<<endl;
#define read(FDFDFDF)  for(auto &FFFF:FDFDFDF){cin>>FFFF;}
// Array utils
#define ub upper_bound
#define lb lower_bound
#define bs binary_search
int comb(int n, int r)
{if(r<0||r>n)return 0;if((n-r)<r)r=n-r; // nCr
int a=1;for(int i=n;i>n-r;--i){a=a*i;}for(int i=1;i<r+1;++i){a=a/i;}return a;}

// Bitwise operations
int Set(int qq , int pos){return (qq|(1<<pos));}
int chk(int qq , int pos){return (qq&(1<<pos));}
int p2(int idx){return ((1LL<<idx));};

// Maths//Modular exponential
int modpow(int x, int n, int m)
{
   if (n == 0) return 1%m;
   int u = modpow(x,n/2,m);
   u = (u*u)%m;
   if (n%2 == 1) u = (u*x)%m;
   return u;
}

int gcd(int a,int b)                  //gcd function
{
    if(b==0)
    return a;
    else return gcd(b,a%b);
}

int _pow(int a, int b)
{
   if(!b)return 1;
   ll temp = _pow(a, b/2);
   temp = (temp * temp);
   if(b%2)return (a * temp);
   return temp;
}
int ceil(int a, int b){if(a%b)return 1 + a/b;return a/b;}

void printvec(const vecti &AAA)
{
   for(auto SDDD:AAA)cout<<SDDD<<" ";
   cout<<endl;
}
int dx[] = {0 , 0 , -1 , 1};
int dy[] = {1 , -1 , 0 , 0};

const int MOD = 1e9 + 7;
const int N = 1e5+10;
const int inf = 1e18;

struct DSU
{
    vecti PAR;
    DSU(int NN)
   {
      PAR = vecti(NN+1,-1);
   }
    int getpar(int x) { return PAR[x] < 0 ? x : PAR[x] = getpar(PAR[x]); }
    bool samepar(int a, int b) { return getpar(a) == getpar(b); }
    int rank(int x) {return -PAR[getpar(x)]; }
    bool unite(int x, int y) { // union by rank
        x = getpar(x), y = getpar(y); if (x == y) return 0;
        if (PAR[x] > PAR[y]) swap(x,y);
        PAR[x] += PAR[y]; PAR[y] = x; return 1;
    }
};

void solve()
{
  int n;cin>>n;
  vecti a(n);read(a);

  DSU stt=DSU(2e5+10);

  for(int i=0;i<n/2;i++)
  {
     if(a[i]==a[n-i-1])continue;

     stt.unite(a[i],a[n-i-1]);
  }
  int sum=0;
  for(int i=1;i<=2e5+10;i++)
  {
     if(stt.getpar(i)==i)
     {
        sum+=(stt.rank(i)-1);
     }
  }

  cout<<sum<<endl;

}

signed main()
{
   IOS
   int TESTS=1;
   // cin>>TESTS;
   int GOOOGLE=1;
   while(TESTS--)
   {
      // cout<<"Case #"<<GOOOGLE<<": ";
      solve();
      // cout<<flush;
      GOOOGLE++;
   }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  cout<<2*a+100-b<<endl;
}

#pragma region head
    #include <bits/stdc++.h>
    using namespace std;
    using ll = long long;
    using vi = vector<int>;
    using vll = vector<ll>;
    using pi = pair<int, int>;
    using pll = pair<ll,ll>;
    template <class T> using vv = vector<vector<T>>;
    #define rep(i,n) for(int i = 0; i < (int)(n); i++)
    #define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
    #define rrep(i,n) for(int i = (int)(n)-1; i >= 0; i--)
    #define rrepi(i,a,b) for(int i = (int)(b)-1; i >= (int)(a); i--)
    #define all(x) (x).begin(), (x).end()
    #define rall(x) (x).rbegin(), (x).rend()
    #define bit(n) (1LL<<(n))
    template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
    template<class T> inline bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
    const int INF = 1002003004;
    const ll LINF = 1002003004005006007ll;
    struct preprocess{preprocess()
    {cin.tie(nullptr);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}}____;
#pragma endregion head

#pragma region library
#pragma endregion library

int main(){
    int a, b; cin >> a >> b;
    int ans = max(0,2*a+100-b);
    cout << ans << '\n';

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

ll N;
vector<pair<ld,ld>> P;
ld dist[110][110];

map<ld,bool> rad;

void init() {
    cin >> N;
    rep(i,N) {
        ld x, y; cin >> x >> y;
        P.push_back({x,y});
    }
    rep(i,N) {
        rep(j,N) {
            if (i==j) continue;
            ld from_x = P[i].first, from_y = P[i].second;
            ld to_x = P[j].first, to_y = P[j].second;
            ld dx = to_x - from_x, dy = to_y - from_y;
            dist[i][j] = sqrt(dx*dx+dy*dy);
        }
        dist[i][N] = dist[N][i] = (ld)100 - P[i].second;
        dist[i][N+1] = dist[N+1][i] = P[i].second + (ld)100;
    }
    dist[N][N+1] = dist[N+1][N] = 200.0;
    rep(i,N+2) rep(j,N+2) {
        rad[dist[i][j]*0.5] = true;
    }
    rad[100.0] = true;
}

bool judge(ld r) {
    ld d = (ld)2*r;
    vector<vector<ll>> G(N+2);
    rep(i,N+2) rep(j,N+2) {
        if (dist[i][j]>=d) continue;
        G[i].push_back(j);
    }
    queue<ll> que;
    que.push(N);
    vector<bool> seen(N+2);
    seen[N] = true;
    while (que.size()) {
        ll x = que.front();
        que.pop();
        for (ll y : G[x]) {
            if (seen[y]) continue;
            seen[y] = true;
            que.push(y);
        }
    }
    return seen[N+1];
}

void solve() {
    init();
    ld ans = 0.0;
    for (auto p : rad) {
        ld r = p.first;
        bool NG = judge(r);
        if (NG) break;
        ans = r;
    }
    cout << fixed << setprecision(10);
    cout << ans << endl;
}

int main() {
    solve();
}

#include <bits/stdc++.h>

using namespace std;

#define vt          vector
#define sz(x)       int((x).size())
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

using ll = long long;
using pii = pair<int, int>;

#define die return void(cout << "No")
#define die2 { pass = false; break; }

void solve() {
    int n;
    cin >> n;
    vt<pii> a(n);
    for (pii &x : a) cin >> x.fi >> x.se;
    sort(all(a));

    set<int> check;
    for (int i = 0; i < n; i++) {
        if (~a[i].fi && ~a[i].se && a[i].fi >= a[i].se) die;
        if (~a[i].fi && check.count(a[i].fi)) die;
        if (~a[i].se && check.count(a[i].se)) die;

        check.insert(a[i].fi);
        check.insert(a[i].se);
    }

    vt<bool> ok(n * 2 + 1);
    vt<int> m1cnt(n * 2 + 1);
    ok[0] = true;
    for (int i = 0; i < n; i++) {
        if (!~a[i].fi && !~a[i].se) m1cnt[0]++;
    }

    for (int i = 0; i < n * 2; i += 2) {
        if (!ok[i]) continue;

        for (int j = i + 2; j <= n * 2; j += 2) {
            int jump = (j - i) / 2;
            bool pass = true;
            vt<bool> used(n * 2 + 1);

            for (pii &x : a) {
                if (~x.fi && ~x.se &&
                        i < x.fi && x.fi <= j &&
                        i < x.se && x.se <= j) {
                    if (x.se - x.fi != jump) die2;
                    if (x.fi > i + jump) die2;
                    if (x.se <= i + jump) die2;

                    if (used[x.fi]) die2;
                    used[x.fi] = true;
                } else if (~x.fi && i < x.fi && x.fi <= j) {
                    if (x.fi > i + jump) die2;

                    if (used[x.fi]) die2;
                    used[x.fi] = true;
                } else if (~x.se && i < x.se && x.se <= j) {
                    if (x.se <= i + jump) die2;

                    if (used[x.se - jump]) die2;
                    used[x.se - jump] = true;
                }
            }

            if (pass) {
                int r_cnt = jump;
                for (int k = i + 1; k <= i + jump; k++) {
                    if (used[k]) r_cnt--;
                }

                if (m1cnt[i] >= r_cnt) {
                    m1cnt[j] = max(m1cnt[j], m1cnt[i] - r_cnt);
                    ok[j] = true;
                }
            }
        }
    }

    if (ok.back()) cout << "Yes";
    else cout << "No";
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0);

    int tcs = 1;
    for (int tc = 1; tc <= tcs; tc++) {
        // cout << "Case " << tc << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;
int k,p[200005];
vector<int> divk[200005];
long long ans;
int main() {
    cin>>k;
    for (int i=1; i<=sqrt(k); i++) {
        for (int j=i; i*j<=k; j++) {
            if (i!=j) p[i*j]+=2;
            else p[i*j]++;
        }
    }
    for (int i=1; i<=k; i++) {
        for (int j=i; j<=k; j+=i) divk[j].push_back(i);
    }
    for (int i=1; i<=k; i++) {
        for (int j=0; j<divk[i].size(); j++) {
            int x=(i/divk[i][j]);
            ans+=p[x];
        }
    }
    cout<<ans<<'\n';
}

#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
        freopen("inp.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
 	int n;
 	cin>>n;
 	if(n%100==0)
 		cout<<n/100;
 	else
 		cout<<(n/100)+1;
	return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define mod 1000000007
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
std::mt19937 rnd(time(NULL));
#define rand rnd
#define pr std::pair<int,int>
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
template<class T>void cxk(T&a,T b){a=a>b?a:b;}
template<class T>void cnk(T&a,T b){a=a<b?a:b;}
#ifdef mod
int pow(int x,int y){
	int ret=1;
	while(y){
		if(y&1)ret=1ll*ret*x%mod;
		x=1ll*x*x%mod;y>>=1;
	}
	return ret;
}
template<class Ta,class Tb>void inc(Ta&a,Tb b){a=a+b>=mod?a+b-mod:a+b;}
template<class Ta,class Tb>void dec(Ta&a,Tb b){a=a>=b?a-b:a+mod-b;}
#endif
int main(){
#ifdef LOCAL
	freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
#endif
	int n=gi();
	char caa,cab,cba,cbb;
	caa=getchar();getchar();
	cab=getchar();getchar();
	cba=getchar();getchar();
	cbb=getchar();getchar();
	if(cab=='B'){
		std::swap(caa,cbb);
		caa=((caa-'A')^1)+'A';
		cba=((cba-'A')^1)+'A';
		cab=((cab-'A')^1)+'A';
	}
	if(caa=='A')puts("1");
	else if(cba=='B')printf("%d\n",n==2?1:pow(2,n-3));
	else{
		int f[1010]={1,1};
		for(int i=2;i<=n;++i)f[i]=(f[i-1]+f[i-2])%mod;
		printf("%d\n",f[n-2]);
	}
	return 0;
}

//yukicoder@cpp14
//coder:luckYrat(twitter:@luckYrat_)
//dijkstraから逃げるな
//おすすめの曲
//https://soundcloud.com/nagiha/alice-in-a-xxxxxxxx
//https://soundcloud.com/synthion/sweetheart

//せんげん！
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>

//なまえくーかん！
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

//てーすう！
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);

//でふぁいん！
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)

//みじかく！
#define pb push_back
#define mkp make_pair
#define fir first
#define scn second
#define ednl endl

//いぇすのー！
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

//きんぼーnほーこー！！
P ar4[4] = {mkp(0,1),mkp(0,-1),mkp(1,0),mkp(-1,0)};
P ar8[8] = {mkp(-1,-1),mkp(-1,0),mkp(-1,1),mkp(0,-1),mkp(0,1),mkp(1,-1),mkp(1,0),mkp(1,1)};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
  int a,b,c;cin>>a>>b>>c;
  if(c%2){
    if(a>b){
      cout << ">" << endl;
    }else if(a<b){
      cout << "<" << endl;
    }else{
      cout << "=" << endl;
    }
  }else{
    if(abs(a)==abs(b)){
      cout << "=" << endl;
    }else if(abs(a)>abs(b)){
      cout << ">" << endl;
    }else{
      cout << "<" << endl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
#define all(v) v.begin(), v.end()
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep_up(i, a, b) for (ll i = a; i < b; ++i)
#define rep_down(i, a, b) for (ll i = a; i > b; --i)

#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second

#define vvvvll vector<vector<vector<vector<ll>>>>
#define vvvll vector<vector<vector<ll>>>
#define vvll vector<vector<ll>>
#define vll vector<ll>

#define vvvvdo vector<vector<vector<vector<double>>>>
#define vvvdo vector<vector<vector<double>>>
#define vvdo vector<vector<double>>
#define vdo vector<double>

#define maze(S, H, W) vector<vector<char>> S(H, vector<char>(W))

#define pqll priority_queue<ll>
#define pqllg priority_queue<ll, vector<ll>, greater<ll>>

constexpr ll INF = (1ll << 60);
// constexpr ll mod = 998244353;
constexpr ll mod = 67280421310721;
// constexpr ll mod = 1e18+3;
// ll mod = 1000000007;
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T &a, T b) {
    if (a >= b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
void pt(T val) {
    cout << val << "\n";
}
template <typename T>
void pt_vll(vector<T> &v) {
    ll vs = v.size();
    rep(i, vs) {
        cout << v[i];

        if (i == vs - 1)
            cout << "\n";
        else
            cout << " ";
    }
}
template <typename T>
void pt_vvll(vector<vector<T>> &v) {
    ll vs = v.size();
    rep(i, vs) pt_vll(v[i]);
}

template <typename X, typename Y>
void pt_pair(pair<X, Y> val) {
    cout << val.fi << " " << val.se << "\n";
}

template <typename X, typename Y>
void pt_vpair(vector<pair<X, Y>> &v) {
    rep(i, v.size()) pt_pair(v[i]);
}

ll gcd(ll a, ll b) {
    if (a % b == 0) return b;
    return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll modpow(ll x, ll n) {
    ll ret = 1;
    if (x < 0) return 0ll;
    while (n > 0) {
        if (n & 1) ret = ret * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return ret;
}
ll minv(ll a, ll m) { return modpow(a, m - 2); }

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

    ll t;
    cin >> t;
    while (t--) {
        ll N;
        cin >> N;
        string s1, s2, s3;
        cin >> s1 >> s2 >> s3;
        string ans;
        rep(i, N) ans.push_back('1');
        rep(i, N) ans.push_back('0');
        ans.push_back('1');
        pt(ans);
    }
    return 0;
}

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 60;

// 負の数にも対応した mod
// 例えば -17 を 5 で割った余りは本当は 3 (-17 ≡ 3 (mod. 5))
// しかし単に -17 % 5 では -2 になってしまう
inline long long mod(long long a, long long m) {
    return (a % m + m) % m;
}

// 拡張 Euclid の互除法
// ap + bq = gcd(a, b) となる (p, q) を求め、d = gcd(a, b) をリターンします
long long extGcd(long long a, long long b, long long &p, long long &q) {
    if (b == 0) { p = 1; q = 0; return a; }
    long long d = extGcd(b, a%b, q, p);
    q -= a/b * p;
    return d;
}

// 中国剰余定理
// リターン値を (r, m) とすると解は x ≡ r (mod. m)
// 解なしの場合は (0, -1) をリターン
pair<long long, long long> ChineseRem(long long b1, long long m1, long long b2, long long m2) {
  long long p, q;
  long long d = extGcd(m1, m2, p, q); // p is inv of m1/d (mod. m2/d)
  if ((b2 - b1) % d != 0) return make_pair(0, -1);
  long long m = m1 * (m2/d); // lcm of (m1, m2)
  long long tmp = (b2 - b1) / d * p % (m2/d);
  long long r = mod(b1 + m1 * tmp, m);
  return make_pair(r, m);
}

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T; cin >> T;
    while(T--){
        ll X, Y, P, Q; cin >> X >> Y >> P >> Q;
        ll ans = LLINF;
        //(2X+2Y)n + X <= t <= (2X+2Y)n + X + Y - 1 &&
        //(P+Q)n + P <= t <= (P+Q)(n+1) - 1
        for(ll alpha = X; alpha <= X+Y-1; alpha++){
            for(ll beta = P; beta <= P+Q-1; beta++){
                pair<ll, ll> temp = ChineseRem(alpha, X*2 + Y*2, beta, P+Q);
                if(temp != pair<ll, ll>(0, -1)) ans = min(ans, temp.first);
            }
        }
        if(ans == LLINF) cout << "infinity" << endl;
        else cout << ans << endl;
    }
    return 0;
}


#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>
#include <fstream>
#include <cassert>
#include <numeric>
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;
//using mint = modint;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region 一次元座圧
template <typename T>
vector<T> compress(vector<T> &X)
{
	vector<T> vals = X;
	sort(all(vals));
	vals.erase(unique(all(vals)), vals.end());
	rep(i, (int)X.size())X[i] = lower_bound(all(vals), X[i]) - vals.begin();
	return vals;
}

#pragma endregion
#pragma endregion

int main()
{
	int h, w; cin >> h >> w;
	vector<string> v(h);
	rep(i, h)cin >> v[i];
	int res = 0;
	rep(i, h)rep(j, w - 1)
	{
		if (v[i][j] == '.' && v[i][j + 1] == '.')++res;
	}
	rep(i, h - 1)rep(j, w)
	{
		if (v[i][j] == '.' && v[i + 1][j] == '.')++res;
	}
	cout << res << endl;
}

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

int main() {
  int h, w, ans = 0;
  cin >> h >> w;
  char s[h][w];
  for (int i = 0; i < h; i++)
    for (int j = 0; j < w; j++)
      cin >> s[i][j];
  for (int i = 0; i < h - 1; i++)
    for (int j = 0; j < w; j++)
      if (s[i][j] == '.' && s[i + 1][j] == '.')
        ans++;
  for (int i = 0; i < h; i++)
    for (int j = 0; j < w - 1; j++)
      if (s[i][j] == '.' && s[i][j + 1] == '.')
        ans++;
  cout << ans;
  return 0;
}


#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <vector>
#include <numeric>

int main(){
    int N,X; std::cin >> N >> X;
    std::string s;
    std::cin >> s;
    for(const auto& c : s){
        X += (c == 'o' ? 1 : -1);
        X = std::max(0,X);
    }
    std::cout << X << std::endl;
}

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <=b ; ++i)
#define per(i, b, a) for(int i = b; i >= a; --i)
#define ll long long
#define pb push_back
using namespace std;
inline void rd(int &x){scanf("%d", &x);}
inline void rd(ll &x){scanf("%lld", &x);}
int n, m, k;
const int maxn = 1145;
int par[maxn << 1];
int findroot(int u)
{
    return par[u] == u ? par[u] : (par[u] = findroot(par[u]));
}
void merge(int u, int v)
{
    if(findroot(u) == findroot(v)) return;
    par[findroot(u)] = v;
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0);
    cin >> n >> m;
    rep(i, 1, n + m) par[i] = i;
    rep(i, 1, n)
    {
        string s;
        cin >> s;
        rep(j, 1, m) if(s[j - 1] == '#') merge(i, n + j);
    }
    merge(1, n + 1), merge(1, n + m), merge(n, n + 1), merge(n, n + m);
    int ans = 0;
    unordered_set<int> r, c;
    rep(i, 1, n) r.insert(findroot(i));
    rep(j, 1, m) c.insert(findroot(j + n));
    cout << min(r.size(), c.size()) - 1;
}


#include <bits/stdc++.h>

using namespace std;

#define mod 1000000007
#define pi 3.1415926535897932384626433832795
#define FOR(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define FORL(i, a, n) for (ll(i) = (a); (i) <= (n); (i)++)
#define FORR(i, a, n) for (ll(i) = (a); (i) >= (n); (i)--)
#define FORSQ(i, a, n) for (ll(i) = (a); (i) * (i) <= (n); ++(i))
#define FOREACH(a, b) for (auto &(a) : (b))
#define f first
#define s second
#define pb push_back
#define pon pop_back
#define mp make_pair
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SIZE(v) (ll) v.size()
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz))

typedef long long int ll;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<pll> vll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef priority_queue<ll> PQMAX;
typedef priority_queue<ll, vector<ll>,
                       greater<ll>>
    PQMIN;
typedef set<ll> setll;
typedef map<ll, ll> mapll;

ll power(ll x, ll y, ll p)
{
    ll res = 1;

    x = x % p;

    if (x == 0)
        return 0;

    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;

        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

void solve()
{
    ll n, m;
    cin >> n >> m;
    cout << power(10, n, m * m) / m % m << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);

    cin.tie(NULL);
    cout.tie(NULL);

    ll t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include <atcoder/all>
using namespace std;
//using namespace boost::multiprecision;
//using namespace atcoder;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define RFOR(i, a, n) for (ll i = (ll)n - 1; i >= (ll)a; i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define bra(firstsecond) '(' << first< ',' << second< ')'
//constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
ll INF = 1001001001001001;
long double EPS = 1e-8;
long double PI = 3.141592653589793238;
template <typename T>
void remove(std::vector<T> &vector, unsigned int index)
{
   vector.erase(vector.begin() + index);
}

random_device seed_gen;
mt19937_64 rnd(seed_gen());

ll range_rand(ll a,ll b){
    uniform_int_distribution<ll> dist_res(a,b);
    return dist_res(rnd);
}

using Graph = vector<vector<ll>>;

// MOD確認

ll N,M;
Graph G(2010);

ll done[2010];
void dfs(ll x,ll a){
    ll n = G[x].size();
    done[x] = 1;
    rep(i,n){
        ll y = G[x][i];
        if(y != a && !done[y]) dfs(y,x);
    }
    return ;
}

int main(){
    cin >> N >> M;
    rep(i,M){
        ll a,b;
        cin >> a >> b;
        a--;
        b--;
        G[a].emplace_back(b);
    }
    ll ans = 0;
    rep(i,N){
        rep(j,N) done[j] = 0;
        dfs(i,-1);
        rep(j,N) if(done[j]) ans++;
    }
    cout << ans << 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;
typedef	long long ll;
typedef long double ld;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef set<int> si;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define fi first
#define se second
#define pi 3.141592653589793
#define mod 998244353
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define pqmax priority_queue<int>
#define pqmin priority_queue<int,vi,greater<int>>
#define fio ios_base::sync_with_stdio(0), cin.tie(NULL)
#define tc int tt;cin>>tt;for(int ti=1;ti<=tt;ti++)
#define case_g "Case #"<<ti<<": "
#define RED "\033[31m"
#define GREEN "\033[32m"
#define RESET "\033[0m"
#define sleep for (int i = 1, a;i < 100000000;i++, a = a * a)
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> ranked_pairset;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ranked_set;
typedef tree<int, int, less<int>, rb_tree_tag, tree_order_statistics_node_update> ranked_map;

const int N = 2001;

vi adj[N];
vb vis;
int ans = 0;

void dfs(int u) {
	vis[u] = 1;
	ans++;
	for (auto v : adj[u])
		if (!vis[v])
			dfs(v);
}

int main() {
	fio;
	int n, m;
	cin >> n >> m;
	for (int i = 0;i < m;i++) {
		int u, v;
		cin >> u >> v;
		adj[u].pb(v);
	}
	for (int i = 1;i <= n;i++) {
		vis.assign(n + 1, 0);
		dfs(i);
	}
	cout << ans << '\n';
}

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

const int inf = 1000000009;
const int maxn = 100005;
const int maxk = 17;

vector <int> g_init[maxn];
vector <pair <int, int> > g[maxk];
int d[maxk][1 << maxk];

int32_t main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, m;
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		g_init[u].push_back(v);
		g_init[v].push_back(u);
	}
	int k;
	cin >> k;
	vector <int> c(k);
	for (int i = 0; i < k; ++i)
		cin >> c[i];
	bool can = 1;
	for (int j = 0; j < k; ++j) {
		int root = c[j];
		vector <int> dist(n + 1, inf);
		queue <int> q;
		dist[root] = 0;
		q.push(root);
		while (!q.empty()) {
			int u = q.front();
			q.pop();
			for (int v: g_init[u]) {
				if (dist[v] == inf) {
					dist[v] = dist[u] + 1;
					q.push(v);
				}
			}
		}
		for (int i = 0; i < k; ++i) {
			if (dist[c[i]] == inf)
				can = 0;
			else if (i != j)
				g[j].push_back(make_pair(i, dist[c[i]]));
		}
	}
	if (!can) {
		cout << "-1\n";
		return 0;
	}
	set <pair <int, pair <int, int> > > dset;
	for (int i = 0; i < k; ++i) {
		for (int mask = 0; mask < (1 << k); ++mask)
			d[i][mask] = inf;
		d[i][1 << i] = 1;
		dset.insert(make_pair(d[i][1 << i], make_pair(i, (1 << i))));
	}
	while (!dset.empty()) {
		pair <int, int> u = dset.begin() -> second;
		dset.erase(dset.begin());
		for (pair <int, int> e: g[u.first]) {
			int v = e.first, w = e.second;
			if (d[v][u.second | (1 << v)] > d[u.first][u.second] + w) {
				dset.erase(make_pair(d[v][u.second | (1 << v)], make_pair(v, (u.second | (1 << v)))));
				d[v][u.second | (1 << v)] = d[u.first][u.second] + w;
				dset.insert(make_pair(d[v][u.second | (1 << v)], make_pair(v, (u.second | (1 << v)))));
			}
		}
	}
	int ans = inf;
	for (int i = 0; i < k; ++i)
		ans = min(ans, d[i][(1 << k) - 1]);
	cout << ans << '\n';
}


#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAXN = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007;
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll n,m ;
ll mul(ll x, ll y)
{
    return (x * 1ll * y) % m;
}

ll fastpow(ll x, ll y)
{
    ll z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
ll modinv(ll n,ll p)
{
	return fastpow(n,p-2) ;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.first != b.first) {
      return a.first < b.first;
    }
    return a.second >b.second;
  }
};

int main(int argc, char** argv)
{   sws ;
 // cout<<setprecision(10);
//  ll google=0 ;

   // tcase
    {
     ll l,r ;
     cin>>l>>r;
     ll ans[r+1]={0} ;
     ll val[r+1]={0} ;
     for(int i=r;i>=2;i--)
     {  ll cnt=0,k=0,temp=0 ; ;
     	for(int j=2*i;j<=r;j+=i)
     	{
     		if(j>=l&&j<=r)
     		{

			 k++ ;
			 temp+=val[j] ;
     	    }
     	    cnt+=ans[j] ;
		}
		val[i]=k ;
		ans[i]=(k*(k-1))/2-cnt-temp ;
	//	cout<<ans[i]<<" ";
	 }
	 ll fin=0 ;
	 for(int i=2;i<=r;i++)
	 {
	 fin+=ans[i] ;
// cout<<2*ans[i]<<" ";
	 }
	 cout<<2*fin<<"\n" ;
    }
return 0 ;
}

#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define p(x,y) pair<x,y>
#define oset(x) tree<x, null_type, less<x>, rb_tree_tag, tree_order_statistics_node_update>
#define all(x) (x).begin(),(x).end()
#define ll long long
#define scan(a) for(auto &it:a)cin>>it;
#define print(a) {for(auto it:a)cout<<it<<" ";cout<<endl;}
#define out(x) cout<<((x)?"YES":"NO")<<endl;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define int ll

void solve()
{
    int l,r;
    cin>>l>>r;
    int cnt[r+1]={};//count of distinct prime if more than 1 same prime than INT_MIN
    rep(i,2,r+1)
    {
        if(cnt[i]!=0)
            continue;
        for(ll j=i;j<=r;j+=i)
            cnt[j]++;
        for(ll j=i*i*1LL;j<=r;j+=i*i*1LL)
            cnt[j]=INT_MIN;
    }
    //counting comprime in l,r;
    int copairs=0;//coprime pairs(x,y) where x<y
    rep(i,1,r+1)
    {
        if(cnt[i]<0)
            continue;
        ll mul=(r/i)-((l-1)/i);
        ll pairs=(mul*(mul-1))/2;
        if(cnt[i]%2)
            copairs-=pairs;
        else
            copairs+=pairs;
    }
    copairs*=2LL;
    int gcdgpairs=0; //(x,y) pairs where k*x=y k>1
    for(int i=max(l,2LL);i<=r;i++)
        gcdgpairs+=(r/i)-1;
    gcdgpairs*=2LL;
    int equalpairs=r-l+1;
    int ans=(r-l+1)*(r-l+1)-gcdgpairs-copairs-equalpairs;
    cout<<ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int t=1;
    //init();
    //cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

#define debug(x) cerr << #x << " = " << x << endl

using namespace std;
typedef long long LL;

const int MAXN = 55;
const int MOD = 1E9 + 7;
LL n, x, a[MAXN], g[MAXN], dp[MAXN][2];

template <class T>
void read(T& x) {
    x = 0;
    T f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
    while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}

template <class T, class... Args>
void read(T& x, Args&... args) {
    read(x), read(args...);
}

signed main() {
    read(n, x);
    for (int i = 1; i <= n; i++) read(a[i]);
    for (int i = n; i >= 1; i--) {
        if (!x) break;
        g[i] = x / a[i], x %= a[i];
    }
    for (int i = n - 1; i >= 1; i--) {
        LL lim = a[i + 1] / a[i];
        if (g[i] == 0) {
            dp[i][0] = dp[i + 1][0];
            dp[i][1] = dp[i + 1][1] + dp[i + 1][0] + 1;
        } else if (g[i] == lim - 1) {
            dp[i][0] = dp[i + 1][0] + dp[i + 1][1] + 1;
            dp[i][1] = dp[i + 1][1];
        } else {
            dp[i][1] = dp[i + 1][1] + dp[i + 1][0] + 1;
            dp[i][0] = dp[i + 1][0] + dp[i + 1][1] + 1;
        }
    }
    cout << dp[1][0] + 1;
    return 0;
}

/**
*    author: Dooloper
*    created: 01.05.2021 20:57:29
**/

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repp(i,k, n) for(int i = (int)(k); i < (int)(n); i++)
#define ALL(a)  (a).begin(),(a).end()
using ll = long long;
using P = pair<int, int>;
struct Edge{int to; ll w; Edge(int to, ll w) : to(to), w(w) {}};
using Graph = vector<vector<Edge>>;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};

int n;
vector<vector<int>> x(3030, vector<int>(5));

int getMask(int i, int lim){
    int res = 0;
    rep(j,5) if(lim <= x[i][j]) res += 1 << j;
    return res;
}

vector<int> cnt(1<<5);

bool check(int lim){
    rep(i, 1<<5) cnt[i] = 0;
    rep(i,n) cnt[getMask(i,lim)]++;
    rep(msk1,1 << 5) rep(msk2,1<<5) rep(msk3,1<<5) {
        if((msk1 | msk2 | msk3) == (1<<5)-1 && 0 < cnt[msk1] && 0 < cnt[msk2] && 0 < cnt[msk3]) return true;
    }
    return false;
}

int main(){
    cin >> n;
    rep(i,n) rep(j,5) cin >> x[i][j];

    int ok = 0; int ng = 1000000007;
    while(ok + 1 != ng){
        int md = (ok+ng)/2;
        if(check(md)) ok = md;
        else ng = md;
    }
    cout << ok << endl;

}


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

#define IOS         ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll            long long
#define t()           int t;cin>>t;while(t--)
#define lt()          long long int t;cin>>t;while(t--)
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];

#define  nik(i,k,n)    for (int i = k; i < (n); ++i)

void fast()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
}

void solve()
{
	ll n, m;
	cin >> n>> m;
	if(m%n == 0){
		cout << "Yes" <<endl;
		return ;
	}
	cout << "No" << endl;

}
int32_t main()
{
	fast();
	//lt(){
		solve();
	//}
	return 0;
}

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

const int maxn=200005;
const int inf=1ll<<60;

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int a,b;
	cin>>a>>b;
	cout<<(b%a==0?"Yes":"No");
}


// This code wrote by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
#define int long long
#define ALL(x) (x).begin(),(x).end()
#define mem(x,y) memset(x,y,sizeof x)
#define sz(x) (int)(x).size()
#define ln std::puts("")
#define lsp std::putchar(32)
#define pb push_back
#define MP std::make_pair
#define dbg(x) std::cerr<<__func__<<"\tLine:"<<__LINE__<<' '<<#x<<": "<<x<<"\n"
#define dprintf(x...) std::fprintf(stderr,x)
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,b,a) for(int i=(b);i>=(a);--i)
template <class t> inline void read(t &s){s=0;
reg int f=1;reg char c=getchar();while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
while(isdigit(c))s=(s<<3)+(s<<1)+(c^48),c=getchar();s*=f;return;}
template<class t,class ...A> inline void read(t &x,A &...a){read(x);read(a...);}
template <class t> inline void write(t x){if(x<0)putchar('-'),x=-x;
int buf[21],top=0;while(x)buf[++top]=x%10,x/=10;if(!top)buf[++top]=0;
while(top)putchar(buf[top--]^'0');return;}
inline void setIn(std::string s){freopen(s.c_str(),"r",stdin);return;}
inline void setOut(std::string s){freopen(s.c_str(),"w",stdout);return;}
inline void setIO(std::string s=""){setIn(s+".in");setOut(s+".out");return;}
template <class t>inline bool checkmin(t&x,t y){if(x>y){x=y;return 1;}return 0;}
template <class t>inline bool checkmax(t&x,t y){if(x<y){x=y;return 1;}return 0;}
inline int lowbit(int x){return x&(-x);}
inline void work()
{
	reg int l,r;read(l,r);
	if(r-l+1<l)
		return std::puts("0"),void();
	reg int ans=(r-l+1-l+1)*(r-l+1);
	ans-=(l+r-l+1)*(r-l+1-l+1)/2;
	write(ans),ln;
}
signed main(void)
{
	int t;read(t);
	while(t--)
		work();
	return 0;
}

/*
 * Check List:
 * 1. Input / Output File (OI)
 * 2. long long
 * 3. Special Test such as n=1
 * 4. Array Size
 * 5. Memory Limit (OI) int is 4 and longlong is 8
 * 6. Mod (a*b%p*c%p not a*b*c%p  ,  (a-b+p)%p not a-b )
 * 7. Name ( int k; for(int k...))
 * 8. more tests , (T=2 .. more)
 * 9. blank \n after a case
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//turn on extra precision
//#pragma GCC target("fpmath=387")

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef string str;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
#define fbo find_by_order
#define ook order_of_key
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(),x.rend()
#define watch(x) cout << (#x) << " is : " << (x) << newl

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
vi dirx = {0,0,1,-1};
vi diry = {1,-1,0,0};
char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 122) return char(x-32);
    if( 65 <= int(x) && int(x) <= 90) return x;
    return -1;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 122) return x;
    if( 65 <= int(x) && int(x) <= 90) return char(x+32);
    return -1;
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57) return int(x-'0');
    if(97 <= int(x) && int(x) <= 122) return int(x-96);
    if(65 <= int(x) && int(x) <= 90) return int(x-64);
    return -1;
}
bool isect (int l1, int r1, int l2, int r2){
    pii p1 = {l1,r1};
    pii p2 = {l2,r2};
    if(p1>p2)swap(p1,p2);
    return (p2.fi <= p1.se);
}
ll quickpow (ll num1, ll num2, ll MOD){
    if(num2==0)return 1%MOD;
    else if(num2==1)return num1%MOD;
    else{
        ll temp = quickpow (num1,num2>>1LL,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2&1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return quickpow (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/__gcd(num1,num2))*num2;}
// end of Template
int n;
ll pd[200010],w,sum[200010];
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    cin >> n >> w;
    for(int i = 0; i < n; ++i){
        ll l, r, p; cin >> l >> r >> p;
        pd[l] += p;
        pd[r] -= p;
    }
    bool ok = true;
    for(int i = 0; i <= 2e5; ++i) {
        sum[i] = (i ? sum[i-1] : 0) + pd[i];
        ok &= (w >= sum[i]);
    }
    cout << (ok ? "Yes\n" : "No\n");

    return 0;
}


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

int main(){

	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	int x, y; cin >> x >> y;
	if(abs(x-y) < 3){
		cout << "Yes";
	}else{
		cout << "No";
	}
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define ll long long int
#define tc ll t;cin>>t;while(t--)
#define PI 2*acos(0)
#define mset(pq) memset(pq, 0, sizeof(pq));

ll M=1e9+7;

int sum_digit(int x) { int sum=0; while(x>0){ sum+=x%10; x/=10; } return sum; }
int reverse_num(int n){ int tmp=n, ans=0, r; while(tmp>0){ r=tmp%10; ans=ans*10+r; tmp/=10; } return ans; }
ll factorial(ll n){ ll i, ans=1; for(i=n; i>1; i--){ans*=i;} return ans; }
ll gcd(ll num1, ll num2) { ll a,b,r; a=num1; b=num2; r=a%b; while(r>0){ a=b; b=r; r=a%b; } return b; }
ll lcm(ll num1, ll num2) { return (num1*num2)/gcd(num1, num2); }
bool isprime(ll n) { if(n<2) return false; for(ll i=2;i<=sqrt(n);i++){ if(n%i==0)return false;} return true; }

/// Depression is a leading cause of disability
/// Verily, with hardship comes ease. [94:6], Qur'an

void solve()
{
    int a, b, c, d, i, j, k, m, n, x, y, z, p;
    int cnt=0, flag=0;
    char ch, ch1, ch2;
    string s, t;
    cin >> a >> b;
    m=min(a, b);
    if((m+3)>max(a, b))
        cout << "Yes";
        else
            cout << "No";

    //cout << cnt << endl;
}
int main()
{
    //tc
    solve();
    return 0;
}

/*

*/
// sort(arr, arr+n);
// reverse(s.begin(), s.end()); // reversing a string
// getline( cin, s);
/*
vector <int> arr;
for(i=0; i<n; i++)
    arr.push_back(i);
*/

/* set of string
set<string>s;
    for(i=0; i<n; i++)
    {
        cin >> t;
        s.insert(t);
    }
    for(auto it=s.begin(); it!=s.end(); it++)
    {
        //string s2 = *it;
        cout << *it << endl;
    }
*/


#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#include <numeric>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
#define mod1 1610612741
#define mul 31
#define PI 3.14159265358979323846264
//#include bits/stdc++.h
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
//priority_queue<pair<lli,pair<lli,lli>>>e;
vector <lli> p[300005],q[300005],f(200005,-1),d(300005,0),a(300005);
//vector<set<lli>>s(200005);
//set<pair<lli,lli>>s;
//vector<vector<lli>> dp(200005,vector<lli>(25,0));
//vector<lli>f(10000005);
//lli b[1000005],l[1000005];
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
//map<pair<lli,lli>,lli>mp,np;
//vector<pair<pair<lli, lli>,lli> > st;
//queue<lli> qy;
//freopen("codecoder.in", "r", stdin);
//freopen("codecoder.out", "w", stdout);
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
void check()
{
    cout<<"HI"<<endl;
}
lli comb(lli i,lli j)
{
    if(j>i)return 0;
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
pair<ld,ld>az(ld a,ld b,ld c,ld d,ld u)
{
    ld x1=(a-c)*cos(u)-(b-d)*sin(u)+c;
    ld y1=(a-c)*sin(u)+(b-d)*cos(u)+d;
    return {x1,y1};
}
/*void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli t;t=1;
    while(t--)
    {
        lli n;cin>>n;
        vector<lli> a(n);
        for(lli i=0;i<n;i++)
            cin>>a[i];
        lli cnt=min(8ll,n);
        vector<vector<lli>> b(200,vector<lli>(0));
        for(lli i=1;i<(1ll<<cnt);i++)
        {
            vector<lli>v;
            lli s=0;
            for(lli j=0;j<cnt;j++)
            {
                if(i&(1ll<<j))
                {
                    v.pb(j+1);
                    (s+=a[j])%=200;
                }
            }
            if(b[s].size()!=0)
            {
                cout<<"Yes"<<endl;
                cout<<b[s].size()<<" ";
                for(lli j=0;j<b[s].size();j++)
                {
                    cout<<b[s][j]<<" ";
                }
                cout<<endl;
                cout<<v.size()<<" ";
                for(lli j=0;j<v.size();j++)
                {
                    cout<<v[j]<<" ";
                }
                cout<<endl;
                return 0;
            }
            else
            {
                b[s]=v;
            }
        }
        cout<<"No"<<endl;
    }
}

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

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 rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>

using ll = long long;
//using mint = modint;

const vector<int> dx = {1, 1,  1, 0,  0, 0, -1, -1, -1};
const vector<int> dy = {1, 0, -1, 1, -1, 0,  1,  0, -1};
const double PI = 3.141592653589793;
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;
const ll mod2 = 998244353;

const int MAX = 1000000;
const ll MOD = 998244353;
const ll big = 1ll<<60;

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }

int main(){
    ll n;
    cin >> n;
    vector<ll>a(n+10);
    vector<queue<ll>>v(210);
    vector<vector<bool>>seen(n+10, vector<bool>(210, false));
    rep(i, 0, n){
        cin >> a[i+1];
        a[i+1] %= 200;
        if(a[i+1]==0){
            seen[i+1][200] = true;
        }
    }
    rep(i, 0, n+5){
        seen[i][0] = true;
    }
    lrep(i, 1, n+1){
        lrep(j, 0, 201){
            if(seen[i-1][j] && v[(j+a[i])%200].empty()){
                //queue<ll> temp = v[j];
                v[(j+a[i])%200] = v[j];
                v[(j+a[i])%200].push(i);
                seen[i][(j+a[i])%200] = true;
                seen[i][j] = true;
            }else if(seen[i-1][j] && !v[(j+a[i])%200].empty()){
                queue<ll> temp1 = v[j];
                queue<ll> temp2 = v[(j+a[i])%200];
                temp1.push(i);
                if(temp1==temp2)continue;
                cout << "Yes" << endl;
                cout << temp1.size() << " ";
                while(!temp1.empty()){
                    cout << temp1.front() << " ";
                    temp1.pop();
                }
                cout << endl;

                cout << temp2.size() << " ";
                while(!temp2.empty()){
                    cout << temp2.front() << " ";
                    temp2.pop();
                }
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


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

int main()
{
    int h, w;
    cin >> h >> w;

    vector<string> s(h);
    rep (i, h)
        cin >> s[i];

    int ans = 0;
    rep (i, h)
        rep (j, w)
        {
            if (j + 1 < w && s[i][j] == '.' && s[i][j + 1] == '.')
                ans++;
            if (i + 1 < h && s[i][j] == '.' && s[i + 1][j] == '.')
                ans++;
        }

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

#include <bits/stdc++.h>
#define LL long long
#define LD long double
#define MAXN
#define MAXM
#define P 998244353
#define MP make_pair
#define PB push_back
#define INF 0x3f3f3f3f
#define dbg(a...) fprintf(stderr, a)
using namespace std;

int h, w, ans=1;
char mp[505][505];
int main()
{
    scanf("%d%d", &h, &w);
    for(int i=1; i<=h; ++i) {
        scanf("%s", mp[i]+1);
    }
    for(int i=2; i<=h+w; ++i) {
        int flag=0;
        for(int j=1; j<i; ++j) {
            int x=j, y=i-j;
            if(x>h || y>w) continue;
            if(mp[x][y]=='B') {
                if(flag==2) ans=0;
                else flag=1;
            }
            if(mp[x][y]=='R') {
                if(flag==1) ans=0;
                else flag=2;
            }
            //printf("%d %d %d\n", x, y, flag);
        }
        if(flag==0) ans=ans*2%P;
    }
    printf("%d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define rep(i, a, n) for (int i=(a); i<(n); i++)
#define per(i, a, n) for (int i=(a); i>(n); i--)
typedef long long ll;
const int maxn = 2e5+5;
const int mod = 1e9+7;
using namespace std;

ll a[maxn], ti[maxn];

void solve() {
	ll n,q,t; cin >> n;
	ll L=0,R=0,add=0,ext=1e18,Lval=-1e18,Rval=1e18;
	rep(i,0,n) cin >> a[i] >> ti[i];
	rep(i,0,n) {
		if (ti[i] == 1) {
			if (ext != 1e18) {
				ext += a[i];
				continue;
			}
			add += a[i];
			if (Lval != -1e18) {
				Lval += a[i];
			}
			if (Rval != 1e18) {
				Rval += a[i];
			}
		} else if (ti[i] == 2) {
			if (ext != 1e18) {
				ext = max(ext, a[i]);
				continue;
			}
			if (a[i] < Lval) continue;
			L = a[i] - add;
			Lval = a[i];
			if (Lval >= Rval) {
				ext = Lval;
			}
		} else {
			if (ext != 1e18) {
				ext = min(ext, a[i]);
				continue;
			}
			if (a[i] > Rval) continue;
			R = a[i] - add;
			Rval = a[i];
			if (Rval <= Lval) {
				ext = Rval;
			}
		}
	}
	cin >> q;
	//cout << L << ' ' << Lval << ' ' << R <<  ' ' << Rval << '\n';
	rep(i,0,q) {
		cin >> t;
		if (ext != 1e18) cout << ext << '\n';
		else {
			if (Lval == -1e18 && Rval == 1e18) cout << t + add << '\n';
			else if (t <= L && Lval != -1e18) cout << Lval << '\n';
			else if (t >= R && Rval != 1e18) cout << Rval << '\n';
			else if (Rval != 1e18) cout << Rval - (R - t) << '\n';
			else cout << Lval + t - L << '\n';
		}
	}
}

int main(int argc, char * argv[]) {
	ios_base::sync_with_stdio(false); cin.tie(0);
	//int t; cin >> t; while(t--)
	solve();

    return 0;
}

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>

#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define all(v) (v).begin(),(v).end()
#define all_rev(v) (v).rbegin(),(v).rend()
#define debug(x) cout << #x << ": " << x << '\n';
#define degreeToRadian(deg) (((deg)/360)*2*M_PI)
#define radianTodegree(rad) (((rad)/2/M_PI)*360)

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; }

using namespace std;
using ll = long long;
using P = pair<int,int>;
using PL = pair<ll, ll>;
const ll INF = 1LL<<60;
const int MOD = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  //cin.tie(0);ios::sync_with_stdio(false);
  //cout << fixed << setprecision(15);
  ll N;
  cin >> N;

  if (N < 1000) {
    cout << 0 << '\n';
    exit(0);
  }

  string t = "9999999999999999";
  ll ans = 0;

  while (stoll(t) >= N) t = t.substr(0, t.size() - 1);
  while (t.size() >= 3 && N > stoll(t)) {
    ans += (N - stoll(t)) * (t.size() / 3);

    N -= N - stoll(t);
    t = t.substr(0, t.size() - 1);
  }

  cout << ans << '\n';
  return 0;
}


#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>

using namespace std;

using ll = long long;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define sz(x) (int)(x).size()
#define ms(arr, v) memset(arr, v, sizeof(arr))
#define f first
#define s second
#define pb push_back

// clang-format off
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T_vector>void output_vector(const T_vector &v, bool add_one = false, int start = -1, int end = -1) {if (start < 0) start = 0; if (end < 0) end = int(v.size()); for (int i = start; i < end; i++) cout << v[i] + (add_one ? 1 : 0) << (i < end - 1 ? ' ' : '\n');}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << "(" << v.first << ":" << v.second << ")" << ","; os << "}"; return os; }

auto random_address = [] {char *p = new char; delete p;return uint64_t(p);};
const uint64_t SEED = chrono::steady_clock::now().time_since_epoch().count() * (random_address() | 1);
mt19937_64 rng(SEED);
// clang-format on

void solve() { }

int main() {
     int n;
     cin >> n;
     int ans = 0;
     set<int> st;
     for (int i = 1; i <= n; ++i) {
          bool ok = true;
          for (int base : { 8, 10 }) {
               int x = i;
               while (x > 0) {
                    if (x % base == 7) ok = false;
                    x /= base;
               }
          }
          if (ok)
               ++ans;
     }
     // for (auto x : st)
     //      cout << x << " ";
     // cout << st.size();
     cout << ans << endl;
     return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back

int main()
{
    string S;
    cin >> S;
    cout << S[1] << S[2] << S[0] << endl;

    return 0;
}

/*

*/

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

string S;

int main() {
  cin >> S;
  printf("%c%c%c\n", S[1], S[2], S[0]);
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,srt,end) for(int i = (srt); i < (int)(end); i++)
//cout << std::fixed << std::setprecision(15) << y << endl;

// For debug
// Ref: https://qiita.com/ysuzuki19/items/d89057d65284ba1a16ac
#define dump(var)  do{std::cerr << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cerr << e << "\n";}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cerr << e << " "; } std::cerr << "\n";}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ std::cerr << "\n"; for(const auto& v : vv){ view(v); } }
template<typename T> void dump_cout(const T& v) { for(long long i = 0; i < v.size(); i++) std::cout << v[i] << (i == v.size()-1 ? "\n" : " "); }

// mex : https://rsk0315.hatenablog.com/entry/2020/10/11/125049
struct nekoset {
private:
    std::set<std::pair<int, int>> s;
    std::map<int, int> nums;

public:
    nekoset() {
        s.emplace(INT_MIN, INT_MIN);
        s.emplace(INT_MAX, INT_MAX);
    }

    bool contains(int x) const {
        auto it = std::prev(s.lower_bound(std::make_pair(x+1, x+1)));
        auto [l, u] = *it;
        return l <= x && x <= u;
    }

    // 追加した関数
    bool erase(int x) {
        nums[x] = 0;
        auto nit = s.lower_bound(std::make_pair(x+1, x+1));
        auto it = std::prev(nit);
        auto [l, u] = *it;
        if (l == x && x == u) s.erase(it);
        else if(l == x) {
            s.erase(it);
            s.emplace(x+1, u);
        }
        else if(u == x) {
            s.erase(it);
            s.emplace(l, x-1);
        }
        else if(l < x && x < u){
            s.erase(it);
            s.emplace(l, x-1);
            s.emplace(x+1, u);
        }
        else return false;
        return true;
    }

    bool insert(int x) {
        nums[x]++;
        auto nit = s.lower_bound(std::make_pair(x+1, x+1));
        auto it = std::prev(nit);
        auto [l, u] = *it;
        auto [nl, nu] = *nit;
        if (l <= x && x <= u) return false;
        if (u == x-1) {
            if (nl == x+1) {
                s.erase(it);
                s.erase(nit);
                s.emplace(l, nu);
            } else {
                s.erase(it);
                s.emplace(l, x);
            }
        } else {
            if (nl == x+1) {
                s.erase(nit);
                s.emplace(x, nu);
            } else {
                s.emplace(x, x);
            }
        }
        return true;
    }

    int mex(int x = 0) const {
        auto [l, u] = *std::prev(s.lower_bound(std::make_pair(x+1, x+1)));
        if (l <= x && x <= u) {
            return u+1;
        } else {
            return x;
        }
    }

    void view() {
        for(auto [u, v] : s) {
            cerr << "[" << u << "," << v << "] ";
        }
        cerr << "\n";
    }

    bool reduce(int x, int y) {
        assert(nums[x] >= y);
        nums[x] -= y;
        if(nums[x] == 0) return erase(x);
        return true;
    }

    bool reduce(int x) {
        return reduce(x, 1);
    }
};

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    rep(i, 0, n) cin >> a[i];

    nekoset s;
    rep(i, 0, m) {
        s.insert(a[i]);
    }

    int ans = s.mex();
    rep(i, 0, n-m){
        s.insert(a[i+m]);
        s.reduce(a[i]);
        ans = min(ans, s.mex());
    }
    // set<pair<int,int>> s の中身を見てdebugしたい
    s.view();
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define SZ(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef double db;
typedef pair <int, int> Pii;
typedef pair <ll, int> Pli;
typedef unsigned long long ull;
const double eps = 1e-8;
const int mod = (int)(1e9) + 7;
const int inf = 0x7fffffff;
const int N = (int)(2e6) + 7;

int n, m, a[N], g[N];
ll t[N];
int lowbit(int x) {
    return x & -x;
}
void upd(int x, ll v) {
    while (x <= n) {
        t[x] += v;
        x += lowbit(x);
    }
}
ll sum(int x) {
    if (x <= 0) return 0;
    ll res = 0;
    while (x) {
        res += t[x];
        x -= lowbit(x);
    }
    return res;
}
ll query(int x) {
    return sum(x) - sum(x - 1);
}

int main() {

    // freopen("in.in", "r", stdin);
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
    }
    int res = n + 1;
    for (int i = 1, j = 1; i <= n; ++i) {
        if (++g[a[i] + 1] == 1) upd(a[i] + 1, 1);
        while (i - j + 1 > m) {
            if (!--g[a[j] + 1])
                upd(a[j] + 1, -1);
            ++j;
        }
        // printf("[%d, %d]", i, j);
        if (i - j + 1 != m) continue;
        int L = 0, R = n + 1;
        while (L < R) {
            int mid = (L + R) / 2;
            if (sum(mid + 1) != mid + 1) R = mid;
            else L = mid + 1;
        }
        // printf("(%d, %d:  %d)", j, i, L);
        res = min(res, L);
    }
    printf("%lld", res);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a,b,len;
typedef long long ll;
ll dp[75][1<<20],pk;
vector<long long> m,p={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};
int main()
{
    cin>>a>>b;
    len=b-a+1;
    for(ll i=a;i<=b;i++) m.push_back(i);
    pk=p.size();
    dp[0][0]=1;
    for(ll i=0;i<len;i++){
        ll nowb=0;
        for(ll j=0;j<pk;j++)
            if(m[i]%p[j]==0) nowb=nowb|(1<<j);//是哪一个质数的倍数
        for(ll j=0;j<(1<<pk);j++){
            if(i==0){
                if(nowb==j)
                dp[i][j]+=1;
            }
            else{
                dp[i][j]=dp[i-1][j];

                if((nowb&j)==nowb)
                    dp[i][j]+=dp[i-1][j-nowb];
            }
        }
    }
    long long res=0;
    for(ll i=0;i<(1<<pk);i++)
        res+=dp[len-1][i];
    cout<<res<<endl;
    system("pause");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
#define pow(n,m) powl(n,m)
#define sqrt(n) sqrtl(n)
const ll MAX = 5000000000000000000;
const ll MOD = 0;
void randinit(){srand((unsigned)time(NULL));}
int main(){
    ll N,M;
    cin >> N >> M;
    vector<tuple<ll,ll>> A(0);
    for(ll i = 0;i < M;i++){
        ll x,y;
        cin >> x >> y;
        if(N - 250000 <= y && y <= N + 250000){
            A.emplace_back(make_tuple(x,y));
        }
    }
    sort(A.begin(),A.end());
    vector<ll> DP(600000,0);
    DP[300000] = 1;
    for(ll i = 0;i < A.size();i++){
        vector<ll> B(0);
        while(true){
            ll y = get<1>(A[i]);
            B.emplace_back(y);
            if(i < A.size() - 1 && get<0>(A[i]) == get<0>(A[i + 1])){
                i++;
            }
            else{
                break;
            }
        }
        map<ll,ll> kari;
        for(ll j = 0;j < B.size();j++){
            kari[B[j] - N + 300000] = DP[B[j] - N + 300000];
            if(B[j] > 0){
                kari[B[j] - N + 300000 - 1] = DP[B[j] - N + 300000 - 1];
            }
            if(B[j] < 2 * N){
                kari[B[j] - N + 300000 + 1] = DP[B[j] - N + 300000 + 1];
            }
        }
        for(ll j = 0;j < B.size();j++){
            DP[B[j] - N + 300000] = 0;
        }
        for(ll j = 0;j < B.size();j++){
            if(B[j] > 0 && kari[B[j] - N + 300000 - 1]){
                DP[B[j] - N + 300000] = 1;
            }
            if(B[j] < 2 * N && kari[B[j] - N + 300000 + 1]){
                DP[B[j] - N + 300000] = 1;
            }
        }
    }
    ll ans = 0;
    for(ll i = 0;i < DP.size();i++) ans += DP[i];
    cout << ans << endl;
}


#include <bits/stdc++.h>
//#include <atcoder/all>
//#include "Z:\2_Src\31_Luzhiles_s.git\template\template.cpp"
using namespace std; //using namespace atcoder;
template<typename T>  using ve=vector<T>;
using ll=long long; using ld=long double; using str=string; using pint=pair<ll,ll>;
using vll=ve<ll>; using vd=ve<ld>; using vs=ve<str>; using vll2=ve<ve<ll>>;
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define b2e(v) v.begin(),v.end()
#define p2a(v, p) v[p.first][p.second]
#define rep(i,n)  for(ll i=0;i<(n);i++)
#define repi(i,n) for(ll i=(n-1);i>=0;i--)
#define repe(e,v) for(auto e:v)
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const int MOD=1000000007;
//const int MOD=998244353;

vll t1,k1;
ll calc(ll now, ll idx) {
    //1. 到着時刻を現在位置の時刻tiを使って動的に求める((ti%k==0? ti: ti+k-ti%k) + t)
    ll ans= now%k1[idx]? k1[idx]-now%k1[idx]:0;
    return ans + t1[idx];
}

#define TEMPT long long int
template< typename T = TEMPT >
struct Edge {
  int from, to;
  T cost;
  int idx;

  Edge() = default;

  Edge(int from, int to, T cost = 1, int idx = -1) : from(from), to(to), cost(cost), idx(idx) {}

  operator int() const { return to; }
};

template< typename T = TEMPT >
struct Graph {
  vector< vector< Edge< T > > > g;
  int es;

  Graph() = default;

  explicit Graph(int n) : g(n), es(0) {}

  size_t size() const {
    return g.size();
  }

  void add_directed_edge(int from, int to, T cost = 1) {
    g[from].emplace_back(from, to, cost, es++);
  }

  void add_edge(int from, int to, T cost = 1) {
    g[from].emplace_back(from, to, cost, es);
    g[to].emplace_back(to, from, cost, es++);
  }

  void read(int M, int padding = -1, bool weighted = false, bool directed = false) {
    for(int i = 0; i < M; i++) {
      int a, b;
      cin >> a >> b;
      a += padding;
      b += padding;
      T c = T(1);
      if(weighted) cin >> c;
      if(directed) add_directed_edge(a, b, c);
      else add_edge(a, b, c);
    }
  }
};

template< typename T = TEMPT >
using Edges = vector< Edge< T > >;
#undef TEMPT
#define TEMPT long long int
template< typename T = TEMPT >
struct ShortestPath {
  vector< T > dist;
  vector< int > from, id;
};

template< typename T = TEMPT >
ShortestPath< T > dijkstra(const Graph< T > &g, int s) {
  const auto INF = numeric_limits< T >::max();
  vector< T > dist(g.size(), INFL);
  vector< int > from(g.size(), -1), id(g.size(), -1);
  using Pi = pair< T, int >;
  priority_queue< Pi, vector< Pi >, greater<> > que;
  dist[s] = 0;
  que.emplace(dist[s], s);
  while(!que.empty()) {
    T cost;
    int idx;
    tie(cost, idx) = que.top();
    que.pop();
    if(dist[idx] < cost) continue;
    for(auto &e : g.g[idx]) {
      //auto next_cost = cost + e.cost;
      auto next_cost = cost + calc(cost, e.cost);
      if(dist[e.to] <= next_cost) continue;
      dist[e.to] = next_cost;
      from[e.to] = idx;
      id[e.to] = e.idx;
      que.emplace(dist[e.to], e.to);
    }
  }
  return {dist, from, id};
}
#undef TEMPT

int main() {

    ll nn; cin >> nn;
    ll mn; cin >> mn;
    ll x; cin >> x;
    ll y; cin >> y;
    x--; y--;

    ve<vll> vv1(mn,vll(4,0));
    rep(i,mn) rep(j,4) cin >> vv1[i][j];

    Graph<> g1(nn);
    rep(i, mn) {
        auto &v1=vv1[i];
        g1.add_edge(v1[0]-1, v1[1]-1, i);
        t1.push_back(v1[2]);
        k1.push_back(v1[3]);
    }

    auto p1=dijkstra(g1, x);

    // 3. 各町について、1からkまで + kからnまでの最短経路を求める
    ll ans=p1.dist[y];
    if(ans<INFL) {
        cout << ans << endl;
    } else {
        cout << -1 << endl;
    }
}

#include <bits/stdc++.h>

using namespace std;

int main(void) {
	long long N, M, Q;
	cin >> N >> M >> Q;
	vector<pair<long long, long long>> v;
	for(int i = 0; i < N; ++i) {
		long long W, V;
		cin >> W >> V;
		v.push_back({V, W});
	}
	sort(v.begin(), v.end(), greater<pair<long long, long long>>());
	vector<pair<long long, int>> x;
	for(int i = 0; i < M; ++i) {
		long long X;
		cin >> X;
		x.push_back({X, i + 1});
	}
	sort(x.begin(), x.end());
	for(int q = 0; q < Q; ++q) {
		long long L, R;
		cin >> L >> R;
		long long ans = 0;
		vector<bool> used(N, false);
		for(int i = 0; i < M; ++i) {
			if(L <= x[i].second && x[i].second <= R) continue;
			for(int j = 0; j < N; ++j) {
				if(!used[j] && v[j].second <= x[i].first) {
					ans += v[j].first;
					used[j] = true;
					break;
				}
			}
		}
		cout << ans << '\n';
	}
	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;

#define mp make_pair
#define fr first
#define sc second

int n;
ll v[400010];

int main(){
	scanf("%d",&n);
	for(int i=0;i<2*n;i++)scanf("%lld",&v[i]);

	ll ret=0;
	priority_queue<ll> que;
	for(int i=0;i<n;i++){
		que.push(v[i]);
		que.push(v[2*n-1-i]);
		ret+=que.top();
		que.pop();
	}
	cout<<ret<<endl;
}

#include <algorithm>
#include <any>
#include <atomic>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

#define int long long

#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define endl '\n'

#define si(v) ((int64_t)(v).size())
#define all(v) begin(v), end(v)
#define rep(i, n) for (ll (i) = 0; (i) < (n); ++(i))
#define rep2(i, n, m) for (ll (i) = n; (i) <= (m); ++(i))
#define rep3(i, n, m) for (ll (i) = n; (i) >= (m); --(i))
#define equal(a, b) (fabs((a) - (b)) < EPS)

#define INT(...) int __VA_ARGS__; IN(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__; IN(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__; IN(__VA_ARGS__)
#define STR(...) string __VA_ARGS__; IN(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__; IN(__VA_ARGS__)

using namespace std;

using ll   = long long;
using ld   = long double;
using vi   = vector<int>;
using vvi  = vector<vi>;
using pii  = pair<int,int>;
using vpi  = vector<pii>;
using vvpi = vector<vpi>;

void IN() {}
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>,greater<T>>;
template <class S, class T> inline bool chmax(S &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class S, class T> inline bool chmin(S &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template <class S, size_t N, class T> void Fill(S (&array)[N], const T &val) { fill((T*)array, (T*)(array + N), val); }
template <class S, class... T> void IN(S &a, T &... b) { cin >> a; IN(b...); }
template <class T> ostream &operator << (ostream &os, const vector<T> &v) {
  for (auto itr = begin(v); itr != end(v); ++itr) {
    if (itr == begin(v)) os << *itr;
    else os << " " << *itr;
  }
  return os;
}

constexpr ll MOD   = 1000000007;
/* constexpr ll MOD   = 998244353; */
constexpr ll MAX   = 500005;
constexpr ll INF   = 2147483647;
constexpr ll INFLL = 9223372036854775807;
constexpr ld EPS   = (1e-10);

signed main(void)
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed; cout.precision(20);

  INT(n, k);
  int ans = 0;

  auto f = [&](int x) {
    if (x <= 1 || x > 2*n) return 0LL;
    if (x <= n) return x-1;
    if (x == 2*n) return 1LL;

    int diff = abs(2 * n - x);

    if (diff % 2) return (diff + 1) / 2 * 2;
    else return (diff / 2) * 2 + 1;
  };

  for (int b = 0; b + k <= 2 * n; ++b) {
    int a = b + k;
    if (a < 2) continue;

    ans += f(a) * f(b);
  }

  cout << ans << endl;

  return (0);
}


/*
Author: QAQAutoMaton
Lang: C++
Code: C.cpp
Mail: lk@qaq-am.com
Blog: https://www.qaq-am.com/
*/
#include<bits/stdc++.h>
#define debug(qaq...) fprintf(stderr,qaq)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x) x.begin(),x.end()
#define x first
#define y second
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())
using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef complex<double> cp;
typedef pair<int,int> pii;
int inf;
const double eps=1e-8;
const double pi=acos(-1.0);
template<class T,class T2>int chkmin(T &a,T2 b){return a>b?a=b,1:0;}
template<class T,class T2>int chkmax(T &a,T2 b){return a<b?a=b,1:0;}
template<class T>T sqr(T a){return a*a;}
template<class T,class T2>T mmin(T a,T2 b){return a<b?a:b;}
template<class T,class T2>T mmax(T a,T2 b){return a>b?a:b;}
template<class T>T aabs(T a){return a<0?-a:a;}
template<class T>int dcmp(T a,T b){return a>b;}
template<int *a>int cmp_a(int x,int y){return a[x]<a[y];}
template<class T>bool sort2(T &a,T &b){return a>b?swap(a,b),1:0;}
#define min mmin
#define max mmax
#define abs aabs
struct __INIT__{
	__INIT__(){
		fill((unsigned char*)&inf,(unsigned char*)&inf+sizeof(inf),0x3f);
	}
}__INIT___;
namespace io {
	const int SIZE = (1 << 21) + 1;
	char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr;
	// getchar
	#define gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	// print the remaining part
	inline void flush () {
		fwrite (obuf, 1, oS - obuf, stdout);
		oS = obuf;
	}
	// putchar
	inline void putc (char x) {
		*oS ++ = x;
		if (oS == oT) flush ();
	}
	template<typename A>
	inline bool read (A &x) {
		for (f = 1, c = gc(); c < '0' || c > '9'; c = gc()) if (c == '-') f = -1;else if(c==EOF)return 0;
		for (x = 0; c <= '9' && c >= '0'; c = gc()) x = x * 10 + (c & 15); x *= f;
		return 1;
	}
	inline bool read (char &x) {
		while((x=gc())==' '||x=='\n' || x=='\r');
		return x!=EOF;
	}
	inline bool read(char *x){
		while((*x=gc())=='\n' || *x==' '||*x=='\r');
		if(*x==EOF)return 0;
		while(!(*x=='\n'||*x==' '||*x=='\r'||*x==EOF))*(++x)=gc();
		*x=0;
		return 1;
	}
	template<typename A,typename ...B>
	inline bool read(A &x,B &...y){
		return read(x)&&read(y...);
	}
	template<typename A>
	inline bool write (A x) {
		if (!x) putc ('0'); if (x < 0) putc ('-'), x = -x;
		while (x) qu[++ qr] = x % 10 + '0',  x /= 10;
		while (qr) putc (qu[qr --]);
		return 0;
	}
	inline bool write (char x) {
		putc(x);
		return 0;
	}
	inline bool write(const char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	inline bool write(char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	template<typename A,typename ...B>
	inline bool write(A x,B ...y){
		return write(x)||write(y...);
	}
	//no need to call flush at the end manually!
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
}
using io :: read;
using io :: putc;
using io :: write;
char a[400005];
const int c3[3][3]={{1,0,0},{1,1,0},{1,2,1}};
int C(int a,int b){
	if(!b)return 1;
	if(!a)return 0;
	return c3[a%3][b%3]*C(a/3,b/3)%3;
}
signed main(){
#ifdef QAQAutoMaton
	freopen("C.in","r",stdin);
	freopen("C.out","w",stdout);
#endif
	int n;
	read(n);
	read(a);
	int s=0;
	for(int i=0;i<n;++i){
		s+=C(n-1,i)*(a[i]=='B'?0:a[i]=='W'?1:2);
		s%=3;
	}
	if((n-1)&1)s=(3-s)%3;
	write("BWR"[s],'\n');
	return 0;
}

#include<bits/stdc++.h>
#define inf 1e18
#define endl "\n"
#define mp make_pair
#define pb push_back
#define loop(i,x,y) for(int i = x; i < y ; i++ )
#define all(x) (x).begin(),(x).end()
#define in(n)       int n; cin>>n;
#define inarr(arr,n) vector<int>arr(n); for(int i = 0; i < n ; i++){cin>>arr[i];}
#define maploop(x) for(auto itr = x.begin(); itr != x.end();itr++)
#define int long long
using namespace std;
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x<<" "; _print(x); cerr << endl;
#else
#define debug(x);
#endif

void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

const int N = 5;
const int mod = 3;
int fac[N];
int mul(int a, int b)
{
	return (a * b) % mod;
}
void pre()
{
	fac[0] = 1;
	loop(i, 1, N)
	{

		fac[i] = mul(fac[i - 1], i);
	}
}
int sub(int a, int b)
{
	int l = a - b;
	if (l < 0)
	{
		l += mod;
	}
	return l;
}
int pow(int a, int b)
{
	int z = 1;
	while (b  > 0 )
	{
		if (b % 2)
		{
			z = mul(a, z);
		}
		a = mul(a, a);
		b = b / 2;

	}
	return z;
}
int div(int a)
{
	int ans;
	return ans = pow(a, mod - 2);
}
int comb(int n, int k)
{
	if (n >= k)
	{
		return mul(fac[n], div(mul(fac[k], fac[n - k])));
	}
	else
		return 0;
}
int add(int a, int b)
{
	a += b;
	if (a > mod)
	{

		a -= mod;
	}
	return a;
}
int solve(int n, int k)
{
	int ans = 1;
	while (n > 0)
	{
		ans = ans * comb(n % 3, k % 3);
		n /= 3;
		k /= 3;
	}
	return ans;
}
void Main()
{

	in(n)
	string s;
	cin >> s;
	vector<int>arr(n);
	loop(i, 0, n)
	{
		if (s[i] == 'R')
			arr[i] = 0;
		else if (s[i] == 'B')
			arr[i] = 1;
		else
			arr[i] = 2;
	}
	//debug(arr)
	int l = n - 1;
	int ans = 0;
	loop(i, 0, n)
	{
		int l = mul(arr[i], solve((n - 1), i));
		l %= 3;
		ans = add(ans, l);
		debug(ans)
	}
	loop(i, 1, n)
	{
		if (ans % 2) ans += 3;
		ans /= 2;
	}
	if (l % 2)
	{
		debug(ans)
		// ans *= -1;

		// if (ans < 0)
		// {
		// 	ans += 3;
		// }

		if (ans == 2)
		{
			cout << "W" << endl;
		}
		else if (ans == 1)
			cout << "B" << endl;
		else
			cout << "R" << endl;
	}
	else
	{
		//ans %= 3;
		debug(ans)
		if (ans == 2)
		{
			cout << "W" << endl;
		}
		else if (ans == 1)
			cout << "B" << endl;
		else
			cout << "R" << endl;
	}

}

int32_t main()
{
	pre();
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//usaco("runround");
	int t = 1;
	//cin >> t;
	//t = 10000;
	for (int i = 1; i <= t; i++)
	{
		//cout << "Case #" << i << ": ";
		Main();
	}
}


#include <bits/stdc++.h>

using namespace std;

#define int ll
typedef long long ll;
typedef long double ld;

void print(vector<int> v) {
  cout << " ---> ";
  for (auto &x : v) {
    cout << x << " ";
  }
  cout << "\n";
}

int over = 0;

vector<int> get(vector<int> a) {
  vector<int> init = a;
  vector<int> sol;
  int n = (int) a.size(), cur = 0;

  while (1) {
    //cout << (int) sol.size() << " and " << cur << " | ";
    //print(a);
    while (1) {
      bool Something = 0;
      for (int i = 0; i + 1 < n; i++) {
        if (i % 2 == cur && a[i] > a[i + 1]) {
          sol.push_back(i);
          swap(a[i], a[i + 1]);
          cur ^= 1;
          Something = 1;
          break;
        }
      }
      if (!Something) break;
    }
    bool ok = 1;

    for (int i = 0; i < n; i++) {
      ok &= (a[i] == i + 1);
    }

    if (ok) break;

    bool Something = 0;
    for (int i = 0; i + 1 < n; i++) {
      if (a[i] > a[i + 1]) {
        if (i + 2 < n) {
          sol.push_back(i + 1);
          swap(a[i + 1], a[i + 2]);
          cur ^= 1;
          Something = 1;
          break;
        }
        if (i - 1 >= 0) {
          sol.push_back(i - 1);
          swap(a[i - 1], a[i]);
          cur ^= 1;
          Something = 1;
          break;
        }
      }
    }
    if (!Something) {
      cout << "bad\n";
      print(a);
    }
    assert(Something);

  }

  bool ok = 1;

  for (int i = 0; i < n; i++) {
    ok &= (a[i] == i + 1);
  }

///  over = max(over, (int) sol.size() - n * n);
  ok &= ((int) sol.size() <= n * n);

  if (!ok) {
    cout << "bad\n";
    cout << "init"; print(init);
    cout << "a"; print(a);
    cout << "sol"; print(sol);

    exit(0);
  }
  assert(ok);

  return sol;
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);

  /**
  for (int len = 1; len <= 10; len++) {
    over = 0;
    vector<int> v(len);
    iota(v.begin(), v.end(), 1);
    auto it = get(v);
    while (next_permutation(v.begin(), v.end())) {
      it = get(v);
    }

    cout << "\t\t\t\t done " << len << " and " << over << "\n";
  }
  return 0;
**/

  int tt;
  cin >> tt;
  while (tt--) {
      int n;
    cin >> n;
    vector<int> a(n);

    for (int i = 0; i < n; i++) cin >> a[i];
    auto it = get(a);
    cout << (int) it.size() << "\n";
    for (auto &val : it) cout << val + 1 << " ";
    cout << "\n";
  }
  return 0;
}

#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define rep(i, n) for(int i=0;i<n;i++)
#define all(i, v) for(auto& i : v)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

ll n;
ll solve(ll m){
    if(m >= n) m -= n;
    else m += n;
    return m;
}
int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll q;
    string s;
    cin >> n >> s >> q;
    bool maki = 0;
    ll t, a, b;

    rep(i, q){
        cin >> t >> a >> b;
        a--; b--;

        if(t == 1){
            if(maki) {
                a = solve(a);
                b = solve(b);
            }
            swap(s[a], s[b]);
        }else{
            maki ^= 1;
        }
    }
    if(maki){
        cout << s.substr(n, n);
        cout << s.substr(0, n) << endl;
    }else{
        cout << s << endl;
    }

    return 0;
}