// while (clock()<=69*CLOCKS_PER_SEC)
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define erase_duplicates(x) sort(all(x)); (x).resize(distance((x).begin(), unique(all(x))));

using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<
T,
null_type,
less<T>,
rb_tree_tag,
tree_order_statistics_node_update>;

//X.find_by_order(k); - zwraca iterator na k-ty element (numeracja od zerowego)
//X.order_of_key(k); - zwraca liczbę elementów ostro mniejszych niż k

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<" = "<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<" = "<<h<<", "; _dbg(sdbg+1, a...);
}

#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#define cerr if(0)cout
#endif

const int maxn = (1<<20)+7;
const int maxk = 20;
const int inf = (1e9)+7;
const LL LLinf = ((LL)1e18)+7LL;
const LD eps = 1e-9;
const LL mod = 1e9+7;

// ***************************** CODE ***************************** //

int tab[maxk][maxk];
int elo[maxk][maxk];
int maska[maxn];

LL dp[maxn][2];

int daj(bool f)
{
  for(int i = 0;i <= 6;i++)
    for(int j = 0;j <= 6;j++)
      elo[i][j] = 0;
  for(auto s : kraw)
    elo[s.se][s.fi] = 1;
  vector<VI> ziom = {{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}};
  int mask = 0;
  for(auto s : ziom)
    for(int i = 1;i <= 6;i++)
      for(int j = i + 1;j <= 6;j++)
        for(int k = j + 1;k <= 6;k++)
        {
          if(elo[i][s[0] + f * 3] and elo[j][s[1] + f * 3] and elo[k][s[2] + f * 3])
          {
            mask |= maska[(f ? 126 : 0) ^ ((1<<i) + (1<<j) + (1<<k))];
          }
      }

  // for(int i = 0;i < SZ(kraw);i++)
  //   for(int j = i + 1;j < SZ(kraw);j++)
  //     if(kraw[i].fi != kraw[j].fi and kraw[i].se != kraw[j].se)
  //       for(int k = j + 1;k < SZ(kraw);k++)
  //         if(kraw[i].fi != kraw[k].fi and kraw[j].fi != kraw[k].fi and kraw[i].se != kraw[k].se and kraw[j].se != kraw[k].se)
  //           mask |= maska[(f ? 126 : 0) ^ ((1<<kraw[i].se) + (1<<kraw[j].se) + (1<<kraw[k].se))];
  return mask;
}

LL pot(LL a, LL w)
{
  if(!w) return 1;
  LL b = pot(a, w / 2);
  b = b * b % mod;
  if(w & 1)
    b = b * a % mod;
  return b;
}

int main()
{
	_upgrade
  int n;
  cin>>n;
  for(int i = 1;i <= n;i++)
    for(int j = 1;j <= n;j++)
      cin>>tab[i][j];
  int xd = 0;
  for(int i = 1;i <= 6;i++)
    for(int j = i + 1;j <= 6;j++)
      for(int k = j + 1;k <= 6;k++)
        maska[(1<<i) ^ (1<<j) ^ (1<<k)] = (1<<xd++);
  for(int i = n + 1;i <= 6;i++)
    tab[i][i] = 100;
  VPII kraw;
  n = 6;
  for(int i = 1;i <= n;i++)
    for(int j = 1;j <= n;j++)
      kraw.pb({i, j});
  for(int k = 0;k < 2;k++)
    for(int i = 0;i < (1<<18);i++)
    {
      // dbg(i, k);
      LL p = 1LL;
      for(int j = 0;j < 18;j++)
        if((1<<j) & i)
        {
          p = p * tab[kraw[j + k * 18].fi][kraw[j + k * 18].se] % mod * pot(100, mod - 2) % mod;
          elo[kraw[j + k * 18].se][kraw[j + k * 18].fi] = 1;
        }
        else
        {
          p = p * (100 - tab[kraw[j + k * 18].fi][kraw[j + k * 18].se]) % mod * pot(100, mod - 2) % mod;
          elo[kraw[j + k * 18].se][kraw[j + k * 18].fi] = 0;
        }
      int cur = daj(k);
      dp[cur][k] += p;
      dp[cur][k] %= mod;
    }
  LL res = 1;
  for(int i = 0;i < 20;i++)
    for(int j = 0;j < (1<<20);j++)
      if((1<<i) & j)
      {
        dp[j][0] += dp[j ^ (1<<i)][0];
        dp[j][0] %= mod;
      }
  for(int i = 0;i < (1<<20);i++)
    res = (res - dp[i][0] * dp[((1<<20) - 1) ^ i][1]) % mod;
  res += mod;
  res %= mod;
  cout<<res;
	return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int a,m;
    cin>>a>>m;
    vector<int> cycle;
    cycle.push_back(a%m);
    if(a%m==0)
    {
        cout<<"Yes";
        return 0;
    }
    a+=(a%m);
    int idx=1;
    while(a%m!=cycle[0])
    {
        if(a%m==0)
        {
            cout<<"Yes";
            return 0;
        }
        cycle.push_back(a%m);
        a+=(a%m);
    }
    cout<<"No";
    return 0;
}


#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>

#define INF 0x3f3f3f3f
#define INF64 0x3f3f3f3f3f3f3f3f
#define LL long long
using namespace std;
const int maxInt = numeric_limits<int>::max();
const LL MOD = 1e9+7;

long long inv(long long x){

  long long y=M-2,res=1;

  for (; y; y>>=1,x=x*x%M) if (y&1) res=res*x%M;

  return res;

}

long long C(int n,int m){//求组合数
    long long ans = 1;
    for(long long i = 1; i <= m; i++){
        ans = (ans * (n-i+1) * inv(i)) % MOD;
    }
    return ans;
}

int n, m;
int main() {
  cin >> n ;
  LL ans = 1;
  LL removedInLastRound = 0;
  LL powerOf2 = 1;
  for (int i = 1; i <= 2 * n; i++) {
    powerOf2 = (powerOf2 * 2) % MOD;
    LL currentRound = powerOf2;
    LL removedInCurrentRound = 0;
    if (i > n) {
      removedInCurrentRound = 2*C(i - 1, n) % MOD;
      removedInCurrentRound = (removedInCurrentRound + removedInLastRound * 2) % MOD;
      //printf("remove: %d + %d\n", 2);
    }
    currentRound = (currentRound - removedInCurrentRound + MOD) % MOD;
    //printf("%d: %d - %d = %d\n", i, powerOf2, removedInCurrentRound, currentRound);
    ans = (ans + currentRound) % MOD;
    removedInLastRound = removedInCurrentRound;
  }
  cout << ans;
  return 0;
}


/*
 *
 *	author:	hadi_hosseini
 *
 */
#include <bits/stdc++.h>

using namespace std;

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

 //freopen("billboard.in" , "r" , stdin);
	//freopen("billboard.out" , "w" , stdout);

	int x1,y1,x2,y2;
	cin >> x1 >> y1 >> x2 >> y2;

	int x3,y3,x4,y4;
	cin >> x3 >> y3 >> x4 >> y4;

	int x5,y5,x6,y6;
	cin >> x5 >> y5 >> x6 >> y6;

	map <pair <int,int> , int> m;
	for(int i = x1 ; i < x2 ; i++){
		for(int j = y1 ; j < y2 ; j++){
			m[{i,j}] = 1;
		}
	}

	int xo1= max(x1,x3);
	int xo2 = min(x2,x4);
	int yo1 = max(y1 , y3);
	int yo2 = min(y2,y4);

	for(int i = xo1 ; i <= xo2 ; i++){
		for(int j = yo1; j <= yo2 ; j++){
			m[{i,j}] = 0;
		}
	}

	xo1= max(x1,x5);
	xo2 = min(x2,x6);
	yo1 = max(y1,y6);
	yo2 = min(y2,y6);

	for(int i = xo1 ; i <= xo2 ; i++){
		for(int j = yo1; j <= yo2 ; j++){
			m[{i,j}] = 0;
		}
	}

	int ans = 0;
	for(int i = x1 ; i < x2 ; i++){
		for(int j = y1 ; j < y2 ; j++){
			if(m[{i,j}]  == 1) ans++;
		}
	}

	if(ans > 0) cout << "YES\n";
	else cout << "NO\n";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{long long int i,j,y=0,x,found;
vector<long long int> a;
cin >> x;
  for(i=1; ;i++)
  {
     {x=x+i;
         {while(x/10!=0)
           a.push_back(x%10);
          }
            y++;
     }
   found=0;

      {
        for(j=0;j<a.size();j++)
        if(a[i]==8)
        {found=1;
        break;
        }

      }
  }

  if(found==1)
  cout << y;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <math.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <algorithm>
using namespace std;
int main(){
 int n;
 cin>>n;
 queue<pair<int,int> > Q;
 Q.push(make_pair(n,0));
 int minops=n*100;
 int cn,cop,tmpnum,fig;
 pair<int,int> p;
 while(!Q.empty()) {
   p=Q.front();
   Q.pop();
   cn=p.first;
   cop=p.second;
   if(cn==0) {
    if(cop<minops) {
      minops=cop;
    }
   } else  if(cn<10 && cop+1<minops) {
      minops=cop+1;
   } else if(cn>9) {
      tmpnum=cn;
      while(tmpnum>9) {
        fig=tmpnum%10;
        tmpnum/=10;
        if(fig>0) Q.push(make_pair(cn-fig,cop+1));
      }
      if(tmpnum>0) Q.push(make_pair(cn-tmpnum,cop+1));
   }

 }
 cout<<minops<<endl;
 return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define dforr(i, a, b) for(int i = (int)(b-1); i >= (a); i--)
#define dforn(i, n) dforr(i, 0, n)
#define db(v) cerr << #v << " = " << v << endl
#define pb push_back
#define sz(x) ((int)x.size())
#define ff first
#define ss second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
const int MAXN = 1000100;
const ll INF = (ll)1e18+5;

int criba[MAXN];
vector<int> P;
void BuildS(){
    for(int p = 2; p*p < MAXN; p++)if(!criba[p])
        for(int i = p*p;  i < MAXN; i+=p)criba[i] = p;
    forr(i, 2, MAXN)if(!criba[i]) P.pb(i);
}

bool OFlow(ll a, ll b){
    ll res = a*b, nb = res/a;
    return b != nb;
}

ll ans;
vector<int> E;
void tryme(){
    ll act = 1;
    dforn(i, sz(E)){
        int p = P[i];
        forn(j, E[i]-1){
            if(OFlow(act, p))return;
            act *= p;
        }
    }
//    printf("%lld es un candidato\n", act);
    ans = min(ans, act);
}

void solve(int n, int lim){
    if(n == 1){ tryme(); return; }
    forr(d, 2, min(lim+1, n+1))if(n%d == 0){
        E.pb(d); solve(n/d, d); E.pop_back();
    }
}

int n;
int main(){
//	freopen("input.txt", "r", stdin);
	BuildS();
//	forn(i, 30)printf("%d ", P[i]); puts("");
	while(scanf("%d", &n) >= 1){
        ans = INF; solve(n, 61);
        printf("%lld\n", ans);
	}
	return 0;
}


#include <cstdio>
#include <deque>
#include <vector>

using namespace std;

int main() {
    int n, c;
    scanf("%d %d", &n, &c);
    vector<int> scores(n);
    vector<int> times(n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &scores[i]);
    }
    for (int i = 0; i < n; i++) {
        scanf("%d", &times[i]);
    }
    int lscore = 0, rscore = 0;
    int ltime = 0, rtime = 0;
    int li = 0, ri = n - 1;
    while (li < n || ri) {
        if (li < n && ltime + times[li] < rtime + times[ri]) {
            ltime += times[li];
            lscore += max(scores[li] - ltime * c, 0);
            li++;
        } else if (ri >= 0) {
            rtime += times[ri];
            rscore += max(scores[ri] - rtime * c, 0);
            ri--;
        }
    }
    printf("%s\n", lscore == rscore ? "Tie" : lscore > rscore ? "Limak" : "Radewoosh");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define cn continue
#define rt return
int main(){
    ll l=0,r=0;
    ll n,c;
    cin>>n>>c;
    ll p[n+5],t[n+5];
    for(int i=1;i<=n;i++){
        cin>>p[i];
    }
    for(int i=1;i<=n;i++){
        cin>>t[i];
    }
    for(int i=1;i<=n;i++){
        l+=(p[i]-(c*t[i]));
    }
    for(int i=n;i>=1;i++){
        r+=(p[i]-(c*t[i]));
    }
    cout<<l<<r;
}


///Author Legolas_Killer
#include <bits/stdc++.h>

using namespace std;

int main(){
    int mn,mx,aa=0,bb=0;
	vector <char> v;
	int long long i,y=0,a,b,c;
    cin>>a>>b>>c;
	for(i=0;;i++){
    	if(a==0 && b==0 && c==0){
    		break;
    	}
    	if(a>0){
    		v.push_back('a');
    	a--;
		}
    	if(b>0){
    		v.push_back('b');
    	b--;
		}
    	if(c>0){
    		v.push_back('a');
    		v.push_back('b');
		c--;
		}
    }
    mn=v.size();
    for(i=0;i<v.size();i++){
    	if(v[i]=='a'){
    		aa++;
    	}
    	if(v[i]=='b'){
    		bb++;
    	}
    }

    mx=max(aa,bb)-min(aa,bb);
    if(mx>=1){
    	mn+=1;
    }
	cout<<mn-mx;

	return 0;
}


#include<bits/stdc++.h>
#define MOD 1000000007
#define ll long long
#define ld long double
#define MAXN 100005
const ld PI =  3.141592653589793238L;
using namespace std;
//<>

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

    vector<string>v;
    for(int i=1;i<=9;++i) v.push_back(to_string(i*11));

	for(int i=4;i<=14;i+=2){
		int n=v.size();
		char x='9'; if(i==14) x='5';
		for(int j=0;j<n;++j) for(char k='1';k<=x;++k) v.push_back(k+v[j]+k);
	}

    vector<ll>v2;
	for(string s: v) v2.push_back(stoll(s));
	sort(v2.begin(),v2.end());

    ll K,P;
    cin >> K >> P;

    ll ans=0;
    for(int n=0;n<K;++n) ans+=v2[n],ans%=P;

    cout << ans;

	return 0;
}


// Author: πα

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

int main()
{
    long k, p;
    cin >> k;
    if(k < 10)
        return cout << k, 0;
    k--;
    for(p = 1; k >= 9*p; p *= 10)
        k -= 9*p;
    int m = log(p) + 1e-8;
    p += k/m, k %= m;
    cout << to_string(p)[k];
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define fr(i,a,n) for(ll i=a;i<n;i++)
#define YES cout<<"YES"<<endl
#define all(v) v.begin(),v.end()
#define NO cout<<"NO"<<endl
#define pb(x) emplace_back(x)
#define fastio std::ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define vi vector<ll>
#define mi map<ll,ll>
#define pi pair<ll,ll>
#define what(x) cout<<#x<<" is "<<x<<endl;
#define xx first
#define yy second ;

using namespace std;

int main()
{

    fastio;

        ll n;
        cin>>n;
        //if(n%2==0){  cout<<n/2<<endl; return 0; }
        bool ok=true;
        ll a=n,cnt=1e14,ans=0;
        for(ll i=2;i*i<=n;i++)
        {
            if(n%i==0){ a=i;ok=false;   }
            else continue;
            ll temp=n;
            while(temp>1)if(temp%a==1)break;else temp/=a;
            //what(temp);
            cnt=min(cnt,a);
            if(temp!=1){  ans++; }
            break;
        }

        if(ok)cout<<n<<endl;
        else if(ans!=0)cout<<1<<endl;
        else cout<<cnt<<endl;

}


#include <cstdio>
int main(){
    int x, y, z, x1, y1, z1, a[6];
    scanf("%d%d%d%d%d%d", &x, &y, &z, &x1, &y1, &z1);
    for(int i = 0; i < 6; i ++)
        scanf("%d", a + i);
    int ans = 0;
    if(z > z1) ans += a[3];
    else if(z < 0) ans += a[2];

    if(x > x1) ans += a[5];
    else if(x < 0) ans += a[4];

    if(y > y1) ans += a[1];
    else if(y < 0) ans += a[0];
    printf("%d\n",ans);
    return true;
}

/*esennpcoaajahctmfkcojqejnpppdijignnaahgmhpmormgcob*/


#include <cstdio>
int main(){
    int x, y, z, x1, y1, z1, a[10];
    scanf("%d%d%d%d%d%d", &x, &y, &z, &x1, &y1, &z1);

    for(int i = 0; i < 6; i ++)
        scanf("%d", a + i);
    int ans = 0;

    if(z > z1) ans += a[3];
    else if(z < 0) ans += a[2];

    if(x > x1) ans += a[5];
    else if(x < 0) ans += a[4];

    if(y > y1) ans += a[1];
    else if(y < 0) ans += a[0];

    printf("%d\n",ans);

    return true;
}

/*oqmkfncqtspkiasfcgldioikebkqitrdijnncijosfegfcetjp*/


#include<iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<ctime>
#include<map>

using namespace std;

int const M=1e9+7;
long long n;
vector<vector<int>> m, st;

vector<vector<int>> pr(vector<vector<int>> a, vector<vector<int>> b)
{
    vector<vector<int>> r;
    r.resize(2);
    r[0].resize(2);
    r[1].resize(2);
    for(int i=0;i<2;++i)
    {
        for(int j=0;j<2;++j)
        {
            for(int k=0;k<2;++k)
            {
                r[i][j] = (r[i][j] + a[i][k]*1LL*b[k][j]%M)%M;
            }
        }
    }
    return r;
}

vector<vector<int>> pow(int d)
{
    if(d==0)
    {
        vector<vector<int>> r;
        r.resize(2);
        r[0].resize(2);
        r[1].resize(2);
        r[0][0]=1;
        r[1][1]=1;
        return r;
    }
    if(d&1)
    {
        return pr(m,pow(d-1));
    }
    else
    {
        vector<vector<int>> r = pow(d/2);
        return pr(r,r);
    }
}

int main()
{
    cin>>n;
    st.resize(2);
    st[0].resize(2);
    st[1].resize(2);
    m.resize(2);
    m[0].resize(2);
    m[1].resize(2);
    st[0][0]=st[1][1]=1;
    st[0][1]=0;
    st[1][0]=3;
    m[0][0]=m[1][1]=3;
    m[0][1]=m[1][0]=1;
    vector<vector<int>> mn = pow(n);
    vector<vector<int>> res = pr(st,mn);
    cout<<res[0][0];
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
const int N=5005;
const int mod=1e9+7;
using namespace std;
#define DEBUG(...) {printf("[DEBUG] ");W(__VA_ARGS__);}
template<typename T>
ostream& operator+(ostream& out, const vector<T> &vec){
    for(const auto &x : vec){
        out<<x<<" ";
    }
    out<<"\n";
    return out;
}
template<typename T>
ostream& operator*(ostream& out, const vector<T> &vec){
    for(const auto &x : vec){
        out+x;
    }
    return out;
}
template<typename T>
istream& operator>>(istream& in, vector<T> &vec){
    for(auto &x : vec){
        in>>x;
    }
    return in;
}

void solve(){
    string s;
    cin>>s;
    int i=0;

    for(i=0;s[i]!='e';i++){
    }
    int pow=stoi(s.substr(i+1,s.length()));
    string ans;
    int flag=false;
    for(i=0;s[i]!='e';i++){
        if(s[i]=='.'){
            flag=true;
            continue;
        }
        if(!flag){
            ans+=s[i];
        }
        else{
            if(pow==0){
                ans+='.';
            }
            ans+=s[i];
            pow--;

        }
    }
    while(pow>0){
        ans+='0';
    }
    cout<<ans<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)solve();
}


//
//░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
//░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░
//░░░░░░░░▄▀░░░░░░░░░░░░▄░░░░░░░▀▄░░░░░░░
//░░░░░░░░█░░▄░░░░▄░░░░░░░░░░░░░░█░░░░░░░
//░░░░░░░░█░░░░░░░░░░░░▄█▄▄░░▄░░░█░▄▄▄░░░
//░▄▄▄▄▄░░█░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██░░
//░██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██░░
//░░▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██░
//░░░░▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██░
//░░░░░░░▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██░
//░░░░░░░▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀░░
//░░░░░░█▀▀█████████▀▀▀▀████████████▀░░░░
//░░░░░░████▀░░███▀░░░░░░▀███░░▀██▀░░░░░░
//░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <time.h>
using namespace std;
//───────────────██
//─────────────░██▓█
//────────────▓██▓▓█░
//───────────██▒─▒▓▓▓
//──────────█▓▒▒░─▒▓█
//────────░██▓▒▒▓▒░▒▓█
//───────▒█▒──▒▓▓▓▓▒▓█░
//──────▓█▓▒──▒▒░░▒▓▓██
//─────██▓▓▓▓▓█▒───▓▓▓█░
//────██▒▓▓█▒───▒███──▓█
//──░████▓░█▒▒█───▓█──▓█░
//─▒██▓░─▓▓▒▒▓█▒───▓──░██
//▓█▓▓▒░▒▓█▓▓██▓██▓███▒▒█▒
//█▓▓▓▓███████▓███████▓▒▒█
//▓██▓███▓░░░░░▓░▓█▒██████▒
//▒▒▓▓▒▒░▒▓░░░░░░░░░▒▒▒▓███
//▓█▓░░░░─▓▓██▒▓▒▒░░░░░░░▒█▓
//▒▒▓▒░░░─▓████▒░▒▒▒▒▒░▒░░░██
//▒▒▓██▓▓▒░─░───░▓▓▓░▓███▒▒▓█
//▓░░▒▒▒─░──────▒▓░▓▒─███▒─▒█▒
//█▒────────░▒░──░▓─░───░░▒▓█▒
//███░───────█───▒──░▒──░▒▒██▒
//─▒███░─────████████░───░▒▓█▓─────────░▓█
//────▒█░──────────────────▒██─────░▓███▒
//█▒────█▒──────────────░▒▓▓█───▓███▒
//▓██─────░░─────────░░▓████████▒
//████▒─────░▒░░░─────███████░
//▓▓████─────────░▓██████▓▓█▓
//█▓▓───────░▓████▓██▓▓▒▒▒▓█░
//▓░───░▒█████▒─────▓█▓▓▒▓▓▓█▒
//─░█████▒───────────▒▓▓▓▒▒▓██▒
//──█░────────────────█▓▓▓▒▒▓▓█░
//▓░──────────────────█▓▓▓█▒▓▓██
//───────────────────▒█████▓▓▓▓█▒
//──────────────────░──░██▓▓▓▓██▓
//─────────────────▒▒░────▒█▓▓▓█░
//───────────────────────────────
//████────█─█─█───█─█───██─██
//█──██───█████───█─█────███
//████─────███────███─────█
//█──██───█████─────█────███
//████────█─█─█───███───██─██

#define vc   vector
#define sz(v)  (int)(v.size())
#define pb(a)  push_back(a)
#define each(it,s)  for(auto it = s.begin(); it != s.end(); it++)
#define rep(i, b, n)  for(int i = (b); i < (n); i++)
#define all(v)  v.begin(), v.end()
#define FI  first
#define SE  second
#define rr(i,j,n,m) for(int i=0;i<n;i++) for(int j=0;j<m;j++)
#define NO  cout << "NO"
#define YES cout << "YES"
#define ex(n) return n;
typedef long long int lli;
typedef long long ll;
typedef double db;
//_____________________________________________▄▄████████▄
//___________________________________________▄█▓▓▓█▓▓▓▓▓▓██▄
//___________________________________________█▓▓▓▓▓██▓▓▓▓▓▓▓█▄
//________________________________▄█████▄_█▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓█
//________________▄▄██████████▓▓▓▓▓▓▓██▓▓▓▓▓▓▓█▓▓▓▓▓▓▓██
//_____________▄█▓▓▓▓▓▓▓▓▓▓█▓██▓▓▓▓▓▓▓█▓▓▓▓▓█▓▓▓▓▓▓▓█▓█
//__________▄█▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓█▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓█▓▓█
//________▄█▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓██▓▓█
//_______█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓███▓▓▓▓█
//______█▓▓▓▓▓▓▓▓▓▓▓▓███▀▀▀▀██▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓█▓▓▓▓█__▄█████
//_____█▓▓▓▓▓▓▓▓▓▓█▀▀___________▀█▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓█▓▓▓███▓▓▓▓▓
//____█▓▓▓▓▓▓▓▓▓█▀_______________▓▓█▓▓▓▓███████▓███▓▓▓▓▓▓▓░░░▓▓
//____█▓▓▓▓▓▓▓▓█_____________▓▓▓░░░█▓██░░░░░░░███▓▓▓▓▓▓░░░░░░▓▓
//_____█▓▓▓▓▓▓█____________▓▓░░░░░░██░░░░░░░░░░░░███▓░░░░░░░░░▓
//__█▌_█▓▓▓▓▓█___________▓░░░░░░░░░░░░░░░░░░░░░░░░▓░░░░░░░▓░░▓
//_█▓█_█▓▓▓▓█__________▓▄▄░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓░░░▓
//█▓▓▓██▓▓▓█_________▓█░░▐░░░░░░░░░▄█████▄░░░░░░░░░░░░░▓░░░░▓
//█▓▓▓▓▓▓▓█________▀▄█░░░▐░░░░░░▄█▀░░░░░░▀█░░░░░░░░░░░▓░░░░▓▓
//_██▓▓▓██________▀▀▄▌░░░▐░░░░░░█░░░░░░░░░░█░░░░░░░░░▓░░░░░▓▓
//___▀▀▀▀__________▀▄█░░░░▐░░░░░█░░░░░░░░░░░▐▌░░░░░░░▓░░░░░▓▓▓
//__________________▓░░▓▓▓▓░░░░░░█░░░░░░░░░░░░▐▄▄▄▅░░░░░░░░░▓██
//_________________▓░░▀░░░░░░░░░░▀░░░░░░░░░░░░▐▀▄▄▅░░░░░░░░▓▓▓▓
//__________________▓░░░░░░░░░░░░░░░░░░░░░░░░░░▀▄▄░░░░░░░░█▓▓▓▓
//___________________▓░░░░░▓▓▓░░░░░░░░░░░░░░░░░░░░░███████▓▓▓▓▓▓
//____________________▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░██▓▓▓▓▓▓▓▓▓▓▓▓
//_______________________▓▓▓▓▓░░░░░░░░░░░░░░░░░░█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//_______________________▓▓▓▓▓░░░░░░░░░░░░░░░░░█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//_______________________▓▓▓▓▓░░░░░░░░░░░░░░░░░█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//_______________________▓▒▒▓░░░░░░░░░░░░░░░░░░░█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
//_____________________▓▓▒▓░░░░░░░░░░░░░░░░░░░████████▓▓▓▓▓▓▓▓▓▓
//______________________▓▓▓▓▓░░░░░░░░░░░░░░███▓▓▓▓█▓▓▓██▓▓▓▓██▓▓
//_____________________________▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓█▓▓█▓▓▓▓█▓██
//___________________________________________█▓▓▓▓▓▓▓▓▓▓▓███▓▓▓▓█▓▓▓
//__________________________________________█▓▓▓▓▓▓▓▓████▓▓▓▓▓▓█▓▓▓▓
//_________________________________________█▓▓▓▓▓▓▓▓▓▓█▓▓██████▓▓▓▓▓
//_________________________________________█▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓
//__________________________________________█▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓███████
//___________________________________________█▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓█
//____________________________________________█▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓█
//__________________________________________███████████▓▓▓▓▓▓▓▓█
//_________________________________________█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
//________________________________________█▓▓▓▓▓██▓▓▓▓▓▓▓▓██
//_________________________________________█▓▓▓▓▓▓█▀▀▀▀▀▀▀
//___________________________________________██▓▓▓▓███▄▄
//______________________________________________▀▀▀

int main()
{
    int n,fl1=1,fl2=1,fl3=1,fl4=1,fd1=1,fd2=1,fd3=1,fd4=1,fe1=1,fe2=1,fe3=1,fe4=1,ff1=1,ff2=1,ff3=1,ff4=1;
    cin>>n;
    char c1[10][10],c2[10][10],c3[10][10],c4[10][10],b,d1[10][10],d2[10][10],d3[10][10],d4[10][10],e1[10][10],e2[10][10],e3[10][10],e4[10][10],f1[10][10],f2[10][10],f3[10][10],f4[10][10];
    rep(i,0,n)
    {
        rep(i,0,n)
        {
            cin >> c1[i][j];
            c2[j][n-1-i]=c1[i][j];
            c3[n-1-i][n-1-j]=c1[i][j];
            c4[n-1-j][i]=c1[i][j];
        }
    }
    rr(i,j,n,n)
        {
            d1[i][n-1-j]=c1[i][j];
            d2[i][n-1-j]=c2[i][j];
            d3[i][n-1-j]=c3[i][j];
            d4[i][n-1-j]=c4[i][j];
            e1[n-1-i][j]=c1[i][j];
            e2[n-1-i][j]=c2[i][j];
            e3[n-1-i][j]=c3[i][j];
            e4[n-1-i][j]=c4[i][j];
            f1[n-1-i][n-1-j]=c1[i][j];
            f2[n-1-i][n-1-j]=c2[i][j];
            f3[n-1-i][n-1-j]=c3[i][j];
            f4[n-1-i][n-1-j]=c4[i][j];
        }
    rep(i,0,n)
    {
        rep(j,0,n)
        {
            cin >> b;
            if(b!=c1[i][j])
                fl1=0;
            if(b!=c2[i][j])
                fl2=0;
            if(b!=c3[i][j])
                fl3=0;
            if(b!=c4[i][j])
                fl4=0;
            if(b!=d1[i][j])
                fd1=0;
            if(b!=d2[i][j])
                fd2=0;
            if(b!=d3[i][j])
                fd3=0;
            if(b!=d4[i][j])
                fd4=0;
            if(b!=e1[i][j])
                fe1=0;
            if(b!=e2[i][j])
                fe2=0;
            if(b!=e3[i][j])
                fe3=0;
            if(b!=e4[i][j])
                fe4=0;
            if(b!=f1[i][j])
                ff1=0;
            if(b!=f2[i][j])
                ff2=0;
            if(b!=f3[i][j])
                ff3=0;
            if(b!=f4[i][j])
                ff4=0;
        }
    }
    if(fl1 || fl2 || fl3 || fl4 || fd1 || fd2 || fd3 || fd4 || fe1 || fe2 || fe3 || fe4 || ff1 || ff2 || ff3 || ff4)
        YES;
    else
        NO;
}


#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>

using namespace std;

const int p=1000000007;

int fac[40000],inv[40000];
int b[40000],f[50][40000],g[50][40000],h[40000];
int i,j,k,n,s,t;
long long m;

inline int power(int x,int y)
{
	int s=1;
	for (int i=30;i>=0;i--)
	{
		s=1LL*s*s%p;
		if ((1<<i)&y)
			s=1LL*s*x%p;
	}
	return s;
}

inline void preC()
{
	fac[0]=1;
	for (i=1;i<=n;i++)
		fac[i]=1LL*i*fac[i-1]%p;
	inv[n]=power(fac[n],p-2);
	for (i=n-1;i>=0;i--)
		inv[i]=1LL*(i+1)*inv[i+1]%p;
	return;
}

inline int C(int x,int y)
{
	return 1LL*fac[x]*inv[y]%p*inv[x-y]%p;
}

const int q=33333;
const long double pi=acos(-1);

struct complex
{
	long double r,i;

	inline complex operator + (const complex t) const
	{
		return (complex) {r+t.r,i+t.i};
	}

	inline complex operator - (const complex t) const
	{
		return (complex) {r-t.r,i-t.i};
	}

	inline complex operator * (const complex t) const
	{
		return (complex) {r*t.r-i*t.i,r*t.i+i*t.r};
	}
};

complex W[80000][2],X[80000],Y[80000],Z[80000];
int R[80000],x[80000],y[80000],z[80000];
int x0[80000],x1[80000],y0[80000],y1[80000],z0[80000],z1[80000],z2[80000];
int w;

inline void preFFT()
{
	for (w=1;w<=n;w=w<<1);
	w=w<<1;
	for (int i=0;i<w;i++)
	{
		W[i][0]=(complex) {cos(2*pi*i/w),sin(2*pi*i/w)};
		W[i][1]=(complex) {cos(2*pi*i/w),-sin(2*pi*i/w)};
	}
	for (int i=0;i<w;i++)
		for (int j=i,k=1;k<w;j=j>>1,k=k<<1)
			R[i]=(R[i]<<1)|(j&1);
	return;
}

inline void FFT(complex *T,int t)
{
	for (int i=0;i<w;i++)
		if (i<R[i])
			swap(T[i],T[R[i]]);
	complex x,y;
	for (int i=1;i<w;i=i<<1)
		for (int j=0;j<w;j=j+(i<<1))
			for (int k=0;k<i;k++)
				x=T[j+k],y=W[w/(i<<1)*k][t]*T[i+j+k],T[j+k]=x+y,T[i+j+k]=x-y;
	if (t)
		for (int i=0;i<w;i++)
			T[i].r=T[i].r/w;
	return;
}

inline void turncomplex(complex *X,int *x)
{
	for (int i=0;i<w;i++)
		X[i].r=x[i],X[i].i=0;
	return;
}

inline void turnnum(int *x,complex *X)
{
	for (int i=0;i<w;i++)
		x[i]=(x[i]+((long long) (X[i].r+0.5))%p)%p;
	return;
}

inline void mainFFT(int *x,int *y,int *z)
{
	turncomplex(X,x);
	turncomplex(Y,y);
	FFT(X,0);FFT(Y,0);
	for (int i=0;i<w;i++)
		Z[i]=X[i]*Y[i];
	FFT(Z,1);
	turnnum(z,Z);
	return;
}

inline void solve(int m)
{
	if (b[m])
		return;
	t++,b[m]=t;
	for (int i=0;i<=n;i++)
		g[b[m]][i]=power(h[m],i);
	if (m==1)
	{
		for (int i=1;i<=n;i++)
			f[b[m]][i]=1;
		return;
	}
	int t1=m/2,t2=m-m/2;
	solve(t1),solve(t2);
	memset(x,0,sizeof(x));
	for (int i=0;i<=n;i++)
		x[i]=1LL*f[b[t1]][i]*g[b[t2]][i]%p*inv[i]%p;
	memset(x0,0,sizeof(x0));
	for (int i=0;i<=n;i++)
		x0[i]=x[i]%q;
	memset(x1,0,sizeof(x1));
	for (int i=0;i<=n;i++)
		x1[i]=x[i]/q;
	memset(y,0,sizeof(y));
	for (int i=0;i<=n;i++)
		y[i]=1LL*f[b[t2]][i]*inv[i]%p;
	memset(y0,0,sizeof(y0));
	for (int i=0;i<=n;i++)
		y0[i]=y[i]%q;
	memset(y1,0,sizeof(y1));
	for (int i=0;i<=n;i++)
		y1[i]=y[i]/q;
	memset(z0,0,sizeof(z0));
	mainFFT(x0,y0,z0);
	memset(z1,0,sizeof(z1));
	mainFFT(x1,y0,z1);
	mainFFT(x0,y1,z1);
	memset(z2,0,sizeof(z2));
	mainFFT(x1,y1,z2);
	memset(z,0,sizeof(z));
	for (int i=0;i<=n;i++)
		z[i]=(1LL*q*q*z2[i]+1LL*q*z1[i]+z0[i])%p;
	for (int i=0;i<=n;i++)
		f[b[m]][i]=1LL*z[i]*fac[i]%p;
	return;
}

int main()
{
	scanf("%I64d%d",&m,&n);
	if (m>n)
		return printf("0"),0;
	preC();
	preFFT();
	h[0]=1;
	for (i=1;i<=n;i++)
		h[i]=(h[i-1]+h[i-1])%p;
	solve(m);
	for (i=m;i<=n;i++)
		s=(s+1LL*f[b[m]][i]*C(n,i))%p;
	printf("%d",s);
	return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define  mp make_pair
#define pp pop_back
#define pf push_front
#define fi first
#define se second
#define maxn 100005
#define mod 1000000007
typedef long long ll;
using namespace std;
#define pi pair<ll,ll >
#define debug_iv_ac ios::sync_with_stdio(false);cin.tie(NULL);

struct node{
    ll i,w,s;
    node(){}

    node(ll _i,ll _s){
        s = _s,i = _i;
    }

    bool operator < (node X)const{
        if(s!=X.s) return s < X.s;
        //if(pos!=X.pos) return X.pos<pos;
        return i < X.i;
    }
};

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

    x = x % p;  // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

ll add(ll a, ll b)
{
    a%=mod;b%=mod;
    return (a+b)%mod;
}

ll sub(ll a,ll b)
{
    a%=mod;b%=mod;
    return (a-b+mod)%mod;
}

ll prod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
const int MAXN = (1<<9);
int x1[maxn];
int y2[maxn];
int main()
{
	debug_iv_ac
	int n;
	cin>>n;
	int miny,minx,maxx,maxy;
	for(int i=1;i<=4*n+1;i++)
	{
	    int x,y;
	    cin>>x>>y;
	    x1[i] = x,y2[i] = y;
	    miny = min(miny,y);
	    maxy = max(maxy,y);
	    minx = min(minx,x);
	    maxx = max(maxx,x);
	}
	for(int i=minx;i<=maxx;i++)
	{
	    for(int j=miny;j<=maxy;j++)
	    {
	        for(int l=1;l<=50;l++)
	        {
	            int cnt = 0;
	            int x = 0,y = 0;
    	        for(int k=1;k<=4*n+1;k++)
    	        {
    	            if(x1[k]==i||x1[k]==i+l-1)
    	            {
    	                if(y2[k]<j||y2[k]>j+l-1)
    	                {
    	                    cnt++,x = x1[k],y = y2[k];
    	                }
    	            }
    	            else if(y2[k]==j||y2[k]==j+l-1)
    	            {
    	                if(x1[k]<i||x1[k]>i+l-1)
    	                {
    	                    cnt++,x = x1[k],y = y2[k];
    	                }
    	            }
    	            else cnt++,x = x1[k],y = y2[k];
    	        }
    	        if(cnt==1)
    	        {
    	            cout<<x<<" "<<y;return 0;
    	        }
	        }
	    }
	}
	return 0;
}


//https://codeforces.com/contest/7/problem/A
#include<bits/stdc++.h>

int a[8][8],ans=20;
std::string g;
int main(){
    for(int i = 0; i < 8; ++i){
        std::cin >> g;
        for(int j = 0; j < 8; ++j)a[i][j] = g[j]=='B';
    }
    for(int row = 0; row < (1 << 8); ++row){
        for(int col = 0; col < (1 << 8); ++col){
            int on = 0;
            for(int i = 0; i < 8; ++i)
                for(int j = 0; j < 8; ++j)
                    if(!((row>>i)&1) && !((col>>j)&1))on+=a[i][j];
            if(on == 0)ans = std::min(ans,__builtin_popcount(row)+__builtin_popcount(col));
        }
    }
    return std::cout << ans,0;
}


#include<cstdio>
#include<cstring>
#include<stack>
using namespace std;

int rever[10]={8,-1,-1,3,6,9,4,7,0,5};

int main()
{
	char in[15]={};
	scanf("%s",in);
	int p=strlen(in);
	int t=p/2;
	if(p%2==1)
	{
		p=p/2;
		if(rever[in[p]-'0']==-1)
		{
			printf("No");
			return 0;
		}
		while(in[p]!='\0')
		{
			in[p]=in[p+1];
			p++;
		}
	}
	stack<int>num;
	for(int r=0;r<t;r++)
	{
		if(rever[in[r]-'0']!=-1)
		{
			num.push(rever[in[r]-'0']);
		}
		else
		{
			printf("No");
			return 0;
		}
	}
	while(in[t]!='\0')
	{
		if(in[t]-'0'!=num.top())
		{
			printf("No");
			return 0;
		}
		num.pop();
		t++;
	}
	printf("Yes");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio();
   ios::sync_with_stdio(0);
	cin.tie(0);  cout.tie();
	map <int,vector<string> > m;
	m[1].push_back("1rd,0c");m[1].push_back("2rd,0c");m[1].push_back("3rd,1cr");m[1].push_back("0r,1cr");m[1].push_back("0r,2cr");
	m[1].push_back("1rd,1cr");m[1].push_back("1rd,2cr");m[1].push_back("2rd,1cr");m[1].push_back("2rd,2cr");

	m[2].push_back("0r,1cr");m[2].push_back("0r,1cl");m[2].push_back("1rd,0c");m[2].push_back("2rd,0c");m[2].push_back("3rd,0c");
	m[2].push_back("1rd,1cr");m[2].push_back("1rd,1cl");m[2].push_back("2rd,1cr");m[2].push_back("2rd,1cl");

	m[3].push_back("0r,1cl");m[3].push_back("0r,2cl");m[3].push_back("1rd,0c");m[3].push_back("1rd,1cl");m[3].push_back("1rd,2cl");
	m[3].push_back("2rd,0c");m[3].push_back("2rd,1cl");m[3].push_back("2rd,2cl");m[3].push_back("3rd,1cl");

	m[4].push_back("1ru,0c");m[4].push_back("1rd,0c");m[4].push_back("2rd,1cr");m[4].push_back("0r,1cr");m[4].push_back("0r,2cr");
	m[4].push_back("1ru,1cr");m[4].push_back("1ru,2cr");m[4].push_back("1rd,1cr");m[4].push_back("1rd,2cr");

	m[5].push_back("1ru,0c");m[5].push_back("1rd,0c");m[5].push_back("2rd,0c");m[5].push_back("0r,1cr");m[5].push_back("0r,1cl");
	m[5].push_back("1ru,1cr");m[5].push_back("1ru,1cl");m[5].push_back("1rd,1cr");m[5].push_back("1rd,1cl");

	m[6].push_back("1ru,0c");m[6].push_back("1rd,0c");m[6].push_back("2rd,1cl");m[6].push_back("0r,1cl");m[6].push_back("0r,2cl");
	m[6].push_back("1ru,1cl");m[6].push_back("1ru,2cl");m[6].push_back("1rd,1cl");m[6].push_back("2rd,2cl");

	m[7].push_back("1ru,0c");m[7].push_back("2ru,0c");m[7].push_back("1ru,1cr");m[7].push_back("1ru,2cr");m[7].push_back("2ru,1cr");
	m[7].push_back("2ru,2cr");m[7].push_back("0r,1cr");m[7].push_back("0r,2cr");m[7].push_back("1rd,1cr");

	m[8].push_back("1rd,0c");m[8].push_back("0r,1cr");m[8].push_back("0r,1cl");m[8].push_back("1ru,0c");m[8].push_back("1ru,1cr");
	m[8].push_back("1ru,2cr");m[8].push_back("2ru,0c");m[8].push_back("2ru,1cr");m[8].push_back("2ru,1cl");

	m[9].push_back("1ru,0c");m[9].push_back("2ru,0c");m[9].push_back("1rd,1cl");m[9].push_back("0r,1cl");m[9].push_back("0r,2cl");
	m[9].push_back("1ru,1cl");m[9].push_back("1ru,2cl");m[9].push_back("2ru,1cl");m[9].push_back("2ru,2cl");

	m[0].push_back("1ru,0c");m[0].push_back("2ru,0c");m[0].push_back("3ru,0c");m[0].push_back("1ru,1cr");m[0].push_back("1ru,1cl");
	m[0].push_back("2ru,1cr");m[0].push_back("2ru,1cl");m[0].push_back("3ru,1cr");m[0].push_back("3ru,1cl");

	map <int,pair<int,int> > m2 ;
	m2[1].first=0;m2[1].second=0;
	m2[2].first=0;m2[2].second=1;
	m2[3].first=0;m2[3].second=2;
	m2[4].first=1;m2[4].second=0;
	m2[5].first=1;m2[5].second=1;
	m2[6].first=1;m2[6].second=2;
	m2[7].first=2;m2[7].second=0;
	m2[8].first=2;m2[8].second=1;
	m2[9].first=2;m2[9].second=2;
	m2[0].first=3;m2[0].second=1;

	int n ,e=1, arr[4][3]={0};
	string s;
	cin >> n >> s;
	if (n==9){
        if (s=="000000000")
          {
             cout << "NO";
             return 0;
          }

	}
	for (int i=0;i<3;i++){
        for (int j=0;j<3;j++){
            arr[i][j]=e;
            e++;
        }
	}
	vector<string> v;
	string temp;

	int t1,t2,cx,cy,nx,ny,nnx,nny;
	for (int i=0;i<n-1;i++){
     t2=int(s[i+1])-48;
       t1=int(s[i])-48;
       cx=m2[t1].first;
       cy=m2[t1].second;
//cout << t1<< " " <<t2<<endl;
       nx=m2[t2].first;
       ny=m2[t2].second;
       stringstream oss;
       if (t2-t1>0){
            //cout << "A*&A "<<endl;
            if (cx>nx)
            nnx=cx-nx;
        else
            nnx=nx-cx;
        if (cy>ny)
            nny = cy-ny;
            else
                nny=ny-cy;
        if (nx==cx){
            oss << "0r,"<<nny << "cr";

        }
        else if (ny==cy){
            oss << nnx << "rd,0c";

        }
        else {
            oss << nnx << "rd,"<<nny;
            if (cy==1){

            if (t2==1||t2==4||t2==7){
                oss << "cl";
            }
            else if (t2==3||t2==6||t2==9){
                oss << "cr";
            }
            }
            else if (cy==0){

                oss << "cr";

            }
            else if (cy==2){

                oss << "cl";

            }

        }

       }
       else if (t2-t1<0){
        if (t2==0){
               if (cx>nx)
            nnx=cx-nx;
        else
            nnx=nx-cx;
        if (cy>ny)
            nny = cy-ny;
            else
                nny=ny-cy;

            oss << nnx <<"ru," ;
            if (t1==2||t1==5||t1==8){
                oss <<"0c";
            }
            else if (t1==1||t1==4||t1==7){
                oss << nny << "cl";
            }
            else if (t1==3||t1==6||t1==9){
                oss << nny << "cr";
            }
        }
        else {
                if (cx>nx)
            nnx=cx-nx;
        else
            nnx=nx-cx;
        if (cy>ny)
            nny = cy-ny;
            else
                nny=ny-cy;
             if (nx==cx){
            oss << "0r,"<<nny << "cl";

        }
        else if (ny==cy){
            oss << nnx << "ru,0c";

        }
        else {
            oss << nnx << "ru,"<<nny;
            if (cy==1){

            if (t2==1||t2==4||t2==7){
                oss << "cl";
            }
            else if (t2==3||t2==6||t2==9){
                oss << "cr";
            }
            }
            else if (cy==0){

                oss << "cr";

            }
            else if (cy==2){
                oss << "cl";
            }
        }

        }
         //cout << oss.str() <<endl;
       }
       v.push_back(oss.str());
      //cout << oss.str() <<endl;
       oss.clear();

	}

	cout << v[0]<< " "<<v[1]<< " "<< v[2]<<endl;
	vector <string> ::iterator it;vector <string> ::iterator it2;
	int coun=0,current;
	bool flag=false;
	for (int i=0;i<10;i++){
        coun=0;
        current=i;

        for (it=v.begin();it!=v.end();it++){
                for (it2=m[current].begin();it2!=m[current].end();it2++){

            if (*it2==*it){
                    //cout << *it <<endl;
                   // cout << coun<<endl;
                    flag=true;
                coun++;
                int xx=m2[current].first;
                int yy=m2[current].second;
                     //cout << xx << " " << yy <<endl;
               string tt=*it;
               //cout << tt <<endl;
               if (int(tt[0])-48!=0){
                if (tt.length()==6){
                    if (tt[2]=='d'){
                        xx+=int(tt[0])-48;
                    }
                    else{
                        xx-=int(tt[0])-48;
                    }
                }
                else{
                    if (tt[2]=='d'){
                        xx+=int(tt[0])-48;
                    }
                    else{
                        xx-=int(tt[0])-48;
                    }
                     if (tt[6]=='r'){
                         yy+=int(tt[4])-48;
                     }
                     else{
                         yy-=int(tt[4])-48;
                     }
                }
               }
               else{
               // 3 5
                if (tt[5]=='r'){
                    yy+=int(tt[3])-48;
                }
                else{
                    yy-=int(tt[3])-48;
                }
               }

               current=arr[xx][yy];
               break;
               //cout<<"A7aaaa" <<endl;
            }
        }
            if (flag==false){
                break;
            }
            else {
               flag=false;
            }
        }
              // cout << coun<<endl;
        if (coun==v.size()){
            cout << "NO"<<endl;
            return 0;
        }
	}
	cout << "YES" <<endl;

    return 0;
}


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

/* MIGHT BE OF USE

#define si(x)	scanf("%d",&x)
#define pi(x)	printf("%d\n",x)

typedef pair<int, int>	pii;
typedef vector<int>		vi;
typedef vector<pii>		vpii;
*/

#define fo(i,a,b) for(i=a;i<b;i++)
#define ll long long
#define sl(x)	scanf("%lld",&x)
#define pl(x)	printf("%lld\n",x)
#define ss(s)	cin>>s
#define ps(s)	cout<<s
#define deb(x) cout << #x << "=" << x << endl
#define pb push_back

typedef pair<ll, ll>	pl;
typedef vector<ll>		vl;
typedef vector<pl>		vpl;
typedef vector<string>	vs;

void solve()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    string s,t;
    ss(s);
    ss(t);

    bool del = false;

    ll n =s.length();
    ll m = t.length();

    for(ll i=0, j=0; i<n; ++i)
    {
        if(j<m&&s[i]==t[j])
            ++j;
        if(j==m)
        del=true;
    }
    //deb(del);

    ll cnt[30];
    memset(cnt,0,sizeof cnt);

    for(ll i =0 ; i<s.length(); i++)
        cnt[s[i]-'a']++;
    for(ll j =0 ; j<t.length(); j++)
        cnt[s[j]-'a']--;

    bool all= true, rep =true;

    for(ll i=0; i<26; i++)
    {
        all = all && cnt[i]>=0;  //if == 0 means rep needed if > 0 means del needed
        rep = rep && cnt[i]==0;
    }

    if(del)
        cout<<"automaton";
    else if(rep)
        cout<<"array";
    else if(all)
        cout<<"both";
    else
        cout<<"need tree";

    return;

}

int main()
{

    ll t = 1;
    //sl(t);
    while(t--)
    {
        solve();
    }

    return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <stdio.h>
#include <unordered_map>
#include <set>
#define ull unsigned long long
#define ll long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
ll dp[1000001][4];
int fun(int n,int st)
{
	int ans = 0;
	if(n == 0 and st == 0)
		return 1;
	else if(n < 0 )
		return 0;
	for (int i = 0; i < 4 and n-1 >= 0; ++i)
	{
		if(i == st)
			continue;
		if(dp[n-1][i] == 0)
			dp[n-1][i] = fun(n-1,i);
		dp[n][st] += dp[n-1][i];
	}
	return dp[n][st]%(1000000000+7);
}
int main()
{
	IOS;
	ll n,k,ans,temp;
	cin>>n;
	temp = fun(n,0);
	ans = dp[n][0];
	cout<<temp<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,k =2;

    while(1)
    {
        cin>>n>>m;
        for(int i =m; i>0; i--)
        {
            n +=i;
            while(k--)
            {
                int u,v;
                cin>>u>>v;
                n-=u;
            }
            cout<<n<<endl;
        }

    }

    return 0;
}


#include <iostream>
using namespace std;

int main() {
int p1=0 , p2=0 , s , st ;
cin>> s;
 s=s/2;
 for(short i=0;i<s;i++ ){
 	p1=p1+2;
 	p2=p2+1;
 	st=p1+p2;

 }
 cout<<st;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <algorithm>
#include <ctype.h>
#include <math.h>
using namespace std;
#define mp make_pair
#define rs resize
#define sz size
#define pb push_back
typedef long long ll;
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define mod 1000000007
#define eps (double)1e-9
typedef pair <pair <ll, ll>, pair <ll, ll> > pairpair;

vector <int> kk;

int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int i, j, n, p, k, m;
    cin >> p >> k;
    kk.push_back(1);
    int kr = 1;
    while (kr * k % p != 1) {
        kk.push_back(kr * k % p);
        kr = kr * k % p;
    }

    m = (p - 1) / kk.size();

    long long ans = 1;
    for (i = 0; i < m; i++) ans = (ans * p) % 1000000007;
    cout << ans;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

long long n;

inline char nextchar();
inline int read(char type);
inline void write(int x);

int main()
{
    n=read('f');
    write(n-n/2-n/3-n/5-n/7+n/6+n/10+n/14+n/15+n/21+n/35-n/30-n/42-n/70-n/105+n/210);
    return 0;
}

inline char nextchar()
{
	static char buf[100000],*p1=buf, *p2=buf;
	return (p1 == p2)&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}

inline long long read(char type)
{
	if(type=='f')
	{
		long long p=0;
		char ch=0;
		bool sign=false;
		while (!isdigit(ch))
		{
			sign|=(ch=='-');
			ch=nextchar();
		}
		while(isdigit(ch))
		{
			p=p*10+(ch^48);
			ch=nextchar();
		}
		p=sign?-p:p;
		return p;
	}
	else
	{
		int x=0,f=1;
		char ch=getchar();
		while(ch<'0'||ch>'9')
		{
			if(ch=='-')
			{
				f=-1;
			}
			ch=getchar();
		}
		while(ch>='0'&&ch<='9')
		{
			x=(x<<1)+(x<<3)+(ch^48);
			ch=getchar();
		}
		return x*f;
	}
}

inline void write(int x)
{
	static long long stk[100],top=0;
	if(x==0)
	{
		putchar('0'); return;
	}
	if(x<0)
	{
		x=-x;
		putchar('-');
	}
	while(x)
	{
		stk[++top]=x%10;
		x/=10;
	}
	while(top)
	{
		putchar(stk[top--]+'0');
	}
}


// IN THE NAME OF ALLAH
#include<bits/stdc++.h>
#define pb push_back
#define X first
#define Y second
#define F(i,a,b) for(ll i=(a) ; i<=(b) ; i++)
#define PI 3.1415926535897932384626433832795
#define eps 0.000001
using namespace std;
typedef long long ll;
typedef long double ld;
const ll M=5e5+100;
#define 2025 2520

ll d=2025,k,t;
ll n;

int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
//cout << setprecision(22) << fixed;
ios::sync_with_stdio(false);

cin>>n;
F(i,1,2025){
	bool mark=false;
	F(j,2,10) if(i%j==0) mark=true;
	if(!mark) k++;
}
F(i,1,n%2025){
	bool mark=false;
	F(j,2,10) if(i%j==0) mark=true;
	if(!mark) t++;
}
cout<<(n/2025)*k+t;

return 0;
}


from math import factorial

def binomial(n, r):
    return factorial(n) // factorial(r) // factorial(n-r)

def a(n) :
        return binomial(2*n, n) - 1
x = int(input())
print(a(x + 1))


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n , k , t;
    cin>>n>>k>>t;
    bool spec[n]={};
    for(long long int i = 0;i<=t-1;++i)
    {
        if(i<=k-1){
            spec[i]=true;
        }
        else if(i>k-1 && i<=n-1)
        {
            spec[i-k]=false;
            spec[i]=true;
        }
        else if(i>n-1)
        {
            spec[i-k]=false;
        }
    }
    long long int ans = 0;
    for(long long int i = 0 ; i<=n-1;++i)
    {
        if(spec[i])++ans;
    }
    cout<<ans;
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <stdlib.h>

#define N 1000 * 100 + 5
using namespace std;

int mask(int x)
{
	char s[N];
	char * ans = new char[N];
	memset(ans, 0, N);
	int ai = 0;
	snprintf(s, N, "%d", x);
	for (int i = 0; i < strlen(s); ++i)
	{
		if(s[i] == '4' || s[i] == '7')
			ans[ai++] = s[i];
	}
	return atoi(ans);
}

int main(){

	int a, b;
	cin >> a >> b;
	a++;
	while(mask(a) != b)
		a++;
	cout << a;
}


#include <stdio.h>
#include <iostream>
#include <math.h>

using namespace std;

int check(int a,int b)
{
    int c[50];
    int count =0;
    while(a>0)
    {
        if(a%10 == 4 || a%10==7)
        {
            c[count]=a%10;
            count++;
        }
        a=a/10;
    }
    int num=0;
    int mul=1;
//  cout<<"palash"<<endl;
    for(int i=count-1;i>=0;i--)
    {
        num=num*mul;
        num+=c[i];
        mul*=10;
    }

    if(num == b)
        return 1;
    else return 0;
}

int main()
{
    long long int a,b;
    cin>>a>>b;

    if(b>a)
    {
        cout<<b<<endl;
        return 0;
    }
    else if (b==a)
    {
        cout<<1<<b;
    }
    else
    {
        int i=0;
        for(i=a+1;;i++)
        {
        //  cout<<"palashmittal";
            int ch=check(i,b);
            if(ch==1)
            {
                cout<<i<<endl;
                break;
            }
            else
                {
                    //printf("palash\n");
                    continue;
                }
        }
    }

    return 0;
}


#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 <ctime>
#include <string>
#include <cstring>
#include <queue>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 1e9
#define eps 1e-9
#define PI 3.14159265358979323846264338327950
#define MAX 2001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))
#define ppc(x) __builtin_popcount((x))
#define iter(it,s) for (__typeof(s.begin()) it = s.begin(); it != s.end(); it++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;

int dx[] = { 0, 0, 1, -1 };
int dy[] = { 1, -1, 0, 0 };

inline int cnt(ll n) {
	int res = 0;
	while (n)
		res++, n /= 10;
	return res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
//		freopen("o.txt", "wt", stdout);
#endif
	ll w, m, k, res = 0, c = 0;
	cin >> w >> m >> k;
	while (res + k * cnt(m) <= w) {
		while (cnt(m) == cnt(m + 100000) && res + k * 100000 * cnt(m) <= w) {
			m += 100000;
			c += 100000;
			res += k * 100000 * cnt(m);
		}
		if (res + k * cnt(m) <= w) {
			res += k * cnt(m);
			m++;
			c++;
		}
	}
	cout << c << endl;
	return 0;
}


#include <iostream>
using namespace std;
long long n, i, v[105], nr, sol, k, bun;
int main()
{
    cin>>n;
    k=1; v[k]=-1;
    while(k)
        if(v[k]<n) {
            v[k]++;
            bun=1;
            if(v[k])
                for(i=1; i<k; i++)
                    if(v[i]==v[k]) bun=0;
            if(bun)
                if(k<n)
                    k++, v[k]=-1;
                else {
                    nr=0;
                    for(i=1; i<=n; i++)
                        if(v[i]) nr++;
                    if(nr==5) {
                        sol++;
                    }
                }
        }
        else
            k--;
    cout<<sol;
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n,a[100],m=-1;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		m=max(m,a[i]);
	}
	cout<<(a[n]|m)<<endl;
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
const int MAXN=55;
const int Mod=1000000007;
const int Inv=500000004;
inline void add(int &x,int y)
{
    if((x+=y)>=Mod)x-=Mod;
}
int d[MAXN],cnt[MAXN][MAXN],dp[2][MAXN][MAXN][MAXN*3];
int main()
{
    for(int i=0;i<MAXN;i++)
        for(int j=0;j<MAXN;j++)
        {
            cnt[i][j]=1;
            for(int k=1;k<=i+2*j;k++)
                cnt[i][j]=1LL*k*cnt[i][j]%Mod;
            for(int k=1;k<=j;k++)
                cnt[i][j]=1LL*Inv*cnt[i][j]%Mod;
        }
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&d[i]);
    int now=0,la=1;
    if(d[2]==2)dp[now][1][0][d[1]-1]=1;
    else dp[now][0][1][d[1]-1]=1;
    for(int i=3;i<=n;i++)
    {
        swap(now,la);
        memset(dp[now],0,sizeof(dp[now]));
        for(int j=0;j<=i;j++)
            for(int k=0;k<=i;k++)
                for(int l=0;l<=2*i;l++)
                {
                    if(l>0)
                    {
                        if(d[i]==2)
                        {
                            //right 0
                            if(j>0)add(dp[now][j-1][k][l-1],1LL*j*dp[la][j][k][l]%Mod);
                            if(k>0)add(dp[now][j+1][k-1][l-1],1LL*k*dp[la][j][k][l]%Mod);
                            //right 1
                            add(dp[now][j+1][k][l-1],dp[la][j][k][l]);
                        }
                        else
                        {
                            //right 0
                            if(j>1)add(dp[now][j-2][k][l-1],1LL*j*(j-1)/2*dp[la][j][k][l]%Mod);
                            if(k>1)add(dp[now][j+2][k-2][l-1],1LL*k*(k-1)/2*dp[la][j][k][l]%Mod);
                            if(j>0 && k>0)add(dp[now][j][k-1][l-1],1LL*j*k*dp[la][j][k][l]%Mod);
                            //right 1
                            if(j>0)add(dp[now][j][k][l-1],1LL*j*dp[la][j][k][l]%Mod);
                            if(k>0)add(dp[now][j+2][k-1][l-1],1LL*k*dp[la][j][k][l]%Mod);
                            //right 2
                            add(dp[now][j][k+1][l-1],dp[la][j][k][l]);
                        }
                    }
                    else
                    {
                        if(j>0)add(dp[la][d[i]==2][d[i]==3][j+2*k-1],1LL*j*cnt[j-1][k]%Mod*dp[la][j][k][l]%Mod);
                        if(k>0)add(dp[la][d[i]==2][d[i]==3][j+2*k-1],1LL*k*cnt[j+1][k-1]%Mod*dp[la][j][k][l]%Mod);
                    }
                }
    }
    return 0*printf("%d",dp[now][0][0][0]);


#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include <functional>
#include<map>
#include <queue>
#include<deque>
#include<set>
#include<bitset>
using namespace std;
#define fi first
#define se second
#define p_b push_back
#define all(n) n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
#define mk_p make_pair
#define pr_setp(n)cout<<setprecision(2)<<n;
#define pr_setp1(n)cout<<setprecision(10)<<fixed<<n;
#define l_b lower_bound
#define u_b upper_bound
#define forr(i,a,b) for(int i=(a);i<(b);i++)(
#define forn(i,n) forr(i,0,n)
#define MAXP 1000001
#define PI 3.1415926535897
typedef long long ll;
char sl='\n';

int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	ll number; cin >>number;
	ll x = number;
	ll ans = -1;
	int tmp = 0;
	map<ll,int>f;
	for(int i =2;i<=sqrt(number);++i)
	{
		while(!(number%i))
		{
			f[i]++;
			number/=i;
		}
	}
	if(number>1)f[number]++;
	cout<<(f.size()>1?1:(*f.begin()).fi)<<sl;
	return 0;
 }


#include <bits/stdc++.h>

const int md = 1000000007;
using namespace std;

int solve(int a, int b){

    queue < pair<pair<int, int>, int> > q; q.push({{a, b}, 0});
    while(q.size() > 0){
        pair<pair<int, int>, int> node = q.front(); q.pop();

        if(node.first.first == node.first.second)
            return node.second;
        int x = node.first.first;
        int y = node.first.second;

        if(x % 2 == 0)
            q.push({{x / 2, y}, node.second + 1});
        if(x % 3 == 0)
            q.push({{x / 3, y}, node.second + 1});
        if(x % 5 == 0)
            q.push({{x / 5, y}, node.second + 1});

        if(y % 2 == 0)
            q.push({{x, y / 2}, node.second + 1});
        if(y % 3 == 0)
            q.push({{x, y / 3}, node.second + 1});
        if(y % 5 == 0)
            q.push({{x, y / 5}, node.second + 1});

    }
    return -1;
}

int main(){
    int x, y; scanf("%d %d\n", &x, &y);
    cout << solve(x, y) << endl;
    return 0;

}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <string.h>
#include <unordered_set>
#include <set>
#include <stack>
#include <queue>

using namespace std;

#define PI 3.14159265
#define MAX 1005

double calculateAngle(vector<int> x, vector<int> y) {

    double tu = x[0]*y[0] + x[1]*y[1] + x[2]*y[2] + x[3]*y[3] + x[4]*y[4];

    double ab_lenght = sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2] + x[3]*x[3] + x[4]*x[4]);
    double ac_lenght = sqrt(y[0]*y[0] + y[1]*y[1] + y[2]*y[2] + y[3]*y[3] + y[4]*y[4]);

    double result = (tu*1.0)/(ab_lenght*ac_lenght);

    double angle = acos(result) * 180.0 / PI;

    return angle;
}

int main() {

#ifndef ONLINE_JUDGE
    freopen("/Users/TamLe/Documents/Input.txt", "rt", stdin);
#endif

    int n;
    cin>>n;

    vector<int> v[MAX];

    int a, b, c, d, e;

    for (int i = 0; i < n; ++i) {
        cin>>a>>b>>c>>d>>e;
        v[i].push_back(a);
        v[i].push_back(b);
        v[i].push_back(c);
        v[i].push_back(d);
        v[i].push_back(e);

    }

    if (n == 1) {
        cout<<1<<endl<<1<<endl;
        return 0;
    }
    else if (n == 2) {
        cout<<2<<endl<<1<<endl<<2<<endl;
        return 0;
    }

    vector<int> res;

    vector<int> ab, ac, ba, bc, ca, cb;

    for (int i = 0; i < n; ++i) {

        bool flag = true;

        for (int k = 0; k < n; ++k) {

            if (k == i) {
                continue;
            }

            for (int t = 0; t < n; ++t) {

                if (k == t || t == i) {
                    continue;
                }

                ab.clear();
                ac.clear();

                ab.push_back(v[k][0] - v[i][0]);
                ab.push_back(v[k][1] - v[i][1]);
                ab.push_back(v[k][2] - v[i][2]);
                ab.push_back(v[k][3] - v[i][3]);
                ab.push_back(v[k][4] - v[i][4]);

                ac.push_back(v[t][0] - v[i][0]);
                ac.push_back(v[t][1] - v[i][1]);
                ac.push_back(v[t][2] - v[i][2]);
                ac.push_back(v[t][3] - v[i][3]);
                ac.push_back(v[t][4] - v[i][4]);

                if (calculateAngle(ab, ac) < 90) {
                    flag = false;
                }

            }
        }

        if (flag) {
            res.push_back(i + 1);
            break;
        }
    }

    cout<<res.size()<<endl;
    for(int i = 0; i < res.size(); ++i) {
        cout<<res[i]<<endl;
    }
    return 0;

}

//int main() {
//
//#ifndef ONLINE_JUDGE
//    freopen("/Users/TamLe/Documents/Input.txt", "rt", stdin);
//#endif
//
//    bool A[N];
//    string s;
//    cin>>s;
//
//    for(int i = 0; i < s.length(); ++i) {
//        int index = s[i];
//        A[index] = true;
//    }
//
//    string b, temp;
//    cin>>b;
//
//    int n;
//    cin>>n;
//
//    int left = -1, right = -1;
//
//    for(int i = 0; i < n; ++i) {
//        cin>>temp;
//
//        for(int k = 0; k < temp.length(); ++k) {
//
//            if (k >= b.length()) {
//                cout<<"NO"<<endl;
//                break;
//            }
//            else {
//                if (b[k] != '*') {
//
//                    if (b[k] != '?') {
//                        if (b[k] != temp[k]) {
//                            cout<<"NO"<<endl;
//                            break;
//                        }
//                    }
//                    else {
//                        if (A[b[k]] == false) {
//                            cout<<"NO"<<endl;
//                            break;
//                        }
//                    }
//
//                }
//                else {
//                    left = k;
//                    right = k;
//                    break;
//                }
//            }
//        }
//
//        if (left == -1) {
//            cout<<"YES"<<endl;
//            break;
//        }
//        else {
//            int x = (int)b.length() - 1;
//            int y = (int)temp.length() - 1;
//            while (b[x] != '*' && y >= 0) {
//
//                if (b[x] != '?') {
//                    if (b[x] != temp[y]) {
//                        cout<<"NO"<<endl;
//                        break;
//                    }
//                }
//                else {
//                    if (A[b[x]] == false) {
//                        cout<<"NO"<<endl;
//                        break;
//                    }
//                }
//
//                x--;
//                y--;
//            }
//
//            right = x;
//
//            if (left)
//        }
//
//    }
//
//
//
//    return 0;
//}

//const int maxn = fds;
//long long f[maxn];
//const int mod = 1e9 + 7;
//int isPrime[maxn];
//
//int main() {
//#ifndef ONLINE_JUDGE
//    freopen("/Users/TamLe/Documents/Input.txt", "rt", stdin);
//#endif
//
//    for(int i = 2; i < maxn; ++i) {
//        isPrime[i] = i;
//    }
//
//    for (int i = 2; i * i < maxn; ++i) {
//        if (isPrime[i] == i)
//            for (int j = i * i; j < maxn; j += i)
//                isPrime[j] = min(i, isPrime[j]);
//    }
//
//    f[1] = 0;
//    for (int i = 2; i < maxn; ++i) {
//        f[i] = 1LL * i * (i-1)/2;
//        f[i] = 1LL*f[isPrime[i]] * (i/isPrime[i]) + 1LL*f[i/isPrime[i]];
//    }
//
//
//    int t, l, r;
//    cin >> t >> l >> r;
//    long long ans = 0;
//    long long pro = 1;
//    for(int i = l; i <= r; i++) {
//        f[i] %= mod;
//        ans = 1LL * ans + 1LL * pro * f[i];
//        pro *= 1LL * t;
//        pro %= mod;
//        ans %= mod;
//    }
//    cout << ans << endl;
//    return 0;
//}

//int main() {
//#ifndef ONLINE_JUDGE
//    freopen("/Users/TamLe/Documents/Input.txt", "rt", stdin);
//#endif
//
//    unordered_set<int> comp;
//
//    int n, sum, temp;
//    scanf("%d %d", &n, &sum);
//
//    for(int i = 0; i < n; ++i) {
//        scanf("%d", &temp);
//        if (comp.find(temp) != comp.end()) {
//            printf("Yes");
//            return 0;
//        }
//        comp.insert(sum-temp);
//    }
//
//    printf("No");
//    return 0;
//}


#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
inline char nc() {
//	return getchar();
	static char buf[100000], *l = buf, *r = buf;
	return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++;
}
template<class T> void read(T &x) {
	x = 0; int f = 1, ch = nc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
	while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
	x *= f;
}
#define inv(a) power(a, mod - 2)
typedef long long ll;
const int mod = 1e9 + 7;
const int maxm = 100000 + 5;
const int maxp = 400;
int m, p;
int id[maxm], ver[maxp];
int mark[maxm], mu[maxm];
ll f[maxm], g[maxm][maxp];
vector<int> prime;
vector<int> rec[maxm];
ll power(ll x, ll y) {
	ll re = 1;
	while(y) {
		if(y & 1) re = re * x % mod;
		x = x * x % mod;
		y >>= 1;
	}
	return re;
}
void init(int n) {
	mark[1] = 1, mu[1] = 1;
	for(int i = 2; i <= n; ++i) {
		if(!mark[i]) {
			prime.push_back(i);
			mu[i] = -1;
		}
		for(unsigned int j = 0; j < prime.size(); ++j) {
			int x = i * prime[j]; if(x > n) continue;
			mark[x] = 1;
			if(i % prime[j]) {
				mu[x] = 0;
				return;
			}
			mu[x] = -mu[x];
		}
	}
}
int main() {
	read(m);
	init(m);
	for(int i = 1; i <= m; ++i) rec[i].clear();
	for(int i = 1; i <= m; ++i) {
		for(int j = i; j <= m; j += i) {
			rec[j].push_back(i);
		}
	}
	for(int i = 1; i <= m; ++i) {
		if(!id[m / i]) id[m / i] = ++p, ver[p] = m / i;
	}
	for(int i = 1; i <= m; ++i) {
		for(unsigned int j = 0; j < rec[i].size(); ++j) {
			int x = rec[i][j];
			for(int k = 1; k <= p; ++k) {
				g[i][k] = (g[i][k] + mu[x] * (ver[k] / x)) % mod;
			}
		}
	}
	ll r = inv(m);
	for(int i = 2; i <= m; ++i) {
		for(unsigned int j = 0; j < rec[i].size(); ++j) {
			int x = rec[i][j]; if(x == i) continue;
			f[i] = (f[i] + f[x] * g[i / x][id[m / x]] % mod) % mod;
		}
		f[i] = (f[i] * r + 1) % mod * inv(1 - g[1][id[m / i]] * r % mod) % mod;
	}
	ll an = 0;
	for(int i = 1; i <= m; ++i) {
		an = (an + f[i]) % mod;
	}
	an = (an * r + 1) % mod;
	cout << (an + mod) % mod << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
 int n, cnt=0;
 cin » n;
 vector <int> a(n);
 for (int i=0; i<n; i++)
 cin»a[i];
 sort (a, a+n);
 for (int i=0; i<n; i++)
 {
 if((a[i]==0 ||a[i]==1) && i!=n-1)
 i++;
 for (int j=0; j<n-1; j++)
 {
 if (i==j)
 j++;
 //cout « "a[i]="«a[i]«" a[j]="«a[j]«endl;
 if (a[i]!=0 && a[j]!=0)
 if (a[i]%a[j]==0 || a[j]%a[i]==0)
 a[j]=0;
 //cout « "a["«i«"]="«a[i]«" a["«j«"]="«a[j]«endl;
 }
 }
 for (int i=0; i<n; i++)
 {
 if (a[i]!=0)
 if (a[i]==1 && cnt==0)
 cnt++;
 else
 if (a[i]==1)
 i++;
 else
 cnt++;
 }
 cout«cnt;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int dp[n + 1];
    for (int i = 0; i <= n; i++)
    {
        if (i == 0)
        {
            dp[0] = 1;
            continue;
        }
        if (i & 1)
        {
            dp[i] = 0;
        }
        else
        {
            dp[i] = dp[i - 2] * 2;
        }
    }
    cout << dp[n];
    delete[] dp;
}


// User: el_heffeh
// Date: 7/1/20

#include <bits/stdc++.h>

using namespace std;

long long n, M, cnt, diff, in, sum = 0, q, r;

long long tm[107];

vector<long long> ans;

void solve() {
	cin >> n >> M;
	for (long long i = 0; i < n; ++i) {
		cin >> in; sum += in, diff = sum - M, cnt = 0;
		if (diff > 0) {
			for (long long j = 100; j > 0; --j) {
				if (diff > 0) {
					if (tm[j] > 0) {
						q = diff / j, r = diff % j;
						if (q >= tm[j]) {
							diff -= tm[j] * j;
							cnt += tm[j];
						} else {
							if (r) {
								q++;
							}
							diff -= j * q;
							cnt += q;
						}
					}
				}
			}
		}
		tm[in]++;
		ans.push_back(cnt);
	}
	long long ind = 1;
	for (long long i: ans) {
		cout << i;
		if (ind != ans.size()) {
			cout << ' ';
		}
		ind++;
	}
	cout << endl;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    //freopen("input.txt", "r", stdin);
	solve();
	return 0;
}

/*
	When writing code, be sure to look out for:
 	* Array out of bounds access
 	* Integer overflow
 	* Variable scopes and names
 	* Be proactive and make sure to completely think a whole problem through before writing any code
 	Coding is a fun activity, and it should be treated that way. Don't get mad over some failed test cases or time limit exceeded verdicts. Keep your cool and stay calm!
*/


#include <bits/stdc++.h>
using namespace std;
int main(){
long long int x;
 cin>>x;
if(x==1){
cout<<1;
}else{

cout<<(x/2)+1
}
}

return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cstdlib>

using namespace std;

#define ri(X) scanf("%d", &(X))
#define pi(X) printf("%d", (X))
#define mp(X,Y) make_pair(X,Y)
#define pb(X) push_back(X)
#define lint long long
#define pii pair<int,int>
#define inf 1e9
#define linf 1e18
#define X first
#define Y second
#define all(X) (X).begin(),(X).end()
#define uni(X) X.erase(unique(X.begin(), X.end()), X.end());

lint m, h1, xx1, yy1, a1, h2, x2, y2, a2;
lint a[20000005], b[20000005];

int main(){
  cin >> m;
  cin >> h1 >> a1;
  cin >> xx1 >> yy1;
  cin >> h2 >> a2;
  cin >> x2 >> y2;

  a[0] = h1;
  b[0] = h2;
  for (int i = 1; i < 20000005; i++) {
    a[i] = (a[i-1] * xx1 + yy1) % m;
    b[i] = (b[i-1] * x2 + y2) % m;
  }

  int t = 0;
  for (int i = 0; i < 20000005; i++) {
    if (a[i] == a1 && b[i] == a2) break;
    t++;
  }

  if (t == 20000005) cout << -1 << endl;
  else cout << t << endl;

  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<pair<long long,long long>> v1;
int main() {
    long long la,ra,ta,lb,rb,tb;
    cin>>la>>ra>>ta;
    cin>>lb>>rb>>tb;
    long long ans = max(ra-la+1,rb-lb+1);
    if(la<lb){
        while(la<lb){
            la+=ta;
            ra+=ta;
        }
        la-=ta;
        ra-=ta;
        long long hold = 10000000;
        while(hold-- && lb<1000000000){
            v1.push_back(make_pair(lb,rb));

            lb+=tb;
            rb+=tb;
        }

        hold = 10000000;
        while(hold-- && la<1000000000){
            v1.push_back(make_pair(la,ra));

            la+=ta;
            ra+=ta;
        }
    }
    else if(la>lb){
        while(la>lb){
            lb+=tb;
            rb+=tb;
        }
        lb-=tb;
        rb-=tb;
        long long hold = 10000000;
        while(hold-- && la<1000000000){
            v1.push_back(make_pair(la,ra));
            la+=ta;
            ra+=ta;
        }
         hold = 10000000;
        while(hold-- && lb<1000000000){
            v1.push_back(make_pair(lb,rb));
            lb+=tb;
            rb+=tb;
        }

    }else{
        long long hold = 10000000;
        while(hold-- && la<1000000000){
            v1.push_back(make_pair(la,ra));
            la+=ta;
            ra+=ta;
        }
      hold = 10000000;
        while(hold-- && lb<1000000000){
            v1.push_back(make_pair(lb,rb));
            lb+=tb;
            rb+=tb;
        }
    }
    sort(v1.begin(),v1.end());

    long long maxoverlap = 0;
    auto left = v1[0];
    for(long long i=1;i<v1.size();i++){
        long long overlap = min(left.second,v1[i].second)-v1[i].first+1;
        if(overlap>maxoverlap){
            maxoverlap = overlap;

        }
        if(v1[i].second>left.second){
            left = v1[i];
        }
    }
    std::cout<<min(ans,maxoverlap)<<endl;

}


#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k;cin>>n>>k;
    vector<int> v;
    int i;
    for( i=0;i<=n;i+=k){
        v.push_back(i);
    }
    v.push_back(i);
    cout<<v[v.size()-1];
}


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

int main()
{
   int h1,h2,m1,m2;
   scanf("%d:%d",h1,m1);
   scanf("%d:%d",h2,m2);
   int t1,t2;
   t1=h1*60+m1;
   t2=h2*60+m2;
   int ans=t2-t1;
   if(ans>=60)
   {
      int r=ans/60;
      ans=ans%60;
      h1=h1+r;
   }
   m1=m1+ans;
   cout<<h1<<":"<<m1<<endl;
   return 0;
}


//
//  main.cpp
//  D
//
//  Created by Liza Kondakova on 20.04.12.
//  Copyright (c) 2012 likogra@gmail.com. All rights reserved.
//

#include <iostream>
#include <vector>
using namespace std;
int l[4002];
int posl(string s){
    l[0]=-1;
    for(int k=1;k<s.size();k++){
        int j=l[k-1];
        while (j>=0&&s[j+1]!=s[k]) {
            j=l[j];
        }
        //cout<<j<<" ";
        if(j==-1&&s[k]!=s[0])
            j--;
        //cout<<j<<" ";
        l[k]=j+1;
        //cout<<l[k]<<endl;
    }
    return l[s.size()-1]+1;
}
int main ()
{
    string a,b;
    cin>>a>>b;
    string news;
    news=b+b+'$'+a+a;
    int k=posl(a);
    int per=-1;
    if(2*k>=a.size())
        per=(int)a.size()-k;
    int pp=posl(news);
    pp=2*(int)a.size()-pp;
    if(pp>=a.size()){
        cout<<"0"<<endl;
        return 0;
    }
    vector<int> pa;
    int l=pp;
    pa.push_back(l);
    l+=per;
    while (l<a.size()&&per!=-1) {
        pa.push_back(l);
        l+=per;
    }
    cin>>k;
    int c[1001][k+1];
    int sum=1;
    c[0][0]=1;
    for(int j=1;j<a.size();j++){
        c[j][0]=0;
    }
    for(int i=1;i<=k;i++){
        long long newsum=0;
        for(int j=0;j<a.size();j++){
            c[j][i]=(sum-c[j][i-1]);
            if(c[j][i]<0)
                c[j][i]+=+1000000007;
            newsum+=c[j][i];
        }
        newsum%=1000000007;
        sum=(int)newsum;
    }
    int ans=0;
    for(int i=0;i<pa.size();i++){
        ans+=c[pa[i]][k];
        ans%=1000000007;
    }
    cout<<ans<<endl;
    // insert code here...
    //std::cout << "Hello, World!\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;

typedef long long s64;

const int MaxNPoss = 2944370;

template <class T>
inline void tension(T &a, const T &b)
{
	if (b < a)
		a = b;
}

int l, r, p;

int nP = 0;
int prime[25];

inline bool isPrime(const int &num)
{
	for (int i = 0; i < nP && prime[i] * prime[i] <= num; i++)
		if (num % prime[i] == 0)
			return false;
	return true;
}

int nPoss = 0;
int poss[MaxNPoss];
inline void dfs(int num, int v)
{
	if (v == nP)
	{
		poss[nPoss++] = num;
		return;
	}

	dfs(num, v + 1);
	while ((s64)num * prime[v] <= r)
	{
		num *= prime[v];
		dfs(num, v + 1);
	}
}

int main()
{
	cin >> l >> r >> p;

	for (int i = 2; i <= p; i++)
		if (isPrime(i))
			prime[nP++] = i;

	dfs(1ll, 0);

	sort(poss, poss + nPoss);

	static bool ok[MaxNPoss];
	static int f[MaxNPoss];
	fill(f, f + nPoss, INT_MAX);
	f[0] = 0, ok[0] = true;
	for (int b = 2; b <= p; b++)
	{
		for (int i = 0, j = 0; i < nPoss; i++)
		{
			if (f[i] == INT_MAX)
				continue;
			if (f[i] + b <= p)
				ok[i] = true;

			while (j < nPoss && poss[j] < (s64)poss[i] * b)
				j++;
			if (j < nPoss && poss[j] == (s64)poss[i] * b)
				tension(f[j], f[i] + 1);
		}
	}

	int res = 0;
	for (int i = 0; i < nPoss; i++)
		if (l <= poss[i] && poss[i] <= r && ok[i])
			res++;
	cout << res << endl;

	return 0;
}


/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

int main()
{
    int b,r,n;
    cin>>b>>r>>n;
    int minb=0,maxg;
    if(b>=n)
    minb=0;
    else
    minb=(n-b);

    if(r>n)
    maxg=n;
    else
    maxg=r;

    return maxg-minb+1;
    return 0;
}


/*
0392A. Blocked Points
*/

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

int main(){
  long int n;
  cin >> n;
  if(n == 0){cout << 1;}
  else(cout << (n/3)*16+(n%3)*4;)
}


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HW2C", "HW2C\HW2C.vcxproj", "{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x64 = Debug|x64
		Debug|x86 = Debug|x86
		Release|x64 = Release|x64
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Debug|x64.ActiveCfg = Debug|x64
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Debug|x64.Build.0 = Debug|x64
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Debug|x86.ActiveCfg = Debug|Win32
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Debug|x86.Build.0 = Debug|Win32
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Release|x64.ActiveCfg = Release|x64
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Release|x64.Build.0 = Release|x64
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Release|x86.ActiveCfg = Release|Win32
		{095A0D88-9AFA-4F39-B1C6-4F7BAC8B949D}.Release|x86.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {B2E201E0-17EF-4701-B443-0A0F96FCBD1E}
	EndGlobalSection
EndGlobal


#include "library.h"

long long mod = (1LL<<32);

template <typename T>
T extGcd(T a, T b, T& x, T& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	else {
		int g = extGcd(b, a % b, y, x);
		y -= a / b * x;
		return g;
	}
}

template <typename T>
T modInv(T a, T m) {
	T x, y;
	extGcd(a, m, x, y);
	return ( (x % m) + m) % m;
}

unsigned C[150];
int n,p,q;
void solve() {
	scanf("%d %d %d", &n, &p, &q);
	p = min(p,n-1);

	for (int pp = 0; pp <= p; pp++) {
		C[pp]=1;
		int tw = 0;
		for (int i = n; i > n-pp; i--) {
			int ti = i;
			while (ti % 2 == 0) {
				ti /= 2;
				tw++;
			}
			C[pp] = (C[pp] * 1ll * ti) % mod;
		}
		for (int i = 1; i <= pp; i++ ) {
			int ti = i;
			while (ti % 2 == 0) {
				ti /= 2;
				tw--;
			}
			C[pp] = (C[pp] * 1ll * modInv((long long)ti, (long long)mod)) % mod;
		}
		for (int i = 0; i < tw; i++) C[pp] = (C[pp] * 2) % mod;
		//printf("C[%d] = %lld\n", pp, C[pp]);
	}

	unsigned ans = 0;

	for (int i = 1; i <= q; i++) {
		unsigned curr = 0;

		// sum x=0..p q^x * C(n,x)
		unsigned pot = 1;
		for (int pp = 0; pp <= p; pp++) {
			curr = (curr + pot * C[pp]) % mod;
			pot = pot * i;
		}

		ans ^= (i * curr);
	}

	printf("%u\n", ans);

}


#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define F first
#define S second

#define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout)
#define fastio ios::sync_with_stdio(0), cin.tie(0)
#define rep(i,a,b) for(int i=a; i<b; i++)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define sz(a) ((int)(a).size())
#define debug cout<<"sakdasopk\n"

#define pdd pair<ld,ld>
#define ll long long
#define ld long double
#define vi vector<int>
#define pii pair<int,int>

#define MAXN 3330
#define INF 1e18L

ll f, T, t0, a1, t1, p1, a2, t2, p2;

ll ok(ll &mid, ll &tempo, ll &falta){ return min(falta, mid*a2)*t2 + t0*max(0LL, falta-mid*a2) <= tempo;}

ll solve(ll &tempo, ll &falta){
	if(falta*t0 <= tempo) return 0;
	ll bot=0, top=falta, mid;
	while(top-bot>1){
		mid=(top+bot)>>1;
		if(ok(mid, tempo, falta)) top= mid;
		else bot= mid;
	}
	if(ok(bot, tempo, falta)) top=bot;
	if(!ok(top, tempo, falta)) return -1;
	return top*p2;
}

int main(){
	fastio;
	cin >> f >> T >> t0;
	cin >> 	a1 >> t1 >> p1;
	cin >>  a2 >> t2 >> p2;

	ll ans=INF, x;
	for(ll i=0; i<=INF; ++i){
		if(min(f, i*a1)*t1 > T) break;

		x= solve(max(0LL,T-i*a1*t1), max(0LL,f-i*a1));
		if(x!=-1) ans= min(ans, i*p1 + x);

		if((i-1)*a1 > f) break;
	}
	if(ans==INF) ans=-1;
	cout << ans << endl;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
    string players;
    vector<int> pos;
    cin >> players;
    if (players.size() < 7){
        cout << "NO" << endl;

        return 0;
    }
    else{
        for (int i = 1; i < players.size(); i++)
        {
            if (players[i - 1] == '0' &&players[i] == '0'){
                pos.push_back(i);
            }
            else if (players[i - 1] == '1' && players[i] == '1'){
                pos.push_back(i);
            }
        }
        sort(pos.begin(), pos.end());

        if (pos.back() >= 7)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;

        return 0;
    }
}


//#include <bits/stdc++.h>
#include <cstdio>
#include <ctime>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <bitset>
#include <utility>
#include <sstream>
#include <numeric>
#include <iterator>
#include <iostream>
#include <algorithm>

using namespace std;

#define sf              scanf
#define pf              printf
#define fs              first
#define se              second
#define pb              push_back
#define ins             insert
#define Lb              lower_bound
#define Up              upper_bound
#define INF             0x7F7F7F7F
#define mem(a,b)        memset(a, b, sizeof(a))
#define MAX             100010
#define MAXR            100010
#define MAXC            100010

typedef long long ll;

const double PI = 2.0 * acos(0.0);
const double eps = 1e-9;

template < class T > T Abs(T x) { return x > 0 ? x : -x; }
template < class T > string toString(T n) { ostringstream ost; ost << n; ost.flush() ; return ost.str(); }
template < class T > inline T sqr(T n) { return n * n; }

template < class T > inline T gcd(T a,T b)
{
    if(a < 0) return gcd(-a,b);
    if(b < 0) return gcd(a,-b);
    return (b == 0) ? a : gcd(b ,a % b);
}

template < class T > inline T lcm(T a,T b)
{
    if(a < 0) return lcm(-a,b);
    if(b < 0) return lcm(a,-b);
    return a * (b / gcd(a , b));
}

template < class T > T power(T n, int p)
{
    if(!p) return 1;
    else
    {
        T sum = sqr( power( n ,  p >> 1) );
        if(p & 1) sum =  n;
        return sum;
    }
}

//ll bigmod(ll num , ll p , ll mod)
//{
//    ll sum = 1 , temp = num;
//    while(p)
//    {
//        if(p & 1) sum = (sum * temp) % mod;
//        temp = (temp * temp) % mod; p = p >> 1;
//    }
//    return sum;
//}

/// S , E  , N , W
////int one [] = {0 ,1 , 0,-1};
////int two [] = {1 ,0 ,-1, 0};
///S , SE , E , NE , N , NW , W , SW
//int one [] = {1 ,1 ,0,-1,-1,-1, 0, 1};
//int two [] = {0 ,1 ,1 ,1, 0,-1,-1,-1};
///Knight Direction
//int one[]={2 ,1 ,-1,-2,-2,-1, 1, 2};
//int two[]={1 ,2 , 2, 1,-1,-2,-2,-1};

///***********************************************END*********************************//////////////////

int rev(int n);
int main()
{
    //ios_base::sync_with_stdio(0); cin.tie(0);
    int h , m;
    char ch;
    sf("%d%c%d" , h , ch , m);
    while(true)
    {
        m++;
        if(m == 60)
        {
            m = 0;
            h++;
            if(h == 24) h = 0;
        }
        if(h == rev(m))
        {
            pf("%02d:%02d\n" , h , m);
            return 0;
        }
    }
    return 0;
}

int rev(int n)
{
    int ret = n % 10;
    n = n / 10;
    ret = (ret * 10) + n;
}


//created by mad_o
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265359
#define BIGN 1000000007
#define endl "\n"
#define CIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define ff first
#define ss second
#define sz(x) ((int)((x).size()))
#define all(x) ((x).begin()),((x).end())
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define forn(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)

#define ll long long
#define ull unsigned long long
#define pqueue priority_queue

ull bign = 1000000007;
ull dp[100000000];

ull poww(ull n){
	if(n<100000000 && dp[n]!=-1)return dp[n];
	if(n==1)return dp[n]=2;
	if(n%2==0)return dp[n]=((poww(n/2)%bign)*(poww(n/2)%bign))%bign;
	return dp[n]=(2*(poww(n/2)%bign)*(poww(n/2)%bign))%bign;
}

int main(){

ull n , m  , ans , ans2 , i , res = 1;
memset(dp,-1,sizeof(dp));
cin>>n >> m;

poww(max(n,m));

ans = poww(n);
ans = (ans%bign - 1 + bign )%bign;
ans2 = poww(m);
ans2 = (ans2%bign - 1 + bign )%bign;
res = ((ans%bign)*(ans2%bign))%bign;
cout<<res<<endl;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>

using namespace std;

int main()
{
	int grid[3][3] = {0};
	int status[3][3] = {0};
	int update[3][3] = {0};
	for(int i = 0; i < 3; i++)
	{
		for( int j = 0; j<3; j++)
		{
			cin >> grid[i][j];
		}
	}

	for( int i = 0; i < 3; i++)
	{
		for(int j =0; i < 3; j++)
		{
			status[i][j] == grid[i][j-1] + grid[i][j] + grid[i][j+1] + grid[i+1][j] + grid[i-1][j];
		}
	}

	for( int i = 0; i<3; i++)
	{
		for(int j = 0; j < 3; j++)
		{
			if( (status[i][j])% 2 == 0)
			{
				update[i][j] == 0;
			}

			else if( status[i][j] % 2 != 0)
			{
				update[i][j] == 1;

			}
		}
	}
}


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

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef double db;
typedef vector<int> VI;
typedef pair<int,int> PII;
typedef pair<long long,int> PLI;
mt19937 mrand(random_device{}());
const ll mod=998244353;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}

#define Abs(x) ((x)>0?(x):-(x))
ll f[200006],ff[200006];

int n,k;
ll g(int k)
{
	ll ret=0;
	for(int i=k+1;k<=n;k++)
	{
		ll tmp=f[n-i]*ff[i]%mod*f(n-i]%mod;
		ret=(ret+tmp)%mod;
	}return ret;
}

int main()
{
	f[0]=f[1]=1;

	scanf("%d%d",&n,&k);
	for(int i=2;i<=n;i++)f[i]=f[i-1]*i%mod;
	ff[0]=1;
	for(int i=1;i<=n;i++)
		ff[i]=ff[i-1]*(n-i+1)%mod*powmod(i,mod-2);
	ll ans=1;
	if(k>=n)
	{
		puts("0");
		return 0;
	}
	if(k==0)
	{
		for(int i=1;i<=n;i++)ans=ans*n%mod;
		printf("%lld\n",ans);
		return 0;
	}
	if(k==n-1)
	{
		printf("%d\n",2*n);
		return 0;
	}
	printf("%lld\n",g(k)-g(k-1));
	return 0;
}


include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m);i<(n);i++)
#define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i)
#define test(x) cout << #x << ' ' << x << endl;
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define pii pair<int,int>

int find (lli k) {
	int a = 0;
	while (k > 1) {
		k >>= 1;
		a++;
	}
	return a;
}

int main () {
	lli n,k;
	cin >> n >> k;
	lli aa = n - k, sum;
	if (__builtin_popcountll(k+1) == 1) {
		sum = aa / (k + 1);
		sum *= 2;
		if (aa % (k + 1)) sum += 2;
		else sum++;
	} else {
		aa--;
		if (aa < 0) {
			sum = 1;
		} else {
			sum = aa / (1ll << find(k));
			sum++;
			sum *= 2;
		}
	}
	cout << sum << endl;
}


//be name khoda//

#include <bits/stdc++.h>
#define ll long long
#define li long int
#define ld long double
#define mp make_pair
#define pb push_back

using namespace std;
int main(){
    //ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	string s;
	cin>>s;
	if (s.size()<2){
		return cout<<0,-1;
	}
	ll t(0),f(0);
	for (int i=0;i<(s.size()-1);i++){
		if (s[i]=='K')
			continue;
		if (s[i+1]=='K')
			t++;
	}
	for (int i=0;i<(s.size()-2);i++){
		if (s[i]=='V' and s[i+1]=='V' and s[i+2]=='V')
			f=1;
	}
	if (s[s.size()-2]=='V' and s[s.size()-1]=='V')
		f=1;
	cout<<t+f;
    return(0);
}


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

int main()
{
    int n,a,x,b,y,i=0;
    cin>>n>>a>>x>>b>>y;

    vector <int> v1,v2;

    v1.push_back(a);
    v2.push_back(b);

    while(v1[i]!=x||v2[i]!=y)
    {
        ++i;
        v1.push_back((a+i)%n==0?n:(a+i)%n);
        v2.push_back((b-i)%n==0?n:(b-i)%n);

    }

    string ans="NO";
    for(int j=0;j<=i;++j)
    {
        if (v1[j]==v2[j])
        {
            ans="YES";
            break;
        }
    }
    cout<<ans;

}


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

const int MOD = 1e9 + 9;
int n, m;

int main() {
	cin >> n >> m;
	long long ans = 1;
	long long p = 1;
	for(int i = 0; i < m; i++) {
		p*= 2;
		p %= MOD;
	i}
	for(int i = 0; i < n; i++) {
		p = (long long)(p - 1) % MOD;
		ans *= p;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[105],i,j,t[5],sum,mini=1000005,v1,v2;
set<int>s;
int main()
{
	for(i=0;i<5;i++)
	{
		cin>>t[i];
		a[t[i]]++;
		sum+=t[i];
		s.insert(t[i]);
	}
	sort(t,t+5);
	if(*max_element(a,a+105)<=1)
	{
		cout<<sum;
		return 0;
	}
	else
	{
		set<int>:: reverse_iterator it;
		for(it=s.rbegin(); it!=s.rend(); ++it)
		{
			i=*it;
			if(a[i]>=3)
			{
				mini=sum-(i*3);
				break;
			}
			else if(a[i]==2)
			{
				++it;
				j=*it;
				if(a[j]==2)
				{
					mini=sum-(i*2);
					break;
				}
				else if(a[j]>=3)
				{
					v1=sum-(i*2);
					v2=sum-(j*3);
					mini=min(v1,v2);
					break;
				}
			}
		}
	}
	cout<<mini;
}


#include<iostream>
using namespace std;
int main(){
long long int a,b,coun=0;
cin>>a>>b;
if(a>b){if(b%2!=0)cout<<b/2;
        else{cout<<b/2-1;}
else if(b>a) { if((a-b/2)>0)cout<<a-b/2;
          else{cout<<0;}
}else{cout<<a-b/2-1;}
}


#include <iostream>
#include <cstdio>

using namespace std;

int square(int n);
int main(void)
{
    int n;
    while(scanf("%d",&n))
    {

        cout<<square(n-2)<<endl;
    }
}
int square(int n)
{
  int answer = n;
   for (int i=1; i<n; i++)
       answer=answer+n;

   return answer;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <complex>
#include <cmath>
#define rep(i,n) for(int i=0; i<n; ++i)
#define mp make_pair
#define p pair<int,int>
using namespace std;
int gcd(int a, int b) {
	if (a < b) swap(a, b);
	if (!b) return a;
	return gcd(b, a%b);
}
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int a1, b1, c1, a2, b2, c2;
	cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
	if (!a1 && !a2) {
		if (!b1 && !b2 && c1 == c2) cout << -1;
		else if (!b1 && !b2) cout << 0;
		else cout << 1;
		return 0;
	}
	if (!b1 && !b2) {
		if (!a1 && !a2 && c1 == c2) cout << -1;
		else if (!a1 && !a2) cout << 0;
		else cout << 1;
		return 0;
	}
	int gcd1 = gcd(gcd(abs(a1), abs(b1)), abs(c1)),
		gcd2 = gcd(gcd(abs(a2), abs(b2)), abs(c2));
	a1 /= gcd1; b1 /= gcd1; c1 /= gcd1;
	a2 /= gcd2; b2 /= gcd2; c2 /= gcd2;
	if (a1 == a2 && b1 == b2 && c1 == c2) cout << -1;
	else if (a1*b2 == a2*b1) cout << 0;
	else cout << 1;
}

// Thu Nov 24 2016 19:40:33 GMT+0300 (MSK)


#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

using namespace std;

int main()
{
    int n, m, a, b;

    cin >> n >> m >> a >> b;

    if ((a % m == 1 && b == n) || (((a - 1) / m == (b - 1) / m)) || ((a - 1) % m == 0 && b % m == 0) && (a % m != 0))
    {
        cout << "1";
        return 0;
    }

    if ((a % m == 1 && b % m != 0) || (a % m != 1 && b % m == 0) || (a % m - 1 == b % m)
         || (b == n) || ((a - 1) / m + 1 == (b - 1) / m) || ((a - 1) % m == b % m))
    {
        cout << "2";
        return 0;
    }

    cout << 3;

    return 0;
}


#include <bits/stdc++.h>

#define PB push_back
#define SZ(c) ll((c).size())
#define ALL(c) (c).begin(), (c).end()
#define CONTAINS(c, x) ((c).find(x)!=(c).end())
#define REP(i, c) for(int i=0; i<c; i++)
#define foreach(it, c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++)
#define WAIT cout<<flush, system("PAUSE")
using namespace std;
typedef long long ll;
#define MAX  24
#define MAX2 (1<<MAX)

int N;
int A[MAX], B[MAX2], sz[MAX2], lo[MAX2];
bool t[MAX2], f[MAX2];
int T[MAX2], cnt;

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

    cin >> N;
    REP(I, N) cin>>A[I];
    sort(A, A+N, greater<int>());

    REP(I, N) B[1<<I]=A[I], t[1<<I]=(A[I]==1);
    REP(I, N) if (t[1<<I]) T[cnt++]= 1<<I;
    REP(msk, 1<<N) sz[msk]=__builtin_popcount(msk), lo[msk]=msk&(-msk);
    REP(msk, 1<<N){
        if (B[msk&(-msk)]==1){
            f[msk]=true;
            continue;
        }
        for(int I=0; !f[msk]&&I<cnt; I++){ int l = T[I];
            if ((msk&l)==l) f[msk] |= (t[l]&&  (t[msk^l] || f[msk^l])  );
        }
        if (sz[msk]==B[lo[msk]]) t[msk]|=f[msk^lo[msk]];
        if (t[msk]) T[cnt++]=msk;
    }
    if (t[(1<<N)-1]) cout<<"YES"<<endl;
    else             cout<<"NO" <<endl;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define pb push_back
using namespace std;
set<string> ss;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a[16], ans = 0;
    for(int i = 1; i <= 14; i++) cin >> a[i];
    for(int k = 1; k <= 14; k++)
    {
        if(a[k] > 0)
        {
            ll temp = a[k], sum = 0;
            if(id == 0) id++;
            ll b[16];
            for(int i = 1; i <= 14; i++) b[i] = a[i];
            b[k] = 0;
            int add = a[k]/14, re = a[k] % 14, id = (k + 1) % 15;
            if(id == 0) id = 1;
            for(int i = 1; i <= 14; i++) b[i] += add;
            while(re)
            {
                b[id]++;
                id = (id + 1) % 15;
                if(id == 0) id == 1;
                re--;
            }
            for(int i = 1; i <= 14; i++) if(b[i] % 2 ==0) sum += b[i];
            ans = max(sum, ans);
        }
    }
    cout << ans;
}


#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <bitset>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <sys/time.h>
using namespace std;
#define li        long long int
#define rep(i,to) for(li i=0;i<((li)(to));++i)
#define pb        push_back
#define sz(v)     ((li)(v).size())
#define bit(n)    (1ll<<(li)(n))
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define MP        make_pair
#define F         first
#define S         second

#define kill exit
void print_second(){
	cout<<"SECOND"<<endl;
	kill(0);
}
void print_draw(){
	cout<<"DRAW"<<endl;
	kill(0);
}
void print_first(li num){
	cout<<"FIRST"<<endl;
	cout<<num<<endl;
	kill(0);
}
int main(){
	li x0,x1,a,b;
	cin>>x0>>x1>>a>>b;
	bool flag=false;
	if(x1<x0){
		flag=true;
		swap(x0,x1);
		swap(a,b);
		a=-a;
		b=-b;
	}
	li dis=x1-x0;
	if(b<a) while(true);
	if(dis<0) while(true);
	if(flag) while(true);
	if(a<=dis && dis<=b) print_first(dis);
	if(a<=0) print_draw();
	dis%=(a+b);
	if(flag) kill(1);
	if(dis<0) while(true);
	if(dis==0) print_second();
	if(dis<a) print_draw();
	if(dis<=b) print_first(dis);
	print_draw();
}

/*
#define MAX 100005
li dp[MAX];
int main(){
	li a=6,b=12;
	dp[0]=-1;
	rep(i,MAX)if(i){
		dp[i]=-1;
		for(li j=a;j<=b;j++){
			li pos=i-j;
			if(pos<0) dp[i]=max(dp[i],0ll);
			else dp[i]=max(dp[i],-dp[pos]);
		}
	}
	rep(i,100) cout<<dp[i]<<" "<<dp[18000+i]<<endl;
}
*/


#include <stdio.h>

int main(void)

{

     int n, min, s=0,s1=0;
     scanf("%d", &n);

     int a[n];

     for (i=0; i<n;i++)
     {
         scanf("%d", &a[i]);

         if(a[i]<0)
         {
                b[i]=a[i];
                s1 = s1+b[i];

         }
         else  s= s+a[i];
     }
     printf("%d", s-s1);

     return 0;

}


#define _CRT_SECURE_NO_WARNINGS
#define _ puts("");
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <queue>
using namespace std; void files_please(); typedef long long ll; typedef unsigned long long ull; typedef unsigned int ui; inline void out(double); inline void out(char); inline void out(char *); inline void out(ll); inline void out(int); inline void out(int, int); inline void out(int, int, int); inline void out(int, int, int, int); template<typename T> void out(T*, int, char = ' '); inline void in(char c); inline void in(char * s); inline void in(int&); inline void in(int&, int&); inline void in(int&, int&, int&); inline void in(int&, int&, int&, int&); template<typename T> void in(T*, int);

ll all[10111];
ll good[10111];
const ll MOD = (ll)1e9 + 7;

void solve() {
    all[0] = good[1] = 1;
    int n;
    in(n);
    for (int i = 1; i <= n; ++i) {
        all[i] = (all[i - 1] * (ll)27) % MOD;
        good[i] = (all[i - 1] * (ll)20) % MOD;
        good[i] = (good[i] + good[i - 1] * 7) % MOD;
    }
    out(good[n]);
}

int main() {
    files_please();
    solve(); _
}

inline void in(char c)
{
    scanf(" %c", &c);
}
inline void in(char * s)
{
    scanf(" %s", s);
}
inline void in(int &a)
{
    scanf("%d", &a);
}
inline void in(int &a, int &b)
{
    scanf("%d%d", &a, &b);
}
inline void in(int &a, int &b, int &c)
{
    scanf("%d%d%d", &a, &b, &c);
}
inline void in(int &a, int &b, int &c, int &d)
{
    scanf("%d%d%d%d", &a, &b, &c, &d);
}
template<typename T>
inline void in(T * arr, int n)
{
    for (int i = 0; i < n; ++i)
        in(arr[i]);
}

inline void out(double d)
{
    printf("%.15lf", d);
}
inline void out(char c)
{
    printf("%c", c);
}
inline void out(char * s)
{
    printf("%s", s);
}
inline void out(long long a)
{
    printf("%lld", a);
}
inline void out(int a)
{
    printf("%d", a);
}
inline void out(int a, int b)
{
    printf("%d %d", a, b);
}
inline void out(int a, int b, int c)
{
    printf("%d %d %d", a, b, c);
}
inline void out(int a, int b, int c, int d)
{
    printf("%d %d %d %d", a, b, c, d);
}
template<typename T>
void out(T * arr, int n, char sep)
{
    for (int i = 0; i < n; ++i)
    {
        out(arr[i]);
        out(sep);
    }
}

void files_please()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif // ONLINE_JUDGE
}


#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>

using namespace std;

const int NMAX = 100010, MOD = 1e9+7;
int m;
int f[NMAX];
vector<int> fact[NMAX];

int gcd(int x, int y){
	if(y) return gcd(y, x % y);
	return x;
}

int Power(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;
}

int inv(int x){
	return Power(x, MOD - 2);
}

int calc(int a, int b){//gcd(x, a) = b -- count the number of x in [1..m]
	int prime[10], cnt = 0;
	int tmpa = a / b;
	for(int i = 2; i <= tmpa; i++){
		if(tmpa % i == 0)
			prime[cnt++] = i;
		while(tmpa % i == 0)
			tmpa /= i;
	}
	int sum = 0;
	for(int i = 0; i < (1 << cnt); i++){
		int mult = 1, sign = 1;
		for(int j = 0; j < cnt; j++){
			if(i & (1 << j)){
				mult *= prime[j];
				sign *= -1;
			}
		}
		sum += (m / b) / mult * sign;
	}
	return sum;
}

int main(){
	scanf("%d", &m);
	for(int i = 1; i <= m; i++){
		for(int j = i * 2; j <= m; j++){
			fact[j].push_back(i);
		}
	}
	f[1] = 1;
	for(int i = 2; i <= m; i++){
		int sum = 0;
		for(int j : fact[i]){
			if(i % j == 0){
				sum = (sum + 1LL * f[j] * calc(i, j) % MOD * inv(m) % MOD) % MOD;
				//printf("gcd(x, %d) = %d cnt: %d\n", i, j, calc(i, j));
			}
		}
		//printf("gcd(x, %d) = %d cnt: %d\n", i, i, calc(i, i));
		f[i] = 1LL * (1 + sum) * (1LL * m * inv(m - calc(i, i)) % MOD) % MOD;
	}
	int sum = 0;
	for(int i = 1; i <= m; i++)
		sum = (sum + 1LL * f[i] * inv(m) % MOD) % MOD;
	printf("%d\n", sum);
	return 0;
}


#include<cstdio>
#include<cctype>
#include<algorithm>
using namespace std;
struct node {
    int l,r,v;
}q[10001];
int a[20001],fa[20001],d[20001],n,m;

inline void read(int &f) {
    f=0;char c=getchar();int ag=1;
    while(!isdigit(c)) {if (c=='-') ag=-1; c=getchar();}
    while(isdigit(c)){f=(f<<3)+(f<<1)+c-48;c=getchar();}
    f*=ag; return;
}
void write(int x) {
    if (x<0) putchar('-'),x*=-1;
    if (x>9) write(x/10);putchar(x%10+48);return;
}

inline void read_init() {
    int t=0; read(n);read(m);
    for (int i=1;i<=m;i++) {
        char c[5];
        read(q[i].l); read(q[i].r);
        scanf("%s",c);
        q[i].v=c[0]=='o'?1:0;
        a[++t]=q[i].l-1;
        a[++t]=q[i].r;
    }
    sort(a+1,a+t+1);
    n=unique(a+1,a+t+1)-a-1;
    return;
}
int find(int x) {
    if (x==fa[x]) return x;
    int root=find(fa[x]); d[x]^=d[fa[x]];
    return fa[x]=root;
}
int main() {
    read_init();
    for (int i=1;i<=n;i++) fa[i]=i;
    for (int i=1;i<=m;i++) {
        int x=lower_bound(a+1,a+n+1,q[i].l-1)-a;
        int y=lower_bound(a+1,a+n+1,q[i].r)-a;
        int P=find(x),Q=find(y);
        if (P==Q)
            if ((d[x]^d[y])!=q[i].v) {
                write(i-1); return 0;
            }
        fa[P]=Q; d[P]=d[x]^d[y]^q[i].v;
    }
    write(m); return 0;
}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{

	int array[25];
	int position = 0;
	int counter = 0;

	for (int i = 0; i < 25; i++){

		cin >> array[i];

		if (array[i] == 1){

			position = i;

		}

	}

	while (position != 12){

		if (position < 12){

			if (abs(12 - position)>2){

				position = position + 5;
				counter++;

			}

			else{

				counter = counter + abs(12 - position);

			}

		}
		else

		{

			if (abs(12 - position) > 2){

				position = position - 5;
				counter++;

			}

			else{

				counter = counter + abs(12 - position);

			}

		}

	}

	cout << counter << "\n";

}


//    o   O
//       |
//    _____

#include <iostream>

using namespace std;

long long n, a, b, c;

int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	cin >> n >> a >> b >> c;
	if( n < min(a, b)) cout << 0;
	else if (a <= b - c) cout << n / a;
	else{
		long long ans = 1 + (n - b) / (b - c);
		n -= (1 + (n - b) / (b - c)) * (b - c);
		ans += n / a; cout << ans;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{long long int i,a,x=0,b,sum1=0,sum2=0;
vector<long long int> v1;
vector<long long int> v2;
cin >> a >> b;
{
 while(a/10!=0)
  {if(a%10==0)
   x++;
   else
   v1.push_back(a%10);
  }
  a=a/10;
}
{
 while(b/10!=0)
  {if(b%10==0)
   x++;
   else
   v2.push_back(b%10);
  }
  b=b/10;
}
for(i=0;i<v1.size();i++)
{sum1=sum1+v1[i];
}

for(i=0;i<v2.size();i++)
{sum2=sum2+v2[i];
}

if(sum1+sum2==a+b)
cout << "YES";
if((sum1+sum2)!=0)
cout << "NO";
}