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

int main()
{
    ll n, x;
    cin >> n >> x;
    vector<ll> v(n);
    vector<ll> p(n);
    rep(i, n) cin >> v.at(i) >> p.at(i);

    ll ans = -1;
    x *= 100;
    ll sum = 0;
    rep(i, n)
    {
        sum += v.at(i) * p.at(i);
        if (sum > x)
        {
            ans = i + 1;
            break;
        }
    }

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

//#pragma GCC optimize(2)
#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<map>
#include<cmath>
#include<cctype>
#include<vector>
#include<set>
#include<queue>
#include<algorithm>
#include<sstream>
#include<ctime>
#include<cstdlib>
#define X first
#define Y second
#define L (u<<1)
#define R (u<<1|1)
#define pb push_back
#define mk make_pair
#define Mid (tr[u].l+tr[u].r>>1)
#define Len(u) (tr[u].r-tr[u].l+1)
#define random(a,b) ((a)+rand()%((b)-(a)+1))
#define db puts("---")
using namespace std;

//void rd_cre() { freopen("d://dp//data.txt","w",stdout); srand(time(NULL)); }
//void rd_ac() { freopen("d://dp//data.txt","r",stdin); freopen("d://dp//AC.txt","w",stdout); }
//void rd_wa() { freopen("d://dp//data.txt","r",stdin); freopen("d://dp//WA.txt","w",stdout); }

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> PII;

const int N=1000010,mod=1e9+7,INF=0x3f3f3f3f;
const double eps=1e-8;

int n;
double x,sum;

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

	cin>>n>>x;
	bool f=false;
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		int v,p; scanf("%d%d",&v,&p);
		sum+=v*1.0*p/100;
		if(sum-x>eps&&!f) f=1,ans=i;
	}
	if(f) printf("%d\n",ans);
	else printf("-1\n");

	return 0;
}
/*

*/


#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

int main()
{
	boost;
	ll n, i;
	cin >> n;

	auto get = [] (ll a, ll b) {
		return (a * b) / (__gcd(a, b));
	};

	ll ans = 1;
	foe(i, 2, n)
	ans = get(ans, i);
	cout << ans + 1;
}

/*
Credit_Card_CRD
*/
#include <iostream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <set>
#include <map>
#include <utility>
#include <queue>
#include <vector>
#include <stack>
#include <sstream>
#include <algorithm>
#include <fstream>
#include <functional>
#include <string.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define m_p make_pair
#define pb push_back
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define MOD 1000000007
#define imax 2147483647
#define llmax 9223372036854775807
typedef long long ll;

using namespace std;

long long read()
{
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9')
	{
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}

string i_to_s(int x)
{
	string t="";
	while(x)
	{
		t+=x%10+'0';
		x/=10;
	}
	reverse(all(t));
	return t;
}

int s_to_i(string t)
{
	int x=0;
	rep(i,sz(t))
	{
		x=x*10+(t[i]-'0');
	}
	return x;
}

string s;
int a[20];

int main()
{
	cin>>s;
	if(sz(s)<4){
		sort(all(s));
		do{
			int now=s_to_i(s);
			if(now%8==0){
				cout<<"Yes"<<endl;
				return 0;
			}
		}
		while(next_permutation(s.begin(),s.end()));
		cout<<"No"<<endl;
		return 0;
	}
	rep(i,sz(s))
	a[(int)(s[i]-'0')]++;
	int now=0;
	while(now<1000){
		now+=8;
		if(now>=1000)
		break;
		int a1=now/100,a2=now/10%10,a3=now%10;
		a[a1]--;
		if(a[a1]<0){
			a[a1]++;
			continue;
		}
		a[a2]--;
		if(a[a2]<0){
			a[a1]++;
			a[a2]++;
			continue;
		}
		a[a3]--;
		if(a[a3]<0){
			a[a1]++;
			a[a2]++;
			a[a3]++;
			continue;
		}
		cout<<"Yes"<<endl;
		return 0;
	}
	cout<<"No"<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
#define FOR(i, a, b) for(ll i=(a); i < (ll)(b); ++i)
template<class T> inline bool chmax(T& a, T b) { if(a < b){ a=b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if(a > b){ a=b; return 1; } return 0;}

int main(){
	int n;
	cin >> n;
	vector<vector<ll>> c(n,vector<ll>(n));
	vector<ll> a(n), b(n);
	REP(i,n) REP(j,n) cin >> c[i][j];

	if(n==1){
		cout << "Yes\n";
		cout << c[0][0] << "\n0\n";
		return 0;
	}

	ll amin=0,bmin=0;
	a[0]=0;
	FOR(i,1,n){
		ll diff = c[i][0] - c[0][0];

		FOR(j,1,n){
			if(diff != c[i][j] - c[0][j]){
				cout << "No\n";
				return 0;
			}
		}

		a[i] = diff;
		chmin(amin, a[i]);
	}
	b[0]=0;
	FOR(j,1,n){
		ll diff = c[0][j] - c[0][0];

		FOR(i,1,n){
			if(diff != c[i][j] - c[i][0]){
				cout << "No\n";
				return 0;
			}
		}

		b[j] = diff;
		chmin(bmin, b[j]);
	}

	if(amin == 0 && bmin == 0){
		REP(j,n){
			b[j]+=c[0][0];
		}
	}else if(amin > bmin){
		if(-1*bmin > c[0][0]){
			cout << "No\n";
			return 0;
		}
		REP(j,n) b[j] -= bmin;

		REP(i,n) a[i] = c[i][0] - b[0];
	}else{
		if(-1*amin > c[0][0]){
			cout << "No\n";
			return 0;
		}
		REP(i,n) a[i] -= amin;

		REP(j,n) b[j] = c[0][j] - a[0];
	}

	cout << "Yes\n";
	REP(i,n){
		if(i!=0) cout << " ";
		cout << a[i];
	}
	cout << "\n";
	REP(i,n){
		if(i!=0) cout << " ";
		cout << b[i];
	}
	cout << "\n";

	return 0;
}

//#undef DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll llinf = (1ll<<61)-1;
#define sz(a) int(a.size())
#define all(x) begin(x), end(x)
#ifdef DEBUG
const int DEBUG_END = 26;
#define DOS cout
#include <debug.h>
#else
#define bug(args...) void()
#define cbug(a, args...)
#endif
#define ASSERT(a, o, b, args...) if (!((a)o(b))) bug(a, b, ##args), assert((a)o(b));
#define fi first
#define se second
int TC = 1, CN;
const int inf = 998244353;
template<class C, class D> bool operator ==(const C &ls, const D &rs) { return !(ls<rs or rs<ls); }//{
template<class C, class D> bool operator !=(const C &ls, const D &rs) { return !(rs==ls); }
template<class C, class D> bool operator >(const C &ls, const D &rs) { return rs<ls; }
template<class C, class D> bool operator <=(const C &ls, const D &rs) { return !(rs<ls); }
template<class C, class D> bool operator >=(const C &ls, const D &rs) { return !(ls<rs); }
// += can't be made generic as x+=y is not the same as x=x+y when x is string
template<class C, class D> C& operator -=(C &x, const D &y) { return x = x-y; }
template<class C, class D> C& operator *=(C &x, const D &y) { return x = x*y; }
#include <ext/numeric>
using __gnu_cxx::power;
template<int mod> struct mint// Make sure to not do any operation with int outside [-mod, 2*mod), *1 to mod forcefully), use << instead of 2*
{
    int x;
    mint() = default;
    mint(const int &rs) : x(rs + (rs>=0 ? 0 : mod) - (rs<mod ? 0 : mod)) {};
    mint operator -() { return -x; }
    // mint operator ~() = delete;  // when mod is not surely prime
    mint operator ~() { ASSERT(x, !=, 0, "modinverse 0 is undefined"); return power(*this, mod-2); }
    mint operator +(const mint &rs) const { return x+rs.x; }
    mint& operator +=(const mint &rs) { return *this = *this + rs; }
    mint operator -(const mint &rs) const { return x-rs.x; }
    mint operator *(const mint &rs) const { return int(x*ll(rs.x)%mod); }
    mint operator <<(const int &rs) { return rs==1 ? *this+*this : *this*mint{1<<rs}; }
    mint& operator <<=(const int &rs) { return *this = *this<<rs; }
    mint& operator >>=(const int &rs) { return x>>=rs, *this; }  // only for power()
    mint& operator ++() { return *this += 1; }
    mint& operator --() { return *this -= 1; }
    mint operator ++(int) { mint ret = x; ++*this; return ret; }
    mint operator --(int) { mint ret = x; --*this; return ret; }
    friend istream& operator >>(istream &is, mint &rs) { return is>>rs.x; }
    friend ostream& operator <<(ostream &os, const mint &rs) { return os<<rs.x; }
    friend mint operator +(const mint &ls, const int &rs) { return ls+mint(rs); }
    friend mint operator +(const int &ls, const mint &rs) { return mint(ls)+rs; }
    friend mint operator -(const mint &ls, const int &rs) { return ls-mint(rs); }
    friend mint operator -(const int &ls, const mint &rs) { return mint(ls)-rs; }
    friend mint operator *(const mint &ls, const int &rs) { return ls*mint(rs); }
    friend mint operator *(const int &ls, const mint &rs) { return mint(ls)*rs; }
    bool operator <(const mint &rs) const { return x<rs.x; }
    friend bool operator <(const int &ls, const mint &rs) { return ls<rs.x; }
    friend bool operator <(const mint &ls, const int &rs) { return ls.x<rs; }
};
using Int=mint<inf>;
Int operator""_i(unsigned long long x) { return {int(x)}; }//}
const int N = 200005;
int n, m, k;

signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(11), cout.setf(ios::fixed);
    //cin >> TC;// inputAll + resetAll -> solution
    auto kase = [&]()->void {
        cin >> n >> m >> k;
        Int ans = 0;
        if (n == 1) ans = power(Int(k), m);
        else if (m == 1) ans = power(Int(k), n);
        else {
            for (int i = 1; i <= k; i++) {
                ans += (power(Int(i), n)-(i == 1 ? 0 : power(Int(i-1), n)))*power(Int(k-i+1), m);
            }
        }
        cout << ans << '\n';
    };
    while (CN++!=TC) kase();
}


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

#define rep(i,n) for(int i = 0; i < n; i++)
#define Rep(i,n) for(int i = 1; i <= n; i++)
#define sz(x) int(x.size())
#define All(v) v.begin(), v.end()
#define rAll(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using ld = long double;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
template<class T> using V = vector<T>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
struct INF { template<class T> operator T() { return numeric_limits<T>::max() / 2; } } INF;
const ld eps = 1e-11;
int sgn(const ld &r) {return (r > eps) - (r < eps);}

const ll mod = 998244353;

int main(){

    ll a, b, c;
    cin >> a >> b >> c;
    a = ((a+1)*a/2) % mod;
    b = ((b+1)*b/2) % mod;
    c = ((c+1)*c/2) % mod;
    ll ans = a * b % mod * c % mod;
    cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll a,b,c;
  cin>>a>>b>>c;
  ll ans,m=998244353;
  ll x=(a*(a+1)/2);
  ll y=(b*(b+1)/2);
  ll z=(c*(c+1)/2);
  ll d=((x%m)*(y%m))%m;
  ll e=((d%m)*(z%m))%m;

  cout<<e;
  //951633476

}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
int main(){
    ll k,n,m;
    cin >> k >> n >> m;
    vector<ll> a(k);
    vector<ll> b(k);
    for(int i = 0;i < k;i++){
        cin >> a[i];
    }
    for(int i = 0;i < k;i++){
        b[i] = (m * a[i]) / n;
    }
    int sum_of_b = 0;
    for(int i = 0;i < k;i++){
        sum_of_b += b[i];
    }
    vector<pair<ll,int>> potential(k);
    for(int i = 0;i < k;i++){
        potential[i].first = abs(n * (b[i] + 1) - m * a[i]) - abs(n * b[i] - m * a[i]);
        potential[i].second = i;
    }
    sort(potential.begin(),potential.end(),[](pair<ll,int> a,pair<ll,int> b){return a.first < b.first;});
    for(int i = 0;i < m - sum_of_b;i++){
        b[potential[i].second] ++;
    }
    for(int i = 0;i < k;i++){
         cout << b[i] << ' ';
    }
    cout << endl;

    return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
//#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define ll long long
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int K;
  ll N,M,count=0;
  cin>>K>>N>>M;
  vector<ll> A(K+10);
  vector<ll> C(K+10);
  vector<ll> D(K+10);
  vector<ll> E(K+10);
  for(int i=0;i<K;i++){
    int X;
    cin>>X;
    A[i]=M*X;
    C[i]=A[i]/N*N;
    count+=C[i]/N;
  }
  count=M-count;
  for(int i=0;i<K;i++){
    D[i]=abs(A[i]-C[i]);
    E[i]=D[i];
  }
  sort(D);
  reverse(D);
  for(int j=0;j<count;j++){
    for(int i=0;i<K;i++){
      if(D[j]==E[i]){
        C[i]+=N;
        E[i]=abs(E[i]-N);
        break;
      }
    }
  }
  for(int i=0;i<K;i++){
    cout<<C[i]/N<<" ";
  }
return 0;}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define rsort(a) {sort(all(a));reverse(all(a));}
#define pb emplace_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),(k))-v.begin())
#define ub(v,k) (upper_bound(all(v),(k))-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
#define dupli(a) {sort(all(a));a.erase(unique(all(a)),a.end());}
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
typedef multiset<ll> S;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vvvvi=vector<vvvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001001;
const ll INF=1001001001;
const ll mod=998244353;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
void outs(ll a,ll b){if(a>=inf-100)out(b);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){ll res=1;a%=mod;while(b){if(b&1)res=res*a%mod;a=a*a%mod;b>>=1;}return res;}
class UF{
public:
    vi data;stack<P> st;
    UF(ll n){
        data=vi(n,1);
    }
    bool heigou(ll x,ll y,bool undo=false){
        x=root(x);y=root(y);
        if(data[x]>data[y])swap(x,y);
        if(undo){st.emplace(y,data[y]);st.emplace(x,data[x]);}
        if(x==y)return false;
        data[y]+=data[x];data[x]=-y;
        return true;
    }
    ll root(ll i){if(data[i]>0)return i;return root(-data[i]);}
    ll getsize(ll i){return data[root(i)];}
    bool same(ll a,ll b){return root(a)==root(b);}
    void undo(){rep(i,2){data[st.top().fi]=st.top().se;st.pop();}}
};
int main(){
    ll n,m;cin>>n>>m;
    vector<string> v(n);
    rep(i,n)cin>>v[i];
    UF uf(n+m);
    rep(i,n)rep(j,m)if(v[i][j]=='#')uf.heigou(i,j+n);
    rep(i,2)rep(j,2)uf.heigou(i*(n-1),n+j*(m-1));
    // outv(uf.data);
    vi a,b;
    rep(i,n)a.pb(uf.root(i));
    rep(i,m)b.pb(uf.root(i+n));
    dupli(a);dupli(b);
    out(min(a.size(),b.size())-1);
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3e5+500;

int gti(void)
{
	char c=getchar();
	int ret=0,st=1;
	for (;!isdigit(c)&&c!='-';c=getchar());
	if (c=='-') st=-1,c=getchar();
	for (;isdigit(c);c=getchar()) ret=ret*10+c-'0';
	return ret*st;
}

int cnt[N];
int main(void)
{
	int n=gti(),k=gti();
	for (int i=1;i<=n;i++)
		++cnt[gti()];
	int now=n;
	ll ans=0;
	for (int i=0;i<=n;i++)
	{
		now=min(now,cnt[i]);
		ans+=min(now,k);
	}
	printf("%lld\n",ans);
	return 0;
}


#include<set>
#include<ctime>
#include<cstdio>
#include<cctype>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=1e4+7;
int read(){
	char c;
	int x=0,f=1;
	while(!isdigit(c=getchar()))
		f-=2*(c=='-');
	while(isdigit(c)){
		x=x*10+f*(c-48);
		c=getchar();
	}
	return x;
}
struct que{
	int p,i,r;
	que(int a=0,int b=0,int c=0){
		p=a;
		i=b;
		r=c;
	}
	friend bool operator <(que a,que b){
		return a.p<b.p;
	}
};
struct sol{
	int a,b,c,d;
	sol(int A=0,int B=0,int C=0,int D=0){
		a=A;
		b=B;
		c=C;
		d=D;
	}
};
int c[N];
bool vis[N];
int n,x,y,r,k,tot;
vector<que>l[N];
sol ans[N];
int abs(int x){
	return x>0?x:-x;
}
int random(int l,int r){
	return rand()%(r-l+1)+l;
}
int calc(int a,int b,int c,int d,int r){
	return abs((b-a)*(d-c)-r);
}
int main(){
	#ifndef ONLINE_JUDGE
	freopen("0014.txt","r",stdin);
	freopen("A.out","w",stdout);
	#endif
	clock_t t1=clock();
	//--------
	n=read();
	srand(210280344);
	for(int i=1;i<=n;++i){
		x=read();
		y=read();
		r=read();
		l[x].push_back(que(y,i,r));
		vis[x]=1;
	}
	for(int i=0;i<N-7;++i){
		if(vis[i]){
			++tot;
			c[tot]=i;
			sort(l[i].begin(),l[i].end());
		}
	}
	c[tot+1]=N-7;
	for(int i=1;i<=tot;++i){
		int A;
		int B;
		int C;
		int D;
		int sz=l[c[i]].size();
		if(i==1)
			A=random(0,c[i]);
		else
			A=random(c[i-1],c[i]);
		C=random(c[i]+1,c[i+1]);
		B=random(0,l[c[i]][0].p);
		if(sz==1){
			k=1e9;
			r=l[c[i]][0].r;
			for(int ii=1;ii<N;++ii){
				int t=random(l[c[i]][0].p+1,N-7);
				int s=calc(A,B,C,t,r);
				if(k>s){
					k=s;
					D=t;
				}
			}
			ans[l[c[i]][0].i]=sol(A,B,C,D);
			c[i]=C;
			continue;
		}
		k=1e9;
		r=l[c[i]][0].r;
		for(int ii=1;ii<N;++ii){
			int t=random(l[c[i]][0].p+1,l[c[i]][1].p);
			int s=calc(A,B,C,t,r);
			if(k>s){
				k=s;
				D=t;
			}
		}
		l[c[i]][0].p=D;
		ans[l[c[i]][0].i]=sol(A,B,C,D);
		for(int j=1;j<sz-1;++j){
			B=random(l[c[i]][j-1].p,l[c[i]][j].p);
			k=1e9;
			r=l[c[i]][j].r;
			for(int ii=1;ii<N;++ii){
				int t=random(l[c[i]][j].p+1,l[c[i]][j+1].p);
				int s=calc(A,B,C,t,r);
				if(k>s){
					k=s;
					D=t;
				}
			}
			l[c[i]][j].p=D;
			ans[l[c[i]][j].i]=sol(A,B,C,D);
		}
		B=random(l[c[i]][sz-2].p,l[c[i]][sz-1].p);
		k=1e9;
		r=l[c[i]][sz-1].r;
		for(int j=1;j<=N-7;++j){
			int t=random(l[c[i]][sz-1].p+1,N-7);
			int s=calc(A,B,C,t,r);
			if(k>s){
				k=s;
				D=t;
			}
		}
		ans[l[c[i]][sz-1].i]=sol(A,B,C,D);
		c[i]=C;
	}
	for(int i=1;i<=n;++i){
		int A=ans[i].a;
		int B=ans[i].b;
		int C=ans[i].c;
		int D=ans[i].d;
		printf("%d %d %d %d\n",A,B,C,D);
	}
	//--------
	fprintf(stderr,"%0.3lfs",1.0*(clock()-t1)/CLOCKS_PER_SEC);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

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

    ll n; cin >> n;
    ll a[2 * n]; char c[2 * n]; zep(i, 0, 2 * n)cin >> a[i] >> c[i];

    multiset<ll> s[3];
    zep(i, 0, 2 * n){
        s[c[i] % 3].insert(a[i]);
    }

    if(s[0].size() % 2 == 0 && s[1].size() % 2 == 0 && s[2].size() % 2 == 0){
        print(0) return 0;
    }
    // cout << 'R' % 3 << 'G' % 3 << 'B' % 3 << endl;
    ll v[3][3];
    zep(i, 0, 3)zep(j, 0, 3)v[i][j] = INF;
    zep(i, 0, 3){
        zep(j, 0, 3){
            for(auto it = s[i].begin(); it != s[i].end(); it++){
                ll x = *it;
                if(s[j].lower_bound(x) != s[j].end()){
                    ll y = *s[j].lower_bound(x);
                    v[i][j] = min(v[i][j], y - x);
                    v[j][i] = min(v[j][i], y - x);
                }
            }
        }
    }
    //zep(i, 0, 3){zep(j, 0, 3)cout << v[i][j] << " "; cout << endl;}

    zep(i, 0, 3){
        if(s[i].size() % 2 == 0){
            print(min(v[(i + 1) % 3][(i + 2) % 3], v[i][(i + 1) % 3] + v[i][(i + 2) % 3]))
            return 0;
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template <unsigned long long mod> class modint {
public:
	unsigned long long v;
	modint(const long long x = 0) : v(x % mod) {}
	modint operator+(const modint rhs) { return modint(*this) += rhs; }
	modint operator-(const modint rhs) { return modint(*this) -= rhs; }
	modint operator*(const modint rhs) { return modint(*this) *= rhs; }
	modint operator/(const modint rhs) { return modint(*this) /= rhs; }
	modint operator-() { return modint(mod - this->v); }
	modint& operator+=(const modint rhs) {
		v += rhs.v;
		if (v >= mod) v -= mod;
		return *this;
	}
	modint& operator-=(const modint rhs) {
		if (v < rhs.v) v += mod;
		v -= rhs.v;
		return *this;
	}
	modint& operator*=(const modint rhs) {
		v = v * rhs.v % mod;
		return *this;
	}
	modint inverse(modint a) {
		unsigned long long exp = mod - 2;
		modint ret(1ULL);
		while (exp) {
			if (exp % 2) {
				ret *= a;
			}
			a *= a;
			exp >>= 1;
		}
		return ret;
	}
	modint& operator/=(modint rhs) {
		(*this) *= inverse(rhs);
		return *this;
	}
	friend ostream& operator<<(ostream& os, modint& u) {
		os << u.v;
		return (os);
	}
	friend istream& operator>>(istream& is, modint& u) {
		is >> u.v;
		return (is);
	}
};

const int MOD = 1000000007;
using mint = modint<MOD>;

template <class T> T fastpow(T a, long long p) {
	T tmp = a;
	T ret = 1;
	while (p) {
		if (p & 1) ret *= tmp;
		p >>= 1;
		tmp = tmp * tmp;
	}
	return ret;
}

class Solution {
public:
	void solve() {
		int h, w;
		cin >> h >> w;
		vector<string> ss(h);
		for (int i = 0; i < h; i++) cin >> ss[i];
		vector<vector<int>> sx(h, vector<int>(w, 0));
		vector<vector<int>> sy(h, vector<int>(w, 0));
		int cv = 0;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (ss[i][j] == '.') {
					cv++;
					if (i != 0)
						sy[i][j] = sy[i - 1][j] + 1;
					else
						sy[i][j] = 1;
					if (j != 0)
						sx[i][j] = sx[i][j - 1] + 1;
					else
						sx[i][j] = 1;
				}
			}
		}
		for (int i = h - 1; i >= 0; i--) {
			for (int j = w - 1; j >= 0; j--) {
				if (ss[i][j] == '.') {
					if (i != h - 1 && ss[i + 1][j] == '.') sy[i][j] = sy[i + 1][j];
					if (j != w - 1 && ss[i][j + 1] == '.') sx[i][j] = sx[i][j + 1];
				}
			}
		}
		mint ans = fastpow(mint{2}, cv) * cv;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (ss[i][j] == '.') {
					ans -= fastpow(mint{2}, cv - sx[i][j] - sy[i][j] + 1);
				}
			}
		}
		cout << ans << "\n";

		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

//
//  main.cpp
//  Atcoder1
//
//  Created by Hamske on 2020/09/17.
//  Copyright © 2020 Author. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>

using namespace std;

//#define pb push_back
//#define mp make_pair
#define fi first
#define se second

typedef long long ll;

//#define rep(_i,iv,n) for(int _i=(int)(iv);_i<(int)(n);++_i)
#define rep0(_i,n) for(int _i=0;_i<(int)(n);++_i)
//#define REP(_i,iv,_l,n) for(int _i=(int)(iv),_l=(int)(n);_i<_l;++_i)
#define REP0(_i,_l,n) for(int _i=0,_l=(int)(n);_i<_l;++_i)

//#define all(x) (x).begin(),(x).end()
#define REPV(v,_itr,_end) for(auto _itr=(v).begin(),_end=(v).end();_itr!=_end;++_itr)
#define REPVC(v,_itr,_end) for(auto _itr=(v).cbegin(),_end=(v).cend();_itr!=_end;++_itr)

#define td typedef
//#define tds(stl,type,name) typedef stl<type > name;
#define tdv(type,name) typedef vector<type > name;

typedef vector<bool> vb;
typedef vector<vb > vvb;
typedef vector<int> vi;
typedef vector<vi > vvi;
typedef vector<ll> vll;
typedef vector<vll > vvll;

#define INF 1<<30

td pair<int, int > pii;
td priority_queue<pii,vector<pii>,greater<pii> > pq;

#define mod7 1000000007

long long modpow(long long a, long long n, long long mod) {//O(log2(n))
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(int argc, const char * argv[]) {
    int H,W;
    cin>>H>>W;
    vvb room(H,vb(W));
    int K=0;
    rep0(i, H){
        string str;
        cin>>str;
        rep0(j, W){
            room[i][j]=str[j]=='.';
            if(room[i][j]){
                ++K;
            }
        }
    }//4e6

    vvi rowCont(H,vi(W,0));
    rep0(i,H){
        rep0(j, W){
            if(room[i][j]){
                int count=0,j1=j;
                while(j1<W&&room[i][j1]){
                    ++count;
                    ++j1;
                }
                while(j<j1){
                    rowCont[i][j]=count;
                    ++j;
                }
            }
        }
    }

    vvi colCont(H,vi(W,0));
    rep0(j, W){
        rep0(i,H){
            if(room[i][j]){
                int count=0,i1=i;
                while(i1<H&&room[i1][j]){
                    ++count;
                    ++i1;
                }
                while(i<i1){
                    colCont[i][j]=count;
                    ++i;
                }
            }
        }
    }

    ll X=(modpow(2,K, mod7)*K)%mod7;

//    cout<<"x="<<X<<endl;
    rep0(i, H){//H*W*(4*H*W+log2(K-T))
        rep0(j, W){
            if(room[i][j]){
                int T=colCont[i][j]+rowCont[i][j]-1;
//                cout<<i<<","<<j<<":"<<T<<endl;
                X-=modpow(2, K-T, mod7);
                X%=mod7;
                if(X<0){
                    X+=mod7;
                }
            }
        }
    }

    cout<<X<<endl;

    return 0;
}


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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

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

    ll A,B;
    string S;
    cin >> A>>B;

    ll tmp = 2 * A + 100;
    cout << tmp - B << endl;

}

#include <iostream>
using namespace std;

int main() {
int A,B;
cin>>A>>B;
int x=(2*A+100)-B;
cout<<x;
	return 0;
}


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

#define ll long long
#define print(a)          \
    for (auto x : a)      \
        cout << x << " "; \
    cout << endl
#define print_upto(a, n)        \
    for (ll i = 1; i <= n; i++) \
        cout << a[i] << " ";    \
    cout << endl
#define take(a, n)              \
    for (ll i = 1; i <= n; i++) \
        cin >> a[i];

#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x, y) cout << (#x) << " is " << (x) << " and " << (#y) << " is " << (y) << "\n"
#define watch3(x, y, z) cout << (#x) << " is " << (x) << " and " << (#y) << " is " << (y) << " and " << (#z) << " is " << (z) << "\n"
#define watch4(x, y, z, u) cout << (#x) << " is " << (x) << " and " << (#y) << " is " << (y) << " and " << (#z) << " is " << (z) << " and " << (#u) << " is " << (u) << "\n"

void my_debugger(string s, int LINE_NUM)
{
    cerr << endl;
}
template <typename start, typename... end>
void my_debugger(string s, int LINE_NUM, start x, end... y)
{
    if (s.back() != ',')
    {
        s += ',';
        cerr << "LINE(" << LINE_NUM << "): ";
    }
    int i = s.find(',');
    cerr << s.substr(0, i) << " = " << x;
    s = s.substr(i + 1);
    if (!s.empty())
        cerr << ", ";
    my_debugger(s, LINE_NUM, y...);
}
#define debug(...) my_debugger(#__VA_ARGS__, __LINE__, __VA_ARGS__);

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define ff first
#define ss second
#define null NULL
#define all(c) (c).begin(), (c).end()
#define allr(c) (c).rbegin(), (c).rend()
#define nl "\n"

#define ld long double
#define eb emplace_back
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define MOD 1000000007
#define MOD2 998244353
#define set_bits(n) __builtin_popcountll(n)
#define inf 1e17
// cout << fixed << setprecision(15) << ans << nl;
// cout << "Case #" << Q << ": ";

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// auto dist = uniform_int_distribution<int>(l, r);
// ll random_val = dist(rng);

typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> ppll;

const ll N = 200009;
ll Q = 0;

void solve()
{
    ll a, b, c;
    cin >> a >> b >> c;

    if (a * a + b * b < c * c)
    {
        cout << "Yes" << nl;
    }
    else
    {
        cout << "No" << nl;
    }
}

int main()
{

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

    ll T = 1;
    // cin >> T;
    auto start1 = high_resolution_clock::now();

    while (T--)
    {
        Q++;
        solve();
    }

    auto stop1 = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop1 - start1);
    // cerr << "Time: " << duration.count() / 1000 << endl;
    return 0;
}

/*
      @author : ashnove
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define lld long double
#define F first
#define S second
#define Th third
// #define endl "\n"
#define nl cout << endl;
#define pb push_back
#define f(i, a, b) for (ll i = a; i < b; i++)
#define what_is(x) cerr << #x << " is " << x << endl;
#define ar vector<ll>
#define mat vector<vector<ll>>
mat cn(ll n, ll m) {return vector<vector<ll>>(n, vector<ll>(m));}
bool comp1(char &s1, char &s2) { return s1 > s2; }
bool comp2(const pair<ll, pair<ll, ll>> &a, const pair<ll, pair<ll, ll>> &b) {
      if (a.first > b.first)
            return 1;
      if (a.first == b.first && a.S.S > b.S.S)
            return 1;
      return 0;
}
class Pair { public: ll first, second;};
bool comp3(const Pair &a, const Pair &b) {
      if (a.F > b.F) return 1; return 0;
}
class Trips { public: ll first, second, third;};
bool comp4(const Trips &a, const Trips &b) {
      if (a.Th > b.Th) return 1; return 0;
}

ll const mod = 1e9 + 7;
ll const inf = 1e18;
ll const maxn = 5e5 + 1;

void solve()
{
      ll t = 1;
      // cin >> t;

      for (ll tt = 1; tt <= t; tt++) {

            ll a,b,c; cin >> a >> b >> c;

            cout << ( (a*a + b*b < c*c)?"Yes":"No");
      }
}

int main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(NULL); cout.tie(NULL);
      //*
#ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
#endif/**/
      solve();
      // cout << "Case #" <<tt<<": ";
      // printf("TIME: %.3lf\n", double(clock()) / CLOCKS_PER_SEC);
      return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int, int> >
#define vpll vector <pair <long long, long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define vb vector <bool>
#define vvb vector <vb>
#define mp make_pair
#define vvll vector <vll>
#define vsi vector <si>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MANX MAXN
#define itn int
#define dbg(x); {cout << #x << "=" << x << ", ";}
#define in(x); { for (auto &to : x) cin >> to;}
#define out(x); { for (auto &to : x) cout << to << " "; cout << '\n'; }

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const int mod1 = 1e9+7;
const int mod2 = 1e9+21;

void solve()
{
    vi a(3);
    in(a);
    sort(all(a));
    cout<<(a[1]-a[0]==a[2]-a[1]?"Yes\n":"No\n");
}

int main() {
    #ifdef Mip182
    freopen("a.in", "r", stdin);
    #else
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #endif
    int _t;
    _t=1;
//    cin>>_t;
    while (_t--)
        solve();
    #ifdef Mip182
    cout<<'\n'<<"Time : "<<(double)(clock())/CLOCKS_PER_SEC<<'\n';
    #endif
}

#include<bits/stdc++.h>
using namespace std;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) { cerr << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args&&... args) {
    const char *comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#define pi 3.14159265358979323846
#define MOD 1000000007
#define MOD1 998244353
#define to() int tt; cin>>tt; while(tt--)
#define pb push_back
#define in insert
#define mp make_pair
#define ff first
#define ss second
#define fori(it,v) for(it=v.begin();it!=v.end(); it++)
#define for1(i,low,high) for(int i=low;i<high;i++)
#define all(x) x.begin(), x.end()
#define fil(x,i) memset(x,i,sizeof(x));
#define setbits(x) __builtin_popcount(x)
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
void i_o() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin) ; freopen("output.txt", "w", stdout); //freopen("error.txt", "w", stderr);
#endif
}

int main()
{
	boost; i_o();
	vector<ll>v(3);
	for1(i,0,3) cin>>v[i];
	sort(all(v));
	if(v[0]+v[2]==2*v[1]) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

	return 0;
}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;

#define N 200100
#define MOD 1000000007  //998244353
#define ll long long
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rep2(i, a, b) for(int i = a; i <= b; ++i)
#define rep3(i, a, b) for(int i = a; i >= b; --i)
#define eb emplace_back
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define vi vector<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
struct Setup_io {
	Setup_io() {
		ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
		cout << fixed << setprecision(15);
	}
} setup_io;

int main() {
	int n;
	ll a[N];
	ll b[N];
	ll c[N];
	ll x = 0;
	cin >> n;
	rep(i, n) {
		cin >> a[i];
	}
	rep(i, n) {
		cin >> b[i];
	}
	rep(i, n) {
		x = max(x, a[i]);
		if (i == 0)c[0] = a[0] * b[0];
		else c[i] = max(c[i - 1], x*b[i]);
	}
	rep(i, n) {
		cout << c[i]<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define all(a) a.begin(), a.end()
using namespace std;
using P  = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vv = vector<vi>;
//const int mod = 1000000007;
const int mod = 998244353;

struct UnionFind{
    vector<int> d;
    UnionFind(int n=0): d(n, -1) {}
    int root(int x){
        if(d[x]<0)return x;
        return d[x] = root(d[x]);
    }
    bool unite(int x, int y){
        x = root(x); y = root(y);
        if(x==y) return false;
        if(d[x]>d[y]) swap(x,y);
        d[x] += d[y]; d[y] = x;
        return true;
    }
    bool same(int x, int y){return root(x) == root(y);}
    int size(int x){return -d[root(x)];}
};

vector<ll> fac(51);

void fac_init(){
    fac[0] = 1;
    for(ll i=1; i<=50; i++){
        fac[i] = fac[i-1] * i % mod;
    }
}

int main(){
    fac_init();
    int n, k;
    cin >> n >> k;
    vv a(n, vi (n));
    rep(i,n)rep(j,n)cin >> a[i][j];

    UnionFind uf1(n), uf2(n);

    for(int x=0; x<n; x++){
        for(int y=x+1; y<n; y++){
            bool ok = true;
            rep(i,n)if(a[i][x]+a[i][y]>k)ok = false;
            if(ok)uf1.unite(x,y);
        }
    }
    for(int x=0; x<n; x++){
        for(int y=x+1; y<n; y++){
            bool ok = true;
            rep(i,n)if(a[x][i]+a[y][i]>k)ok = false;
            if(ok)uf2.unite(x,y);
        }
    }

    vi check1(n, 0), check2(n, 0);
    ll ans = 1;

    rep(i,n){
        if(check1[uf1.root(i)])continue;
        check1[uf1.root(i)] = 1;
        ans *= fac[uf1.size(i)];
        ans %= mod;
    }
    rep(i,n){
        if(check2[uf2.root(i)])continue;
        check2[uf2.root(i)] = 1;
        ans *= fac[uf2.size(i)];
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <climits>

constexpr int SINT_MAX = std::numeric_limits<int>::max();
constexpr int SINT_MIN = std::numeric_limits<int>::min();

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;

template<class T>
T choose(bool b, T t, T f)
{
    if (b) return t;
    else return f;
}

const char *YesNo(bool b)
{
    return choose(b, "Yes", "No");
}

const char *YESNO(bool b)
{
    return choose(b, "YES", "NO");
}

template<class NumT>
NumT diffabs(NumT l, NumT r)
{
    if (l < r) return r-l;
    else return l-r;
}

struct myinout_t {} io;

template<class T>
myinout_t &operator >>(myinout_t &my, T &i)
{
    cin >> i;
    return my;
}

myinout_t &operator >>(myinout_t &my, int &i)
{
    int r = scanf("%d", &i);
    if (r != 1) exit(EXIT_FAILURE);
    return my;
}

myinout_t &operator >>(myinout_t &my, ll &i)
{
    int r = scanf("%lld", &i);
    if (r != 1) exit(EXIT_FAILURE);
    return my;
}

template<class T>
myinout_t &operator <<(myinout_t &my, const T &i)
{
    cout << i;
    return my;
}

myinout_t &operator <<(myinout_t &my, int i)
{
    printf("%d", i);
    return my;
}

myinout_t &operator <<(myinout_t &my, ll i)
{
    printf("%lld", i);
    return my;
}

myinout_t &operator <<(myinout_t &my, double i)
{
    printf("%.20f", i);
    return my;
}

constexpr char BR = '\n';

///////////////////////////////////////////////////

const int MAX_N = 60;         // n の最大値
vector<vector<long long>> com;  // 前計算の結果を保存
void bi_init() {
    com.assign(MAX_N, vector<long long>(MAX_N));
    com[0][0] = 1;
    for (int i = 1; i < MAX_N; ++i) {
        com[i][0] = 1;
        for (int j = 1; j < MAX_N; j++) {
            com[i][j] = (com[i - 1][j - 1] + com[i - 1][j]);
        }
    }
}
long long bi(int n, int k) {
    return com[n][k];
}
ll hbi(int n, int m)
{
    return bi(n+m, m);
}

vector<char> f(int rest_a, int rest_b, ll K)
{
    if (rest_a == 0)
    {
        return vector<char>(rest_b, 'b');
    }
    if (rest_b == 0)
    {
        return vector<char>(rest_a, 'a');
    }

    ll biA = hbi(rest_a - 1, rest_b);
    if (K <= biA)
    {
        vector<char> t = f(rest_a - 1, rest_b, K);
        t.push_back('a');
        return t;
    }
    else
    {
        vector<char> t = f(rest_a, rest_b - 1, K - biA);
        t.push_back('b');
        return t;
    }
}

int main()
{
    int A , B;
    ll K;
    io >> A >> B >> K;

    bi_init();

    vector<char> ans =  f(A, B, K);
    reverse(ans.begin(), ans.end());
    for (char c : ans)
    {
        io << c;
    }
    io << BR;
}

// atcoder/abc186/F/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

template<typename T>
struct SegTree {
  int n;
  int origin_size;
  vector<T> v;
  using F = function<T(T, T)>;
  F fn;
  T e;
  SegTree(int n_, T e_, F fn_) {
    origin_size = n_;
    e = e_;
    fn = fn_;
    n = 1;
    while (n < n_) n *= 2;
    v.resize(2 * n - 1, e);
  }

  void update(size_t k, T a) {
    k += n - 1;
    v[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      v[k] = fn(v[k * 2 + 1], v[k * 2 + 2]);
    }
    return ;
  }

  T operator [] (size_t idx) const {
    return v.at(idx + n - 1);
  }

  inline T operator () () const {
    return query(0, origin_size, 0, 0, n);
  }

  inline T operator () (size_t a) const {
    return query(a, a+1, 0, 0, n);
  }

  inline T operator () (size_t a, size_t b) const {
    return query(a, b, 0, 0, n);
  }

  inline T query(size_t a, size_t b) const {
    assert(a < b);
    assert(b <= origin_size);
    return query(a, b, 0, 0, n);
  }

  T query(size_t a, size_t b, size_t k, size_t l, size_t r) const {
    if (r <= a || b <= l) return e;
    if (a <= l && r <= b) return v.at(k);

    T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

    return fn(vl, vr);
  }
};

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  lli h, w;
  int m;
  while (cin >> h >> w >> m) {
    vec<pair<lli, lli>> v(m);
    cin >> v;
    each (i, v) --i.first, --i.second;

    const int N = 2 * 1e5 + 5;
    const lli inf = 1LL << 60;
    static lli mn[N];
    fill(mn, mn + N, h);
    each (i, v) {
      setmin(mn[i.second], i.first);
    }

    lli sum = 0;
    for (int j = 0; j < w; ++j) {
      if (mn[j] == 0) break;
      sum += mn[j];
    }

    static vec<int> u[N];
    fill(u, u + N, vec<int>());
    each (i, v) {
      u[i.first].push_back(i.second);
    }
    for (int i = 0; i < N; ++i) {
      sort(u[i].begin(), u[i].end());
    }
    if (u[0].size()) {
      for (int j = u[0].front(); j < w; ++j) {
        u[0].push_back(j);
      }
    }

    SegTree<int> segtree(N, 0, [] (int a , int b) { return a + b; });
    for (int i = 1; i < h; ++i) {
      if (u[i].size() && u[i].front() == 0) break;
      each (j, u[i - 1]) {
        segtree.update(j, 1);
      }
      sum += segtree.query(0, (u[i].empty() ? w : u[i].front()));
    }
    cout << sum << endl;
  }

  return 0;
}


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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

string x="atcoder";

void solve(){
    string s;
    cin>>s;
    //cerr<<string(s.size(),'a')<<endl;;
    if(s>x){
        cout<<0<<endl;
        return ;
    }
   if(s==string(s.size(),'a')){
       cout<<-1<<endl;
   }
   else{
      for (int i = 0; i < s.size(); i++)
      {
          if(s[i]!='a'){
              if(s[i]>'t'){
                  cout<<i-1<<endl;
              }
              else{
                  cout<<i<<endl;
              }
              return ;
          }
      }

   }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

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

int main(){
  int T, ans, howlong;
  string S, Spoint, comppoint;
  cin >> T;
  for(int i = 0; i < T; i++){
    cin >> S;
    howlong = S.size();
    if("atcoder" < S){
      ans = 0;
    }else{
      for(int j = 0; j < howlong; j ++){
        Spoint = S.at(j);
        if("t" < Spoint){
          ans = j - 1;
          break;
        }if("a" < Spoint){
          ans = j;
          break;
        }else{
          ans = -1;
        }
      }
    }
  cout << ans << endl;
  }
}


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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ll long long

int main(){
	int n;
	cin >> n;
	vector<string> s(n);
	for(int i=0;i<n;i++){
		cin >> s.at(i);
	}
	ll int ans = 1;
	for(int i=0;i<n;i++){
		if(s.at(i) == "OR"){
			ll a = pow(2,i+1);
			ans += a;
		}
	}
	cout << ans << endl;
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<int,int> P;
double const PI=3.141592653589793;
int const INF=1001001001;
ll const LINF=1001001001001001001;
ll const MOD=1000000007;

int N;
string S[61];
ll dp[61][2];

int main(){
    cin>>N;
    repn(i,N) cin>>S[i];

    dp[0][0]=1;
    dp[0][1]=1;
    repn(i,N){
        rep(x,2) rep(y,2){
            int n=x;
            if(S[i]=="AND") n&=y;
            else n|=y;
            dp[i][n]+=dp[i-1][y];
        }
    }

    cout<<dp[N][1]<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define mp make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pll pair<ll,ll>
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int i=1;i<=n;i++)
ll mod=1000000007;
ll n,k,t,m,q,flag=0;
ll power(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;}
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(a) -- no. of elements strictly less than a
// s.find_by_order(i) -- itertor to ith element (0 indexed)
ll min(ll a,ll b){if(a>b)return b;else return a;}
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #ifdef NOOBxCODER
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #else
    #define NOOBxCODER 0
    #endif
    //cin>>t;
    t=1;
    while(t--){
        cin>>n>>k;
        ll ans=0;
        for(int i=2;i<=2*n;i++){
            if(i-k>=2 && i-k<=2*n){
                ans+= min(i-1,2*n+1-i)*min(i-k-1,2*n+1-i+k);

            }
        }
        cout<<ans;

    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<sstream>
#include<queue>
#include<list>
#include<stack>
#include<bitset>
#include<cmath>
#include<map>
#include<functional>
#define int long long
#define IO ios::sync_with_stdio(false)
#define ll int
using namespace std;
signed main()
{
    IO;
    int a,b,c,d,k,n;
    while(cin>>n>>k){
        k=(k>0)?k:-k;
        ll ans=0;
        for(ll i=2+k;i<=2*n;i++){ //枚举 A , A=k+B
            ll A=i,B=i-k;
            ll min_A=max(A-n,1ll);
            ll max_A=min(A-1,n);
            ll min_B=max(B-n,1ll);
            ll max_B=min(B-1,n);
            ans+=(max_A-min_A+1)*(max_B-min_B+1);
        }
        cout<<ans<<endl;
    }
    //PAUSE;
    return 0;
}


#include<bits/stdc++.h>

#define fo(i,n) for(int i=0;i<n;i++)
#define dsort(arr,n) sort(arr, arr + n, greater<int>())
#define vsortd(a) sort(a.begin(), a.end(), greater<double>())
#define vsort(a) sort(a.begin(), a.end())
#define dbg(x) cout<<#x<<'='<<(x)<<endl;
#define dbg2(x,y) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl;
#define dbg3(x,y,z) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl;
#define dbg4(x,y,z,w) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl<<#w<<"="<<(w)<<endl;
#define minheap priority_queue <int, vector<int>, greater<int> >
#define maxheap priority_queue <int>
#define test int tc;cin>>tc;while(tc--)
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define mpr make_pair
#define mkv vector<int>
#define allzero(dp) memset(dp,0,sizeof(dp))
#define endl "\n"
#define print(x) cout<<x<<endl;
#define full(v) v.begin(),v.end()
#define inf INT_MAX

const int mod=1e9+7;
using namespace std;

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

bool compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first>b.first)return true;
    if(a.first==b.first)return a.second<b.second;
    return false;
}

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

void solve()
{
    ll z = 0;
    ll b,c;cin>>b>>c;
    if(b==0){
        ll mimi = -c/2;
        ll mimx = z;
        ll mxmx = (c-1)/2;
        ll mxmi = 0;
       // dbg4(mimi,mimx,mxmi,mxmx)
        if(mimx == 0 && mxmi == 0)
            z=1;
        print(mimx-mimi+1+mxmx-mxmi+1-z)
    }
    else if(b>0){
        ll mimi = -b-(c-1)/2;
        ll mimx = min(z,-(b-(c-1)/2));
        ll mxmx = max(b,-(-b-(c-2)/2));
        ll mxmi = max(z,b-c/2);
       // dbg4(mimi,mimx,mxmi,mxmx)
        if(mimx == 0 && mxmi == 0)
            z=1;
        print(mimx-mimi+1+mxmx-mxmi+1-z)
    }
    else{
        b*=-1;
        ll mimi = -b-c/2;
        ll mimx = min(z,-(b-(c-2)/2));
        ll mxmx = max(b,-(-b-(c-1)/2));
        ll mxmi = max(z,b-(c-1)/2);
      //  dbg4(mimi,mimx,mxmi,mxmx)
        if(mimx == 0 && mxmi == 0)
            z=1;
        print(mimx-mimi+1+mxmx-mxmi+1-z)
    }
}

int main()
{
    //cout<<fixed<<setprecision(20);
  //  fastio();
   // test
    solve();
}

#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
#include <valarray>
#include <fstream>
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>

using namespace std;
using uint = uint32_t;
using LL = int64_t;
using ULL = uint64_t;
using PP = pair<LL, LL>;
template <typename T> using PriorityQ = priority_queue<T, vector<T>, greater<T> >;
#define REP(i, a, n) for(LL i = (a), i##_max_ = (n); i < i##_max_; ++i)
#define REM(i, a, n) for(LL i = (LL)(n) - 1, i##_min_ = (a); i >= i##_min_; --i)
#define FLOAT fixed << setprecision(16)
#define SPEEDUP { cin.tie(NULL); ios::sync_with_stdio(false); }
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const double EPS = 1.0e-9;

void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U> istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U> ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N> void Fill(T(&dest)[N], const TCompatible& val) { fill(dest, dest + N, val); }
template <class T, class TCompatible, size_t M, size_t N> void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
template <class T> T Next() { T buf; cin >> buf; return buf; }
istream& Ignore(istream& ist) { string s; ist >> s; return ist; }
bool Inside(int i, int j, int h, int w) { return i >= 0 && i < h&& j >= 0 && j < w; }

#ifdef ONLY_MY_ENVIR
#include "Accumulator.h"
#include "Algebraic.h"
#include "BinaryMatrix.h"
#include "BinaryTree.h"
#include "Bipartite.h"
#include "BIT.h"
#include "CartesianTree.h"
#include "Compressor.h"
#include "Decompositions.h"
#include "DiscreteLog.h"
#include "DominatorTree.h"
#include "DynamicMod.h"
#include "Exponential.h"
#include "Factorization.h"
#include "FFT.h"
#include "Field.h"
#include "FlatTree.h"
#include "FlowSolver.h"
#include "Geometric2D.h"
#include "Geometric2DFloat.h"
#include "Geometric3D.h"
#include "Geometric3DFloat.h"
#include "Graph.h"
#include "GraphUtil.h"
#include "HLD.h"
#include "Interpolation.h"
#include "IntMod.h"
#include "KDTree.h"
#include "LazySegmentTree.h"
#include "LCA.h"
#include "LIS.h"
#include "List.h"
#include "Math.h"
#include "MathUtil.h"
#include "Matrix.h"
#include "MatrixTree.h"
#include "Multivariate.h"
#include "MinCostFlowSolver.h"
#include "MinMax.h"
#include "Numbers.h"
#include "Optimize.h"
#include "Permutation.h"
#include "Polynomial.h"
#include "Position.h"
#include "Quadratic.h"
#include "Random.h"
#include "Range.h"
#include "Rational.h"
#include "RollingHash.h"
#include "RuntimeMod.h"
#include "SafeInt.h"
#include "SegmentTree.h"
#include "SegmentTree2D.h"
#include "Sets.h"
#include "Shortest.h"
#include "SlidingWindow.h"
#include "SpanningTree.h"
#include "StringSearching.h"
#include "SuffixArray.h"
#include "SwitchList.h"
#include "Timer.h"
#include "Tree.h"
#include "TreeUtil.h"
#include "UnionFind.h"
#include "Unicyclic.h"
#include "Util.h"
#include "VectorUtil.h"
#endif

#ifdef __GNUC__
using LLL = __int128;
istream& operator>>(istream& ist, __int128& val) { LL tmp; ist >> tmp; val = tmp; return ist; }
ostream& operator<<(ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#else
using LLL = LL;
#endif

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << 21 - (a + b + c) << endl;
	return 0;
}

// Included Files:
//   * Main.cpp


#include <bits/stdc++.h>
#define endl "\n";
#define inf 1000000000000000;
using namespace std;
using ll = long long;
using ld = long double;
using db = double;
using str = string;

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;

using vi = vector<int>;
using vii = vector<pi>;
using vll = vector<pl>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<db>;
using vs = vector<str>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
const ll BIG=998244353;//1000000007
const double PI=3.141592653589793238;
#define FOR(i,a,b) for (ll i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (ll i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
// pairs
#define mp make_pair
#define f first
#define s second

// vectors
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sor(x) sort(all(x))
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
ll binpow(ll a,ll b,ll m)
{
    ll res=1;
    while(b>0){
        if(b&1){res=(res*a)%m;}
    b>>=1;a=(a*a)%m;
    }
    return res;
}
template <typename T,typename Q>
T max(T a,Q b)
{
	if(a>b)
		return a;
	return b;
    //return a+b-b^((a^b)&-(a<b));
}
template <typename T,typename Q>
T min(T a,Q b)
{
	if(a<b)
		return a;
	return b;
    //return b^((a^b)&-(a<b));
}
ll fact[1000001];
void precal()
{
	fact[0]=1;
	fact[1]=1;
	for(int i=2;i<=1e6;i++)
	{
		fact[i]=(fact[i-1]*i)%BIG;
	}
}
ll mod(ll a)
{
	return a%BIG;
	// return a-(BIG & -(a>=BIG));
}
ll imod(ll a)
{
	return binpow(a,BIG-2,BIG);
}
ll C(ll a,ll b)
{
	return mod(fact[a]*mod(imod(fact[a-b])*imod(fact[b])));
}
void solve()
{
	int n;cin>>n;
	vi v(n);
	trav(a,v) cin>>a;
	int p=-1,q=-1;
	for(int i=2;i<=1000;i++)
	{
		int t=0;
		trav(a,v)
		{
			if(a%i==0) t++;
		}
		if(t>p)
		{
			p=t;
			q=i;
		}
	}
	cout<<q;
}
int main() {
    int t;t=1;
    while(t--)
	{
		solve();
	}
	return 0;
}

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

int main() {

    long k;
    string s, t;
    cin >> k;
    cin >> s >> t;

    int c[10] = {0};
    int d[10] = {0};
    for(int i = 0; i < 4; i++){
        int ss = s[i] - '0';
        int tt = t[i] - '0';
        c[ss]++;
        d[tt]++;
    }

    long count = 0;
    for(int i = 1; i <= 9; i++){
        for(int j = 1; j <= 9; j++){

            int flag = 0;
            if(i == j){
                if(c[i]+d[i]+2 <= k){
                    flag = 1;
                }
            } else {
                if(c[i]+d[i]+1 <= k && c[j]+d[j]+1 <= k){
                    flag = 2;
                }
            }

            if(flag == 1 || flag == 2){
                long takahashi = 0 ;
                long aoki = 0 ;
                for(int k = 1; k <= 9; k++){

                    if(k == i){
                        takahashi += k*pow(10, c[k] + 1);
                    } else {
                        takahashi += k*pow(10, c[k]);
                    }

                    if(k == j){
                        aoki += k*pow(10, d[k] + 1);
                    } else {
                        aoki += k*pow(10, d[k]);
                    }

                }
                if(takahashi > aoki){
                    if(flag == 1) count += (k-c[i]-d[i]) * (k-c[j]-d[j]-1);
                    if(flag == 2) count += (k-c[i]-d[i]) * (k-c[j]-d[j]);
                    //cout << i << ' ' << j << endl;
                }
            }

        }
    }

    cout << setprecision(15) << (double)(count)/(double)((9*k-8)*(9*k-9)) << endl;

}


#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <math.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? (-(a)) : (a))

typedef long long ll;

using namespace std;

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

	ll t;
	ll N;

	scanf("%lld %lld", &t, &N);

	ll q;

	if ((100LL * N) % t == 0) q = (100LL * N) / t - 1;
	else q = (100LL * N) / t;

	printf("%lld\n", q + (t * q / 100) + 1);

	return 0;
}

#include <bits/stdc++.h>

#define int long long

using namespace std;

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t, n;
    cin >> t >> n;
    bool vis[100005];
    for (int i = 0; i < 100005; i++) vis[i] = false;
    for (int i = 0; i <= 100000; i++) {
        int x = ((100+t)*i)/100;
        if (x < 100005) vis[x] = true;
    }
    vector<int> cyc;
    for (int i = 0; i < 100005; i++) if (!vis[i]) {
            if (cyc.size() < 100*t) {
                cyc.push_back(i);
            }
        }
    n--;
    int res = (cyc[100*t-1]+1)*(n/(100*t));
    n %= 100*t;
    res += cyc[n];
    cout << res << '\n';

}


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

int main(){
  long long t, N;
  cin >> t >> N;
  long long n = 100 * N / t;
  if(100 * N % t != 0) n++;
  n += (N - 1);
  cout << n << endl;
}

#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(NULL)
#define sc(z) scanf("%d", &(z))
#define _ff(i, a, b) for (ll i = a; i <= b; ++i)
#define _rr(i, a, b) for (ll i = b; i >= a; --i)
#define _f(i, a, b) for (ll i = a; i < b; ++i)
#define _r(i, a, b) for (ll i = b - 1; i >= a; --i)
#define mkp make_pair
#define endl "\n"
using namespace std;
typedef long long ll;
typedef long double ld;

const int N = 1e5 + 5;
int a[N];

int main() {
    ll t, n; cin >> t >> n;
    for (int i = 1; i <= 100; ++i) {
        a[(100+t) * i / 100] = 1;
    }
    vector<int> v;
    for (int i = 1; i <= 100 + t; ++i) {
        if (!a[i]) v.push_back(i);
    }
    // for (int i : v) cout << i << " ";
    ll ans;
    if (n % v.size()) {
        ans = (100 + t) * (n / v.size()) + v[n % v.size() - 1];
    } else {
        ans = (100 + t) * (n / v.size() - 1) + v[v.size() - 1];
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
#define P pair<int,int>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
#define T tuple<int, int, int>

const int MAX_N = 2e5;

vvi G(MAX_N);

void reveal(int v, int cnt, vi &ranks){
    ranks[v] = cnt;

    for (int nv : G[v]){
        if (ranks[nv] != -1) continue;
        reveal(nv, cnt+1, ranks);
    }

}

void imos_dfs(int v, ll cnt, vector<ll> &V, vi &ranks){
    cnt += V[v];
    V[v] = cnt;

    for (int nv : G[v]){
        if (ranks[nv] < ranks[v]) continue;
        imos_dfs(nv, cnt, V, ranks);
    }
}

int main(){
    int n;
    cin >> n;

    vector<ll> V(MAX_N);
    vector<P> E;
    vi ranks(MAX_N, -1);

    rep(i,n-1){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);

        E.push_back(P(a, b));
    }

    reveal(0, 0, ranks);

    int q;
    cin >> q;
    rep(i,q){
        int t, e, x;
        cin >> t >> e >> x;
        e--;

        int a = E[e].first;
        int b = E[e].second;

        if (t == 1){
            if (ranks[a] > ranks[b]){
                V[a] += x;
            } else {
                V[0] += x;
                V[b] -= x;
            }
        } else {
            if (ranks[b] > ranks[a]){
                V[b] += x;
            } else {
                V[0] += x;
                V[a] -= x;
            }
        }
    }

    imos_dfs(0, 0, V, ranks);

    rep(i,n){
        cout << V[i] << endl;
    }
}

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

int main(){
    int N, M, Q;
    cin >> N >> M >> Q;
    vector<pair<int, int>> VW(N);
    for(int i=0; i<N; i++){
        int w, v;
        cin >> w >> v;
        VW[i] = {v, w};
    }
    sort(VW.rbegin(), VW.rend());
    vector<int> X(M);
    for(int i=0; i<M; i++) cin >> X[i];

    while(Q--){
        int l, r;
        cin >> l >> r;
        l--; r--;
        multiset<int> st;
        for(int i=0; i<l; i++) st.insert(X[i]);
        for(int i=r+1; i<M; i++) st.insert(X[i]);
        int ans = 0;
        for(auto [v, w] : VW){
            auto it = st.lower_bound(w);
            if(it != st.end()){
                ans += v;
                st.erase(it);
            }
        }
        cout << ans << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using PP=pair<ll,P>;
using vp=vector<P>;
using vpp=vector<PP>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename A,typename B>istream&operator>>(istream&is,pair<A,B> &p){is>>p.fi>>p.se;return is;}
template<typename A,typename B>ostream&operator<<(ostream&os,const pair<A,B> &p){os<<"("<<p.fi<<","<<p.se<<")";return os;}
template<typename T>istream&operator>>(istream&is,vector<T> &t){REP(i,t.size())is>>t[i];return is;}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&t){os<<"{";REP(i,t.size()){if(i)os<<",";os<<t[i];}cout<<"}";return os;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
template<int mod>
struct ModInt{
    int x;
    ModInt():x(0){}
    ModInt(long long y):x(y>=0?y%mod:(mod-(-y)%mod)%mod){}
    ModInt &operator+=(const ModInt &p){
        if((x+=p.x)>=mod)x-=mod;
        return *this;
    }
    ModInt &operator-=(const ModInt &p){
        if((x+=mod-p.x)>=mod)x-=mod;
        return *this;
    }
    ModInt &operator*=(const ModInt &p){
        x=(int)(1LL*x*p.x%mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p){
        *this*=p.inverse();
        return *this;
    }
    ModInt operator-()const{return ModInt(-x);}
    ModInt operator+(const ModInt &p)const{return ModInt(*this)+=p;}
    ModInt operator-(const ModInt &p)const{return ModInt(*this)-=p;}
    ModInt operator*(const ModInt &p)const{return ModInt(*this)*=p;}
    ModInt operator/(const ModInt &p)const{return ModInt(*this)/=p;}
    bool operator==(const ModInt &p)const{return x==p.x;}
    bool operator!=(const ModInt &p)const{return x!=p.x;}
    ModInt inverse()const{
        int a=x,b=mod,u=1,v=0,t;
        while(b>0){
            t=a/b;
            a-=t*b;
            swap(a,b);
            u-=t*v;
            swap(u,v);
        }
        return ModInt(u);
    }
    friend ostream &operator<<(ostream &os,const ModInt<mod> &p){
        return os<<p.x;
    }
    friend istream &operator>>(istream &is,ModInt<mod> &a){
        long long x;
        is>>x;
        a=ModInt<mod>(x);
        return (is);
    }
};

const int mod=1e9+7;
using mint=ModInt<mod>;
mint mpow(mint a,int b){
    if(!b){
        return 1;
    }
    if(b%2){
        return mpow(a,b-1)*a;
    }else{
        mint t=mpow(a,b/2);
        return t*t;
    }
}
int main(){
    int n,p;
    cin>>n>>p;
    mint ans=(p-1);
    ans*=mpow(p-2,n-1);
    cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std ;

const int MAX = 2004 ;

int arr[MAX] ;
int n ;

map<int , int>mp ;

vector<int>v ;

void factorize(int x)
{
	for(int i = 1 ; i * i <= x ; ++i)
	{
		if(x % i == 0)
		{
			mp[i] = __gcd(mp[i] , x) ;
			v.push_back(i) ;
			if(x / i != i)
				mp[x / i] = __gcd(mp[x / i] , x) , v.push_back(x / i) ;
		}
	}
}

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n ;
	for(int i = 0 ; i < n ; ++i)
		cin>>arr[i] ;
	for(int i = 0 ; i < n ; ++i)
		factorize(arr[i]) ;
	int Min = *min_element(arr , arr + n) ;
	sort(v.begin() , v.end()) ;
	v.erase(unique(v.begin() , v.end()) , v.end()) ;
	int ans = 0 ;
	for(auto &x : v)
	{
		if(x > Min)
			break ;
		if(mp[x] == x)
			ans++ ;
	}
	return cout<<ans<<"\n" , 0 ;
}


#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> cs(n), as(n - 1), bs(n - 1);
	for (auto &&c : cs)
	{
		cin >> c;
		c--;
	}
	for (int64_t i = 0; i < n - 1; i++)
	{
		cin >> as[i] >> bs[i];
		as[i]--;
		bs[i]--;
	}

	vector<vector<int64_t>> g(n);
	for (int64_t i = 0; i < n - 1; i++)
	{
		g[as[i]].emplace_back(bs[i]);
		g[bs[i]].emplace_back(as[i]);
	}

	set<int64_t> ans;

	vector<int64_t> cnt(100'000, 0);

	auto dfs = [&](auto &&f, int64_t now, int64_t par = -1) -> void {
		if (cnt[cs[now]] == 0)
		{
			ans.insert(now);
		}

		cnt[cs[now]]++;

		for (auto &&nxt : g[now])
		{
			if (nxt == par)
			{
				continue;
			}

			f(f, nxt, now);
		}

		cnt[cs[now]]--;
	};

	dfs(dfs, 0);

	for (auto &&x : ans)
	{
		cout << (x + 1) << endl;
	}

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define rep2(i, a)for(auto i : a)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x, std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll mod = 998244353;
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll co(ll n, ll k) { ll a = 1; rep(i, 1ll, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }
ll modinv(ll a) { ll b = mod, u = 1, v = 0; while (b) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); }u %= mod; if (u < 0) u += mod; return u; }

vector<vector<int>> G;
vector<int> c, used;
int t[100001];
vector<int> good;
void dfs(int v) {
	if (used[v] == 1)return;
	used[v] = 1;
	if (t[c[v]] == 0)good.push_back(v + 1);
	t[c[v]]++;
	for (auto u : G[v])dfs(u);
	t[c[v]]--;
}
int main() {
	int n;
	cin >> n;
	G.resize(n);
	c.resize(n);
	used.resize(n);
	rep(i, 0, n)cin >> c[i];
	rep(i, 0, n - 1) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	dfs(0);
	sort(all(good));
	for(auto v : good)printf("%d\n", v);
	return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
#define forr(i,n) for(int i = 0 ; i  < n ; i++)
#define forr1(i,n) for(int i = 1 ; i  <= n ; i++)
#define pb push_back
// #define int long long
#define endl "\n"
#define ll long long
#define sz(a)  int(a.size())
const int mod  = 998244353;
const int N = 2e5 + 10 ;
const ll inf = 1e9;
const int maxm = 1005;
vector<vector<char>> matrix(maxm , vector<char>(maxm));
// vector<vector<bool>> vt(maxm, vector<bool>(maxm));
struct event {
  int x, y, size;
};
int dx[] = {0, 0, 1, - 1};
int dy[] = { -1, 1 , 0 , 0};
struct myComp {
  constexpr bool operator()(pair<int, int> const& a, pair<int, int> const& b)const noexcept
  {
    return a.first < b.first;
  }
};
bool cmp(pair<int, int>a , pair<int, int> b)
{
  if (a.first == b.first)
    return a.second < b.second ;
  return a.first < b.first ;
}

string s ;
pair<bool, int> chk(int j )
{
  int k = j ;
  int n = sz(s);
  for (int i = 0 ; i < n ; i++)
  {
    if ( k >= n)
    {
      // cout << "yes";
      if (s[1] < s[0]) return {false, j};
    }
    if (s[i] > s[k]) return {true, k};
    else if (s[i] < s[k]) return {false, k};
    else if (s[i] == s[k])k++;
    // cout << i << " " << k << " " << j << endl;
  }
  return {true, k} ;
}
void solve()
{
  int n ;
  cin >> n;
  map<int, int> m ;
  ll res = 0 ;
  forr(i, n)
  {
    int x ;
    cin >> x;
    res += m[x];
    m[x]++;
  }
  ll ans = (n * 1ll * (n - 1)) / 2 - res;
  cout << ans ;
}
int main()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt" , "r" , stdin);
  freopen("3.txt" , "w" , stdout);
#endif
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  // int t;
  // cin >> t;
  // while (t--)
  solve();

}

#pragma region Region_1

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
using ll = long long;
using P = pair<int, int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VP = vector<P>;
using VS = vector<string>;
using VC = vector<char>;
using VVC = vector<vector<char>>;
#define MOD 1000000007
const int INF = 1e9 + 10;          // int max > 2*10^9
const long long INFL = (long long)2e18 + 10;  // ll max > 9*10^18

template <class T, class C>
bool chmax(T& a, C b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T, class C>
bool chmin(T& a, C b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template <class T>
T sum(const vector<T>& v) {
    T res = 0;
    for (size_t i = 0; i < v.size(); ++i) res += v[i];
    return res;
}

/////////////////////////////////////////////////////////
// print like python
// https://qiita.com/Lily0727K/items/06cb1d6da8a436369eed
/////////////////////////////////////////////////////////
void print() { cout << endl; }

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    print(forward<Tail>(tail)...);
}

template <class T>
void print(vector<T>& vec) {
    for (auto& a : vec) {
        cout << a;
        if (&a != &vec.back()) cout << " ";
    }
    cout << endl;
}

template <class T>
void print(vector<vector<T>>& df) {
    for (auto& vec : df) {
        print(vec);
    }
}

#pragma endregion Region_1
/////////////////////////////////////////////////////////

int main() {
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    std::cout << std::setprecision(15);
    //////////////////////////////////////////
    string s;
    ll M;
    cin >> s;
    cin >> M;
    int maxd = 0;
    VI sv;
    for (char c : s) {
        chmax(maxd, (c - '0'));
        sv.push_back((c - '0'));
    }
    if(sv.size()==1){
        if(maxd <= M)print(1);
        else print(0);
        return 0;
    }

    auto n_fnc = [&](ll m) {
        if (m == 1) return false;
        ll v = 1;
        ll tot = 0;
        drep(i, sv.size()) {
            if (((ll)1e18+v-1) / v < sv[i]) return false;

            tot += v * sv[i];
            if (tot > M) {
                return false;
            }

            if (i > 0) {
                if (((ll)1e18+v-1) / v < m){
                     return false;
                }
            }
            v *= m;
        }
        return true;
    };
    ll l = maxd, r = (ll)1e18 + 1;
    while (l + 1 < r) {
        ll mid = (l + r) / 2;
        if (n_fnc(mid)) {
            l = mid;
        } else
            r = mid;
    }
    print(l-maxd);

    return 0;
}


#include<bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x,y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x,y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define d4(x,y,z,w)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z << " | "<< #w << "--> " << w <<endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
using namespace std;
ll mode = 1e9 + 7;
const ll maxn = 1e6 + 5;
const ll inf = 1e18;
ll __lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getRand(ll l, ll r){ uniform_int_distribution<int> uid(l, r); return uid(rng); }
template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) { return out << "(" << a.F << ", " << a.S << ")"; }
template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
out << "["; for (int i=0;i<v.size();i++) { if(i) out << ", "; out << v[i]; } return out << "]"; }

vector<ll> primes;

vector<ll> spf(maxn);
void sieve(){
    spf[1] = 1;
    for (ll i=2; i<maxn; i++)
        spf[i] = i;
    for (ll i=4; i<maxn; i+=2)
        spf[i] = 2;
    primes.push_back(2);

    for (ll i=3; i<maxn; i++) {
        if (spf[i] == i) {
            primes.push_back(i);
            for (ll j=i; j<maxn; j+=i)
                if (spf[j]==j)
                    spf[j] = i;
        }
    }
}
map<ll,ll> fact(ll x) {
    map<ll,ll> mp;
    while (x != 1)
    {
        mp[spf[x]]++;
        x = x / spf[x];
    }
    return mp;
}

ll get(ll a, ll b){
	if (a<=1) return 0;
	map<ll,ll> mp = fact(a);
    vector<ll> factor;
    for (auto i:mp){
        factor.push_back(i.first);
    }
    map<ll,ll> sub;
    ll n = factor.size();
    for (int i=1;i<(1<<n);i++){
        ll x = i;
        ll num = 1;
        for (int j=0;j<n;j++, x/=2){
            if (x&1){
                num *= factor[j];
            }
        }
        sub[i] += (b/num);
    }
    ll ans = 0;
    for (auto i:sub){
        ll count = __builtin_popcount(i.first);
        if (count%2) ans += i.second;
        else ans -= i.second;
    }
    ans = ans - (b/a);
    //if (spf[a]==a) ans += (b/a);
    return ans;
}

void solve(){

    ll l, r;
    cin>>l>>r;
    ll res = 0;
    for (int i=l;i<=r;i++){
    	ll add = get(i, r) - get(i, i-1);
    	//d3(i, get(i,r), get(i, i-1));
    	res += add;
	}
	res += res;
    cout<<res<<endl;
}

int main(){

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

    ios::sync_with_stdio(0);
    cin.tie(0);

    sieve();
    ll test_case = 1;
    //cin>>test_case;
    for (int i=1;i<=test_case;i++){
        solve();
    }

    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>

using namespace std;

long long int L, R;

long long int ans = 0;

int p[1000006];

vector<int>V;

long long int num[1000006];

int c[1000006];

vector<int> PRIME(int k) {
	vector<int> ret;
	for (auto y : V) {
		if (y*y > k) { break; }
		if (k <= 1) { break; }
		if (k%y == 0) {
			ret.push_back(y);
			while (k%y == 0) {
				k /= y;
			}
		}
	}

	if (k != 1) { ret.push_back(k); }

	return ret;
}

int main(void) {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	cin >> L >> R;

/*	for (int i = 2; i <= R; i++) {
		c[i] = 1;
	}

	for (int i=2; i <= R; i++) {
		if (c[i] == 1) {
			for (int j = i * 2; j <= R; j += i) {
				c[j] = 0;
			}
		}
	}
	for (int i = 2; i <= R; i++) {
		if (c[i] == 1) { V.push_back(i); }
	}
	*/

	for (int i = R; i >= 2; i--) {

		long long int r = R / i;
		long long int l = max((long long int)i-1, (L - 1)) / i;
		num[i] = (r-l)*(r-l);
		for (int j = i * 2; j <= R; j += i) {
			num[i] -= num[j];
		}
	}

	long long int ans = 0;

	for (int i = 2; i <= R; i++) {
		ans += num[i];
	}
/*	for (int i = 1; i <= 20; i++) {
		cout << "num[" << i << "]= " << num[i] << endl;
	}*/
	long long int sum1 = 0;

	for (long long int i = max(L,2LL); i <= R; i++) {
		for (int j = i * 2; j <= R; j += i) {
			sum1++;
		}
	}

	//cout << "sum1= " << sum1 << endl;
	ans -= sum1 * 2;

	ans -= (R - max(L,2LL) + 1);

	cout << ans << endl;

	return 0;
}


#include<iostream>
#include<queue>
using namespace std;
int main()
{
	string s,t;
	long long n , ans=0 , sone=0 , tone=0 , erase=0;	cin>>n>>s>>t;
	queue<int> que;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='1'&&erase>0){
			ans+=i-que.front();
			que.pop();
			erase-- , s[i]='0';
		}
		if(s[i]=='1') sone++;
		if(t[i]=='1') tone++;
		if(sone>tone){
			s[i]='0' , erase++ , sone--;
			que.push(i);
		}
		else if(sone==tone)
			sone-- , tone--;
	}
	sone=tone=0;
	for(int i=0;i<n;i++)
		if(s[i]=='1') sone++;
	for(int i=0;i<n;i++)
		if(t[i]=='1') tone++;
	if(sone<tone){
		puts("-1");
		return 0;
	}
	while(que.size())
		que.pop();
	for(int i=0;i<n;i++)
	{
		if(t[i]=='1')
			que.push(i);
		if(s[i]=='1'){
			ans+=i-que.front();
			que.pop();
		}
	}
	cout<<ans<<endl;
}

#include <bits/stdc++.h>
#include <time.h>
#define rep(i, n)	for(int i=0;i<(int)(n);i++)
#define ALL(a)	(a).begin(),(a).end()
using namespace std;
using ll=long long;
typedef pair<int,int> P;

bool LOCAL_TEST = false;
int h[30][30],v[30][30];
double priority[30][30];
vector<string> paths;
map<int,char> mp;

inline void InitRand(){
    srand((unsigned int)time(NULL));
}

void read_s_t_a_e(){
    int si,sj,ti,tj,a;
    double e;
    cin>>si>>sj>>ti>>tj>>a>>e;
    string path;
    if(si<=ti) rep(j,ti-si) path+='D';
    else rep(j,si-ti) path+='U';
    if(sj<=tj) rep(j,tj-sj) path+='R';
    else rep(i,sj-tj) path+='L';
    paths.push_back(path);
}

void move(int si,int sj,int ti,int tj,string& path){
    int y=si,x=sj;
    while(y!=ti||x!=tj){
        if(y==ti){
            rep(i,abs(tj-x)) path+=mp[1];
            break;
        }
        else if(x==tj){
            rep(i,abs(ti-y)) path+=mp[0];
            break;
        }
        int next=rand()%2;
        path+=mp[next];
        if(next==0){
            if(y<ti) y++;
            else y--;
        }else{
            if(x<tj) x++;
            else x--;
        }
    }
}

void read_s_t(){
    int si,sj,ti,tj;
    cin>>si>>sj>>ti>>tj;
    string path;
    if(si<=ti) mp[0]='D';
    else mp[0]='U';
    if(sj<=tj) mp[1]='R';
    else mp[1]='L';
    move(si,sj,ti,tj,path);
    cout<<path<<endl;
    flush(cout);
    int a;
    cin>>a;
}

int main(){
    rep(i,30) fill(priority[i],priority[i]+30,-1);
    if(LOCAL_TEST){
        rep(i,30) rep(j,29) cin>>h[i][j];
        rep(i,29) rep(j,30) cin>>v[i][j];
    }
    rep(k,1000){
        if(LOCAL_TEST) read_s_t_a_e();
        else read_s_t();
    }
    if(LOCAL_TEST){
        ofstream output("out.txt");
        rep(k,1000) output<<paths[k]<<'\n';
    }
}


// Problem: B - Abbreviate Fox
// Contest: AtCoder - AtCoder Regular Contest 108
// URL: https://atcoder.jp/contests/arc108/tasks/arc108_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define X first
#define Y second
#define pb push_back
#define dlt decltype
#define vi vector<int>
#define vii vector<vector<int>>
#define INF 0x3f3f3f3f
using namespace std;
#ifdef LOCAL
namespace DEBUG {
	template <typename T>
	inline void _debug(const char* format, T t) {
	  cerr << format << '=' << t << endl;
	}

	template <class First, class... Rest>
	inline void _debug(const char* format, First first, Rest... rest) {
	  while (*format != ',') cerr << *format++;
	  cerr << '=' << first << ",";
	  _debug(format + 1, rest...);
	}

	template <typename T>
	ostream& operator<<(ostream& os, const vector<T>& V) {
	  os << "[ ";
	  for (const auto& vv : V) os << vv << ", ";
	  os << "]";
	  return os;
	}
#define debug(...) _debug(#__VA_ARGS__, __VA_ARGS__)
}
using namespace DEBUG;
#endif
template<class T1,class T2>
inline bool cmin(T1 &a,T2 b){return a>b?a=b,1:0;}
template<class T1,class T2>
inline bool cmax(T1 &a,T2 b){return a<b?a=b,1:0;}
template<class T1,class T2,class ...T3>
inline bool cmin(T1 &a,T2 b,T3 ...rest){return cmin(a,b)||cmin(a,rest...);}
template<class T1,class T2,class ...T3>
inline bool cmax(T1 &a,T2 b,T3 ...rest){return cmin(a,b)||cmax(a,rest...);}

ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll gi(){
    ll i=0;bool f=false;char c;
    while (!isdigit(c=getchar())) f=c=='-';
    do i=(i<<3)+(i<<1)+c-'0'; while (isdigit(c=getchar()));
    return f?-i:i;
}
int main(){
	int n=gi();
	string a;
	for (int i=1;i<=n;i++) a+=getchar();
	char b[200010];int ni=0;
	for (auto &i:a){
		b[ni++]=i;
		while (ni>=3&&
		b[ni-1]=='x'&&
		b[ni-2]=='o'&&
		b[ni-3]=='f'
		) ni-=3,n-=3;
	}
	cout << n;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937/*_64*/ rng(chrono::steady_clock::now().time_since_epoch().count());
#define printArr(arr, n) cerr << #arr << " = ["; for(int i=0; i<(n); i++){if (i) cerr << ", "; cerr << arr[i];} cerr << "]\n"
template<class A> ostream& operator<<(ostream &cout, vector<A> const &v) {cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";};
template<class A, class B> ostream& operator<<(ostream &cout, const pair<A,B> &x) {return cout << "(" <<x.first << ", " << x.second << ")";};
void _print() {cerr << "]\n";}
template <class T, class... V> void _print(T t, V... v) {cerr << t; if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#define fi first
#define se second
#define SZ(x) (int)((x).size())
#define pii pair<int,int>
struct dsu{
	vector<int> v, sz, edge;
	dsu(int n) : v(n), sz(n,1), edge(n)
	{
		iota(v.begin(), v.end(), 0);
	}
	int root(int a)
	{
		return (v[a] == a ? a : v[a] = root(v[a]));
	}
	bool unite(int a, int b)
	{
		int a1 = root(a), b1 = root(b);
		if (a1 == b1) {
			edge[a1]++;
			return false;
		}
		if (sz[a1] < sz[b1]) swap(a1,b1);
		sz[a1]+=sz[b1];
		v[b1] = a1;
		edge[a1] += edge[b1]+1;
		return true;
	}
};
const int mx = 400005;
dsu d(mx);
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	for (int q = 0; q < n; q++) {
		int a,b;
		cin >> a >> b;
		d.unite(a,b);
	}
	int ans = 0;
	for (int q = 1; q < mx; q++) {
		if (d.root(q) != q) continue;
		ans += min(d.edge[q], d.sz[q]);
	}
	cout << ans << "\n";
	return 0;
}


#include "bits/stdc++.h"
#define rep0(var,cnt) for(int (var)=0; (var)<(int)(cnt); ++(var))
#define rep1(var,cnt) for(int (var)=1; (var)<(int)(cnt); ++(var))
#define repi(var,init,cnt) for(int (var)=(init); (var)<(int)(cnt); ++(var))
#define Yn(flag) cout<<(flag?"Yes":"No")
#define pre(var) cout<<fixed<<setprecision(var);
using namespace std;

using ll = long long;
using ull = unsigned long long;

template<typename T>
using vec = vector<T>;
template<typename T>
using mat = vector<vec<T>>;

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<" ";
  }
  return os;
}

template<typename T>
istream &operator>>(istream &is, vector<T> &v){
    for(T &in:v) is>>in;
    return is;
}

template<typename T>
T chclamp(T x, T low, T high){
  if(x<low) return low;
  if(x>high) return high;
  return x;
}

template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

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

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

void MAIN(void);

int main(void){
  cin.tie(0);
  ios::sync_with_stdio(0);
  //pre(10);
  MAIN();
}
// Usual Template End =========================================
// Template End ===============================================
ll INF=numeric_limits<ll>::max()/4;
constexpr int MOD=1e9+7;
using mint = ModInt<MOD>;

#define between(a,b,c) ((a)<=(b))&&((b)<(c))

void MAIN(void){
  int H,W,X,Y; cin>>H>>W>>X>>Y;
  vec<string> S(H); cin>>S;
  --X,--Y;
  int ans=1;
  int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
  for(int i=0; i<4; ++i){
    int x=X,y=Y;
    while(1){
      x+=dx[i],y+=dy[i];
      //cout<<x<<y<<endl;
      if(!(between(0,x,H)&&between(0,y,W))) break;
      else if(S[x][y]=='.') ++ans;
      else break;
    }
  }
  cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define rep2(i,n) for (int i=1; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
int main() {
  int a,b,x,y; cin >> a >> b >> x >> y;
  int fast = min(y,2*x);
  int dist = abs((2*b+1)-(2*a));
  int ans = (dist/2)*fast+x;
  cout << ans << endl;
}


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

const int maxn = 2e5+8, inf  = 1e18+9, mod  = 998244353;

struct node { int a; char c; } a[maxn];
int n, m;

void solve() {
    int i, j;
    cin >> n; n *= 2;
    for (i = 1; i <= n; i++) cin >> a[i].a >> a[i].c;
    sort(a + 1, a + n + 1, [](node &o1, node &o2) { if (o1.c != o2.c) return o1.c < o2.c; else return o1.a < o2.a; });
    vector<int> R, G, B;
    for (i = 1; i <= n; i++) {
        if (a[i].c == 'R') R.push_back(a[i].a);
        else if (a[i].c == 'G') G.push_back(a[i].a);
        else B.push_back(a[i].a);
    }
    if (B.size() % 2 != 0) {
        if (R.size() % 2 == 0) swap(B, R);
        else swap(B, G);
    }
    if (R.size() % 2 == 0) return (void)(cout << 0 << endl);
    int ans = inf; i = 0, j = 0;
    while (i < R.size() && j < G.size()) {
        ans = min(ans, llabs(R[i] - G[j]));
        if (R[i] < G[j]) i++;
        else j++;
    }
    i = 0, j = 0;
    while (i < R.size() && j < G.size()) {
        ans = min(ans, llabs(R[i] - G[j]));
        if (G[j] < R[i]) j++;
        else i++;
    }

    int idx = 0, idx2 = 0, g1 = inf, g2 = inf;
    i = 0; j = 0;
    while (i < R.size() && j < B.size()) {
        if (g1 > llabs(R[i] - B[j])) g1 = llabs(R[i] - B[j]), idx = j;
        if (R[i] < B[j]) i++;
        else j++;
    }
    i = 0; j = 0;
    while (i < R.size() && j < B.size()) {
        if (g1 > llabs(R[i] - B[j])) g1 = llabs(R[i] - B[j]), idx = j;
        if (B[j] < R[i]) j++;
        else i++;
    }

    i = 0; j = 0;
    while (i < G.size() && j < B.size()) {
        if (j == idx) {
            j++;
            continue;
        }
        if (g2 > llabs(G[i] - B[j])) g2 = llabs(G[i] - B[j]);
        if (G[i] < B[j]) i++;
        else j++;
    }
    i = 0; j = 0;
    while (i < G.size() && j < B.size()) {
        if (j == idx) {
            j++;
            continue;
        }
        if (g2 > llabs(G[i] - B[j])) g2 = llabs(G[i] - B[j]);
        if (B[j] < G[i]) j++;
        else i++;
    }
    ans = min(ans, g1 + g2);
    g1 = g2 = inf;

    while (i < G.size() && j < B.size()) {
        if (g1 > llabs(G[i] - B[j])) g1 = llabs(G[i] - B[j]), idx = j;
        if (G[i] < B[j]) i++;
        else j++;
    }
    i = 0; j = 0;
    while (i < G.size() && j < B.size()) {
        if (g1 > llabs(G[i] - B[j])) g1 = llabs(G[i] - B[j]), idx = j;
        if (B[j] < G[i]) j++;
        else i++;
    }

    i = 0; j = 0;
    while (i < R.size() && j < B.size()) {
        if (j == idx) {
            j++;
            continue;
        }
        if (g2 > llabs(R[i] - B[j])) g2 = llabs(R[i] - B[j]);
        if (R[i] < B[j]) i++;
        else j++;
    }
    i = 0; j = 0;
    while (i < R.size() && j < B.size()) {
        if (j == idx) {
            j++;
            continue;
        }
        if (g2 > llabs(R[i] - B[j])) g2 = llabs(R[i] - B[j]);
        if (B[j] < R[i]) j++;
        else i++;
    }
    ans = min(ans, g1 + g2);
    cout << ans << endl;
}

signed main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); //cout << fixed << setprecision(15);
    int t = 1; //cin >> t;
    while (t--) solve();
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define int long long int
#define rep(i, a, b) for (int i = a; i < b; i++)
#define revrep(i, a, b) for (int i = a; i >= b; i--)
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pii>
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))

ostream &operator<<( ostream &output, const pii &p ) { output << p.first << " " << p.second;return output; }
istream &operator>>( istream &input, pii &p ) { input >> p.first >> p.second;return input; }
template<typename T>
void inline println(vector<T> args){ for(T i: args)cout<<i<<" ";cout<<endl; }

int INF = 1e18;
int MOD = 1e9+7;

void solve()
{
    int n;cin>>n;
    map<int, int> mp;
    rep(i, 0, n) {
        int temp;cin>>temp;
        mp[temp]++;
    }
    if(n%2 == 0) {
        int first = true;
        for(auto pr: mp)
            if(pr.second%2 != 0) first = false;
        if(first) cout<<"Second";
        else cout<<"First";
    } else {
        cout<<"Second";
    }
    cout<<endl;
}

signed main()
{

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