#include <bits/stdc++.h>
using namespace std;
int n, m;
int p[100001];
int main() {
    std::ios::sync_with_stdio(false);
    cin >> n >> m;
    vector<long long>v(n);
    vector<long long>h;
    int minival = -1;
    for (int i = 0; i < n; i++) cin >> v[i];
    long long e = 1000000000;
    v.push_back(e);
    int m1 = 0
    for (int j = 0; j < m; j++) {
        long long a, b, c;
        cin >> a >> b >> c;
        if (a == 1) {
            h.push_back(b);
            m1++;
        }
    }
    m = m1;
    sort(v.begin(), v.end());
    sort(h.begin(), h.end());
    //for (int i = 0; i <= n; i++) cout << v[i] << " " ;
    //cout << endl;
    //for (int j = 0; j < m; j++) cout << h[j] << " ";
    //cout << endl;
    for (int i = 0; i <= n; i++) {
        p[i] = lower_bound(h.begin(), h.end(), v[i]) - h.begin();
        //cout << p[i] << " " << i+m-p[i];
        //cout << endl;
        if (minival == -1) minival = i+m-p[i];
        else minival = min(minival, i+m-p[i]);
    }
    cout << minival << endl;
}


#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
    std::ios::sync_with_stdio(false);
    cin >> n >> m;
    vector<long long>v(n);
    vector<long long>h;
    int minival = -1;
    for (int i = 0; i < n; i++) cin >> v[i];
    long long e = 1000000000;
    v.push_back(e);
    int m1 = 0;
    for (int j = 0; j < m; j++) {
        long long a, b, c;
        cin >> a >> b >> c;
        if (a == 1) {
            h.push_back(b);
            m1++;
        }
    }
    m = m1;
    sort(v.begin(), v.end());
    sort(h.begin(), h.end());
    //for (int i = 0; i <= n; i++) cout << v[i] << " " ;
    //cout << endl;
    //for (int j = 0; j < m; j++) cout << h[j] << " ";
    //cout << endl;
    for (int i = 0; i <= n; i++) {
        int p = lower_bound(h.begin(), h.end(), v[i]) - h.begin();
        //cout << p[i] << " " << i+m-p[i];
        //cout << endl;
        if (minival == -1) minival = i+m-p;
        else minival = min(minival, i+m-p);
    }
    cout << minival << endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
ll a[maxn];
ll b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    ll x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        scanf("%lld%lld%lld",&x,&y,&z);
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    ans=min(ans,h+n);
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
int a[maxn];
int b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int x,y,z,cnt=0;
    for(int i=1;i<=m;i++){
        cin>>x>>y>>z;
        if(x==1)b[++cnt]=y;
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=cnt;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+1)+i-1;
    }
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
int a[maxn];
int b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        cin>>x>>y>>z;
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+5;
int n,m;
int a[maxn];
int b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    int x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        scanf("%d%d%d",&x,&y,&z);
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    ans=min(ans,h+n);
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
int a[maxn];
int b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    int x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        scanf("%d%d%d",&x,&y,&z);
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    ans=min(ans,h+n);
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
int a[maxn];
int b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        cin>>x>>y>>z;
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    ans=min(ans,h+n);
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
int a[maxn];
int b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int x,y,z,cnt=0;
    for(int i=1;i<=m;i++){
        cin>>x>>y>>z;
        if(x==1)b[++cnt]=y;
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=n;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
ll a[maxn];
ll b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    int x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        scanf("%lld%lld%lld",&x,&y,&z);
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    int ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    ans=min(ans,h+n);
    printf("%d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5;
int n,m;
ll a[maxn];
ll b[maxn];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
    }
    ll x,y,z,cnt=0,h=0;
    for(int i=1;i<=m;i++){
        scanf("%lld%lld%lld",&x,&y,&z);
        if(x==1){
            b[++cnt]=y;
            if(y==1e9)h++;
        }
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+cnt);
    ll ans=m;
    for(int i=1;i<=n;i++){
        int k=lower_bound(b+1,b+1+cnt,a[i])-b;
        ans=min(ans,cnt-k+i);
    }
    if(n==0)ans=min(ans,h);
    ans=min(ans,h+n);
    printf("%d\n",ans);
}


#include <bits/stdc++.h>
using namespace std;
int tab[1000001];
int tab2[1000001];
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=1;i<=a;i++)
    {
        cin>>tab[i];
    }
    sort(tab+1, tab+a+1);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile+1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<=a)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[1000001];
int tab2[1000001];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(a==0 && b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=1;i<=a;i++)
    {
        cin>>tab[i];
    }
    sort(tab+1, tab+a+1);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile+1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<a+2)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[100000];
int tab2[100000];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(a==0 && b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=0;i<a;i++)
    {
        cin>>tab[i];
    }
    sort(tab, tab+a);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile-1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<a+1)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[100000];
int tab2[100000];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(a==0 && b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=1;i<=a;i++)
    {
        cin>>tab[i];
    }
    sort(tab+1, tab+a+1);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile-1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<a)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[1000001];
int tab2[1000001];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(a==0 && b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=1;i<=a;i++)
    {
        cin>>tab[i];
    }
    sort(tab+1, tab+a+1);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile-1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<a+1)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[1000001];
int tab2[1000001];
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int a,b,c,d,e,ile=0,t=0,mini=1000000000;
    cin>>a>>b;
    for(int i=0;i<a;i++)
    {
    	cin>>tab[i];
    }
    for(int i=0;i<b;i++)
    {
    	cin>>c>>d>>e;
    	if(c==1)
    	{
    		tab2[ile]=d;
    		ile++;
    	}
    }
    sort(tab,tab+a);
    sort(tab2,tab2+ile);
    tab[a]=1000000000;
    for(int i=0;i<=a;i++)
    {
    	while(tab[i]>tab2[t] && t<ile)
    	{
    		t++;
    	}
    	mini=min(mini,ile-t+i);
    }
    cout<<mini;
}


#include <bits/stdc++.h>
using namespace std;
int tab[100000];
int tab2[100000];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(a==0 && b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=1;i<=a;i++)
    {
        cin>>tab[i];
    }
    sort(tab+1, tab+a+1);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile-1);
    int t=1;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<a+1)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[100000];
int tab2[100000];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    if(a==0 && b==0)
    {
    	cout<<0;
    	return 0;
    }
    for(int i=1;i<=a;i++)
    {
        cin>>tab[i];
    }
    sort(tab+1, tab+a+1);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile-1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<a+1)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int tab[100000];
int tab2[100000];
int main() {
	ios_base::sync_with_stdio(0);
    int a,b,c,d,e,wyn=100000000;
    cin>>a>>b;
    for(int i=0;i<a;i++)
    {
        cin>>tab[i];
    }
    sort(tab, tab+a);
    int ile=0;
    for(int i=0;i<b;i++)
    {
        cin>>c>>d>>e;
        if(c==1)
        {
            tab2[ile]=d;
            ile++;
        }
    }
    tab[a]=1000000000;
    sort(tab2,tab2+ile-1);
    int t=0;
    for(int i=0;i<a+1;i++)
    {
        while(tab2[t+1]<tab[i] && t<ile)
        {
        	t++;
        }
        wyn=min(ile-t+i,wyn);
    }
    cout<<wyn;
    return 0;
}


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

#define F first
#define S second
#define PB push_back
#define endl '\n'

typedef long long ll;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef pair<double, char> ic;
typedef pair<ic, int> ici;
typedef vector<ii> vii;
typedef vector<int> vi;

typedef priority_queue<ici, vector<ici>, greater<ici> > heap;

const int INF = ~(1<<31);
const int MAX = 1e9;

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

    int n, m, a, b, c;
    cin >> n >> m;

    if(!(m + n)) {
        cout << 0 << endl;
        return 0;
    }

    int k = 0;
    heap events;
    set<double> L;

    for(int i=0; i<n; i++) {
        cin >> a;
        events.push({ { a, 'v' }, 0 });
    }

    for(int i=0; i<m; i++) {
        cin >> a >> b >> c;
        events.push({ { a, 'b' }, c });
        events.push({ { b, 'c' }, c });
    }

    if(events.top().F.F > 1 || events.top().F.S == 'v') {
        cout << 0 << endl;
        return 0;
    }

    int answ = INF;
    while(!events.empty()) {
        ici top = events.top(); events.pop();
        // cout << "event " << top.F.F << ' ' << top.F.S << ' ' << top.S << endl;

        if(top.F.S == 'v') k++;
        else if(top.F.S =='a') {
            answ = min(answ, (int)L.size() + k);
        } else if(top.F.S == 'c') { // Delete
            answ = min(answ, (int)L.size() + k);
            L.erase(top.S);
            while(!events.empty() && events.top().F.S == 'c' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.erase(events.top().S);
                events.pop();
            }
            if(top.F.F < MAX)
                events.push({ { top.F.F + .5, 'a' }, 0 });
            // cout << "c" << endl;
        } else { // Insert
            L.insert(top.S);
            while(events.top().F.S == 'b' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.insert(events.top().S);
                events.pop();
            }
            answ = min(answ, (int)L.size() + k);
        }
    }
    cout << answ << endl;
    return 0;
}


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

#define F first
#define S second
#define PB push_back
#define endl '\n'

typedef long long ll;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef pair<int, char> ic;
typedef pair<ic, int> ici;
typedef vector<ii> vii;
typedef vector<int> vi;

typedef priority_queue<ici, vector<ici>, greater<ici> > heap;

const int INF = ~(1<<31);
const int MAX = 1e9;

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

    int n, m, a, b, c;
    cin >> n >> m;

    int k = 0;
    heap events;
    set<int> L;
    map<int, int> C;

    for(int i=0; i<n; i++) {
        cin >> a;
        events.push({ { a, 'v' }, 0 });
    }

    for(int i=0; i<m; i++) {
        cin >> a >> b >> c;
        events.push({ { a, 'b'}, c });
        events.push({ { b, 'c'}, c });
    }

    if(events.empty() || (events.top().F.S == 'v' || events.top().F.F > 1)) {
        cout << 0 << endl;
        return 0;
    }

    int answ = INF;
    while(!events.empty()) {
        ici top = events.top(); events.pop();
        // cout << "event " << top.F.F << ' ' << top.F.S << ' ' << top.S << endl;

        if(top.F.S == 'v') k++;
        else if(top.F.S =='a') {
            if(!events.empty() && events.top().F.S != 'b') {
                answ = min(answ, (int)L.size() + k);
                // cout << "a " << answ << endl;
            } else if(events.empty()) {
                answ = min(answ, (int)L.size() + k);
                // cout << "-a " << answ << endl;
            }
        } else if(top.F.S == 'c') { // Delete
            answ = min(answ, (int)L.size() + k);
            L.erase(top.S);
            while(!events.empty() && events.top().F.S == 'c' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.erase(events.top().S);
                events.pop();
            }
            if(top.F.F < MAX)
                events.push({ { top.F.F + 1, 'a' }, 0 });
            // cout << "c" << endl;
        } else { // Insert
            L.insert(top.S);
            while(events.top().F.S == 'b' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.insert(events.top().S);
                events.pop();
            }
            answ = min(answ, (int)L.size() + k);
        }
    }
    cout << answ << endl;
    return 0;
}


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

#define F first
#define S second
#define PB push_back
#define endl '\n'

typedef long long ll;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef pair<double, char> ic;
typedef pair<ic, int> ici;
typedef vector<ii> vii;
typedef vector<int> vi;

typedef priority_queue<ici, vector<ici>, greater<ici> > heap;

const int INF = ~(1<<31);
const int MAX = 1e9;

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

    int n, m, x, y, z;
    cin >> n >> m;

    vi A(n), B;
    for(int &i : A) cin >> i;

    A.PB(MAX);
    sort(A.begin(), A.end());

    for(int i=0; i<m; i++) {
        cin >> x >> y >> z;
        if(x == 1) B.PB(y);
    }

    sort(B.begin(), B.end());

    int j=0, mn = INF;
    for(int i=0; i<A.size(); i++) {
        while(j < B.size() && A[i] > B[j]) j++;
        mn = min(mn, i + (int)B.size() - j);
    }

    cout << mn << endl;
    return 0;
}


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

#define F first
#define S second
#define PB push_back
#define endl '\n'

typedef long long ll;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef pair<int, char> ic;
typedef pair<ic, int> ici;
typedef vector<ii> vii;
typedef vector<int> vi;

typedef priority_queue<ici, vector<ici>, greater<ici> > heap;

const int INF = ~(1<<31);
const int MAX = 1e9;

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

    int n, m, a, b, c;
    cin >> n >> m;

    int k = 0;
    heap events;
    set<int> L;
    map<int, int> C;

    for(int i=0; i<n; i++) {
        cin >> a;
        events.push({ { a, 'v' }, 0 });
    }

    for(int i=0; i<m; i++) {
        cin >> a >> b >> c;
        events.push({ { a, 'b'}, c });
        events.push({ { b, 'c'}, c });
    }

    if(events.empty() ||  events.top().F.F > 1) {
        cout << 0 << endl;
        return 0;
    }

    int answ = INF;
    while(!events.empty()) {
        ici top = events.top(); events.pop();
        // cout << "event " << top.F.F << ' ' << top.F.S << ' ' << top.S << endl;

        if(top.F.S == 'v') k++;
        else if(top.F.S =='a') {
            if(!events.empty() && events.top().F.S != 'b') {
                answ = min(answ, (int)L.size() + k);
                // cout << "a " << answ << endl;
            } else if(events.empty()) {
                answ = min(answ, (int)L.size() + k);
                // cout << "-a " << answ << endl;
            }
        } else if(top.F.S == 'c') { // Delete
            answ = min(answ, (int)L.size() + k);
            L.erase(top.S);
            while(!events.empty() && events.top().F.S == 'c' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.erase(events.top().S);
                events.pop();
            }
            if(top.F.F < MAX)
                events.push({ { top.F.F + 1, 'a' }, 0 });
            // cout << "c" << endl;
        } else { // Insert
            L.insert(top.S);
            while(events.top().F.S == 'b' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.insert(events.top().S);
                events.pop();
            }
            answ = min(answ, (int)L.size() + k);
        }
    }
    cout << answ << endl;
    return 0;
}


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

#define F first
#define S second
#define PB push_back
#define endl '\n'

typedef long long ll;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef pair<int, char> ic;
typedef pair<ic, int> ici;
typedef vector<ii> vii;
typedef vector<int> vi;

typedef priority_queue<ici, vector<ici>, greater<ici> > heap;

const int INF = ~(1<<31);
const int MAX = 1e9;

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

    int n, m, a, b, c;
    cin >> n >> m;

    if(!(m + n)) {
        cout << 0 << endl;
        return 0;
    }

    int k = 0;
    heap events;
    set<int> L;
    map<int, int> C;

    for(int i=0; i<n; i++) {
        cin >> a;
        events.push({ { a, 'v' }, 0 });
    }

    for(int i=0; i<m; i++) {
        cin >> a >> b >> c;
        events.push({ { a, 'b' }, c });
        events.push({ { b, 'c' }, c });
    }

    if(events.top().F.F > 1 || events.top().F.S == 'v') {
        cout << 0 << endl;
        return 0;
    }

    int answ = INF;
    while(!events.empty()) {
        ici top = events.top(); events.pop();
        // cout << "event " << top.F.F << ' ' << top.F.S << ' ' << top.S << endl;

        if(top.F.S == 'v') k++;
        else if(top.F.S =='a') {
            if(!events.empty() && events.top().F.S != 'b') {
                answ = min(answ, (int)L.size() + k);
                // cout << "a " << answ << endl;
            } else if(events.empty()) {
                answ = min(answ, (int)L.size() + k);
                // cout << "-a " << answ << endl;
            }
        } else if(top.F.S == 'c') { // Delete
            answ = min(answ, (int)L.size() + k);
            L.erase(top.S);
            while(!events.empty() && events.top().F.S == 'c' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.erase(events.top().S);
                events.pop();
            }
            if(top.F.F < MAX)
                events.push({ { top.F.F + 1, 'a' }, 0 });
            // cout << "c" << endl;
        } else { // Insert
            L.insert(top.S);
            while(events.top().F.S == 'b' && events.top().F.F == top.F.F) {
                // cout << "event " << events.top().F.F << ' ' << events.top().F.S << ' ' << events.top().S << endl;
                L.insert(events.top().S);
                events.pop();
            }
            answ = min(answ, (int)L.size() + k);
        }
    }
    cout << answ << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    //freopen("input.txt","r",stdin);
    int n,m;
    cin >> n >> m;
    int arr[n+2] = {0};
    int temp [n+2] = {0};
    for (int i = 0 ; i < n; ++i){
        cin >> arr[i+1];
    }
    arr[n+1] = 1000000000;
    sort(arr,arr+n+2);
    for (int i = 0 ; i < m ; ++i){
        int x,y,z;
        cin >> x >> y >> z;
        if (x == 1){
            int pos = upper_bound(arr,arr+n+2,y) - arr;
            temp[0] ++;
            temp[pos] --;

        }
    }
    for (int i = 1 ; i < n+2 ; ++i)
        temp[i] += temp[i-1];

    int ans = 1000000001;
    for (int i = 1 ; i < n+2 ;++i ){
        ans = min(ans, (i-1) + temp[i]);
    }
    cout<< ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

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

    int n,m;
    cin >> n >> m;
    int arr[n+2];
    int temp[n+2]={0};
    arr[0] = -1;
    int peices[n+1];
    for (int i = 0;i < n; ++i){
        int x;
        cin>>x;
        arr[i+1] = x;
    }
    arr[n+1] = 1000000000;

    for (int i = 0 ; i < m ; ++i){
        int a,b,c;
        cin >> a >> b >> c;
        int pos1=-1,pos2=-1;
        pos1 = lower_bound(arr,arr+n+2,a) - arr;
        pos1 --;
        pos2 = upper_bound(arr,arr+n+2,b) - arr;
        pos2 --;
        //cout << pos1 << " "<< pos2 << endl;
        if (pos1!=pos2){
            temp[pos1]++;
            if (pos2 != n+1)
                temp[pos2+1]--;
        }

    }

    for (int i = 1; i < n+2 ; ++i){
        temp[i] += temp[i-1];
    }

    for (int i = 0, j = 0;i<n+1;++i,++j){
        peices[i] = min(temp[j],temp[j+1]);
    }

    int ans = 1000000000;

    for (int i = 0 ; i < n+1 ;++i){
        ans = min(ans,i+peices[i]);
    }
    cout << ans;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {

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

    int n,m;
    cin >> n >> m;
    int arr[n+2];
    int temp[n+2]={0};
    arr[0] = -1;
    int peices[n+1];
    for (int i = 0;i < n; ++i){
        int x;
        cin>>x;
        arr[i+1] = x;
    }
    arr[n+1] = 1000000000;

    for (int i = 0 ; i < m ; ++i){
        int a,b,c;
        cin >> a >> b >> c;
        int pos1=-1,pos2=-1;
        pos1 = upper_bound(arr,arr+n+2,a) - arr;
        pos1 --;
        pos2 = upper_bound(arr,arr+n+2,b) - arr;
        pos2 --;
        if (pos1!=pos2){
            temp[pos1]++;
            temp[pos2+1]--;
        }

    }
    for (int i = 1; i < n+2 ; ++i){
        temp[i] += temp[i-1];
    }
    for (int i = 0;i<n+1;++i){
        peices[i] = min(temp[i],temp[i+1]);
    }

    int ans = 1000000000;

    for (int i = 0 ; i < n+1 ;++i){
        ans = min(ans,i+peices[i]);
    }
    cout << ans;

    return 0;
}


#include <iostream>
#include <queue>

void readSpellsSorted(int n, int& m, int* v, int* h) {
    int x;
    std::priority_queue<int> pq;
    for (int i = 0; i != n; ++i) {
        std::cin >> x;
        pq.push(x);
    };
    for (int i = 0; i != n; ++i) {
        v[i] = pq.top();
        pq.pop();
    }
    int x1, x2, y;
    for (int i = 0; i != m; ++i) {
        std::cin >> x1 >> x2 >> y;
        if (x1 == 1) { pq.push(x2); }
    }
    m = pq.size();
    for (int i = 0; i != m; ++i) {
        h[i] = pq.top();
        pq.pop();
    }
}

int main() {
    int n, m;
    int V_spells[100000] = {};
    int H_spells[100000] = {};
    std::cin >> n >> m;
    readSpellsSorted(n, m, V_spells, H_spells);

    int ans = 100000;
    int iv = -1, ih = 0;
    while (iv != n && ih != m + 1) {
        int rightBoundary = (iv < 0 || n == 0) ? 1000000000: V_spells[iv];
        if (H_spells[ih] >= rightBoundary) { ++ih; }
        if (H_spells[ih] < rightBoundary) {
            int tmpAns = ih + n - 1 - iv;
            ans = (ans > tmpAns) ? tmpAns : ans;
            ++iv;
        }
    }
    ans = (m == 0) ? 0 : ans;
    std::cout << ans << std::endl;
}


#include <iostream>
#include <queue>

int countBlocks(std::priority_queue<int>& spells, int rightBoundary = 1000000000) {
    std::queue<int> q;
    while (!spells.empty() && spells.top() >= rightBoundary) {
        q.push(spells.top());
        spells.pop();
    }
    int res = q.size();
    for (int i = 0; i != res; ++i) {
        spells.push(q.front());
        q.pop();
    }
    return res;
}

int main() {
    int n, m;
    int x, x1, x2, y;
    std::priority_queue<int> V_spells;
    std::priority_queue<int> H_spells;
    std::cin >> n >> m;
    for (int i = 0; i != n; ++i) {
        std::cin >> x;
        V_spells.push(x);
    }
    for (int i = 0; i != m; ++i) {
        std::cin >> x1 >> x2 >> y;
        if (x1 == 1) { H_spells.push(x2); }
    }

    int ans = 200000;
    int sz = V_spells.size();
    for (int i = 0; i != sz; ++i) {
        int rightBoundary = V_spells.top();
        int hcnt = countBlocks(H_spells, rightBoundary);
        int tmpAns = hcnt + sz - 1 - i;
        ans = (ans > tmpAns) ? tmpAns : ans;
        V_spells.pop();
    }

    int tmp = countBlocks(H_spells) + sz;
    ans = (ans > tmp) ? tmp : ans;

    std::cout << ans << std::endl;
}


#include <iostream>
#include <queue>

void readSpellsSorted(int n, int& m, int* v, int* h) {
    int x;
    std::priority_queue<int> pq;
    for (int i = 0; i != n; ++i) {
        std::cin >> x;
        pq.push(x);
    };
    for (int i = 0; i != n; ++i) {
        v[i] = pq.top();
        pq.pop();
    }
    int x1, x2, y;
    for (int i = 0; i != m; ++i) {
        std::cin >> x1 >> x2 >> y;
        if (x1 == 1) { pq.push(x2); }
    }
    m = pq.size();
    for (int i = 0; i != m; ++i) {
        h[i] = pq.top();
        pq.pop();
    }
}

int main() {
    int n, m;
    int V_spells[100000] = {};
    int H_spells[100000] = {};
    std::cin >> n >> m;
    readSpellsSorted(n, m, V_spells, H_spells);

    int ans = 200000;
    int iv = -1, ih = 0;
    while (iv != n && ih != m + 1) {
        int rightBoundary = (iv < 0 || n == 0) ? 1000000000: V_spells[iv];
        if (H_spells[ih] >= rightBoundary) { ++ih; }
        if (H_spells[ih] < rightBoundary) {
            int tmpAns = ih + n - 1 - iv;
            ans = (ans > tmpAns) ? tmpAns : ans;
            ++iv;
        }
    }
    ans = (m == 0) ? 0 : ans;
    std::cout << ans << std::endl;
}


#include <iostream>
#include <queue>

void readSpellsSorted(int n, int& m, int* v, int* h) {
    int x;
    std::priority_queue<int> pq;
    for (int i = 0; i != n; ++i) {
        std::cin >> x;
        pq.push(x);
    };
    for (int i = 0; i != n; ++i) {
        v[i] = pq.top();
        pq.pop();
    }
    int x1, x2, y;
    for (int i = 0; i != m; ++i) {
        std::cin >> x1 >> x2 >> y;
        if (x1 == 1) { pq.push(x2); }
    }
    m = pq.size();
    for (int i = 0; i != m; ++i) {
        h[i] = pq.top();
        pq.pop();
    }
}

int main() {
    int n, m;
    int V_spells[100000] = {};
    int H_spells[100000] = {};
    std::cin >> n >> m;
    readSpellsSorted(n, m, V_spells, H_spells);

    int ans = 200000;
    int iv = -1, ih = 0;
    while (iv != n && ih != m) {
        int rightBoundary = (iv < 0 || n == 0) ? 1000000000: V_spells[iv];
        if (H_spells[ih] >= rightBoundary) { ++ih; }
        if (H_spells[ih] < rightBoundary) {
            int tmpAns = ih + n - 1 - iv;
            ans = (ans > tmpAns) ? tmpAns : ans;
            ++iv;
        }
    }
    ans = (m == 0) ? 0 : ans;
    std::cout << ans << std::endl;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#define ll long long
#define llvec vector<ll>
#define loop(i,b,e) for(int i = b; i < e; i++)
#define intmp map<int, int>
#define init_io ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
llvec hor, ver;
intmp mp;
int n, m, x, y, b, c = 0, mn = 1e10, c2 = 0;

int main(){
    init_io
    cin>>n>>m;
    ver.resize(n+1), hor.resize(m);

    loop(i,1,n+1)
         cin>>ver[i];

    sort(ver.begin(), ver.end());
    loop(i,1,n+1) mp[ver[i]] = i-1;

    loop(i,1,m+1){
        cin>>x>>y>>b;
        if(x == 1){
            llvec::iterator it = lower_bound(ver.begin(), ver.end(), y);
            if(y >= 1e9) c2++;
            else if(*it == y) mp[*it]++;
            else{
                it--;
                if(y > *it) mp[*it]++;
            }
        }
    }
    for(int i = n-1; i > 0; i--){
        mp[ver[i]] += mp[ver[i+1]] - i;
    }
    intmp::iterator it = mp.begin();
    if(n == 0) cout<<c2<<endl;
    else if(n < m && n < it->second) cout<<min(n, c2+m)<<endl;
    else cout<<it->second+c2<<endl;

    return 0;
}


#include<stdio.h>
#include<vector>
#include<iostream>
#include<algorithm>
#define ll long long
#define llvec vector<ll>
#define loop(i,b,e) for(int i = b; i < e; i++)
#define pri(i,b,e,a) for(int i = b; i < e; i++) cout<<a[i]<<" ";
using namespace std;
int n, m, x, y ,b ,mn = 1e9, c = 0, c2 = 0;
int const SIZE = 1e5 + 20;
ll vec[SIZE], bor[SIZE];

int bs_lower_bound(ll vec[], ll x) {
    ll l = 0, h = n;
    while (l < h) {
        ll mid = (l + h) / 2;
        if (x >= vec[mid]) l = mid+1;
        			  else h = mid;
    }
    return l;
}

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

    loop(i,0,n) {
        scanf("%d", &x);
        vec[i] = x;
    }
    sort(vec, vec+n);
    bor[n] = n;
    loop(i,0,n) bor[i] = i;
    loop(i,0,m){
        scanf("%d%d%d", &x, &y, &b);
        if(x == 1){
            if(y == 1e9) c2++;
			else if(n>0) bor[bs_lower_bound(vec, y)-1]++;
			if(y >= vec[0] && vec[0] != 0) c++;
		}
    }
   	for(int i = n-1; i >= 0; i--) bor[i] += bor[i+1] - (i+1);
	loop(i,0,n+1) mn = min((ll)mn, bor[i]);

	if(n == 0) printf("%d\n", c2+c);
	else
		printf("%d\n", min(c+c2, mn+c2));

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#define ll long long
#define llvec vector<ll>
#define loop(i,b,e) for(int i = b; i < e; i++)
#define intmp map<int, int>
#define init_io ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
llvec hor, ver;
intmp mp;
int n, m, x, y, b, c = 0, mn = 1e10, c2 = 0;

int main(){
    init_io
    cin>>n>>m;
    ver.resize(n+1), hor.resize(m);

    loop(i,1,n+1)
         cin>>ver[i];

    sort(ver.begin(), ver.end());
    loop(i,1,n+1) mp[ver[i]] = i-1;

    loop(i,1,m+1){
        cin>>x>>y>>b;
        if(x == 1){
            llvec::iterator it = lower_bound(ver.begin(), ver.end(), y);
            if(y >= 1e9) c2++;
            else if(*it == y) mp[*it]++;
            else{
                it--;
                if(y > *it) mp[*it]++;
            }
        }
    }
    for(int i = n-1; i > 0; i--){
        mp[ver[i]] += mp[ver[i+1]] - i;
    }
    intmp::iterator it = mp.begin();
    if(n < m && c2 == 0 && n < it->second) cout<<n<<endl;
    else if(n == 0) cout<<c2<<endl;
    else cout<<it->second+c2<<endl;

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#define ll long long
#define llvec vector<ll>
#define loop(i,b,e) for(int i = b; i < e; i++)
#define intmp map<int, int>
#define init_io ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
llvec hor, ver;
intmp mp;
int n, m, x, y, b, c = 0, mn = 1e10, c2 = 0;

int main(){
    init_io
    cin>>n>>m;
    ver.resize(n+1), hor.resize(m);

    loop(i,1,n+1)
         cin>>ver[i];

    sort(ver.begin(), ver.end());
    loop(i,1,n) mp[ver[i]] = i -1;

    loop(i,1,m+1){
        cin>>x>>y>>b;
        if(x == 1){
            llvec::iterator it = lower_bound(ver.begin(), ver.end(), y);
            if(y >= 1e9) c2++;
            else if(*it == y) mp[*it]++;
            else{
                it--; mp[*it]++;
            }
        }
    }
    intmp::iterator it = mp.begin();
    if(n < m && c2 == 0 && n < it->second) cout<<n+c2<<endl;
    else if(n == 0) cout<<c2<<endl;
    else cout<<it->second+c2<<endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <fstream>
using namespace std;

typedef long long ll;

const int MOD=1e9+7,MAXN=110000;

int sol[MAXN],niz[MAXN],mini=1e9;

int main() {

	int n,m;

	cin >> n >> m;

	for(int i=0; i<n; i++) cin >> niz[i];

	sort(niz,niz+n);

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

		int a,b,c;
		cin >> a >> b >> c;

		/*if(a==1 && b==1e9){

			for(int j=0; j<=n; j++) sol[j]++;
			continue;
		}*/

		int k1=lower_bound(niz,niz+n,a)-niz,k2=lower_bound(niz,niz+n,b)-niz;

		if(b==1e9 || (k2<n && niz[k2]==b)) for(int j=k1; j<=k2; j++) sol[j]++;
		else for(int j=k1; j<k2; j++) sol[j]++;
	}

	if(niz[n-1]==1e9) for(int i=0; i<n; i++) mini=min(mini,sol[i]+i);
	else for(int i=0; i<=n; i++) mini=min(mini,sol[i]+i);

	cout << mini << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <fstream>
using namespace std;

typedef long long ll;

const int MOD=1e9+7,MAXN=110000;

int sol[MAXN],niz[MAXN],mini=1e9,sig;

vector<int> v;

int main() {

	int n,m;

	cin >> n >> m;

	for(int i=0; i<n; i++) cin >> niz[i];

	sort(niz,niz+n);

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

		int a,b,c;
		cin >> a >> b >> c;

		if(a==1 && b==1e9){

			sig++;
			continue;
		}
		if(a==1) v.push_back(b);
	}

	sort(v.begin(),v.end());

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

		int k=lower_bound(v.begin(),v.end(),niz[i])-v.begin();

		int pom=v.size()-k;

		mini=min(i+pom,mini);
	}

	cout << mini+sig << endl;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <fstream>
using namespace std;

typedef long long ll;

const int MOD=1e9+7,MAXN=110000;

int sol[MAXN],niz[MAXN],mini=1e9,sig;

vector<int> v;

int main() {

	int n,m;

	cin >> n >> m;

	for(int i=0; i<n; i++) cin >> niz[i];

	sort(niz,niz+n);

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

		int a,b,c;
		cin >> a >> b >> c;

		if(a==1 && b==1e9){

			sig++;
			continue;
		}
		if(a==1) v.push_back(b);
	}

	sort(v.begin(),v.end());
	niz[n]=1e9;
	n++;

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

		int k=lower_bound(v.begin(),v.end(),niz[i])-v.begin();

		int pom=v.size()-k;

		//cout << pom << endl;

		mini=min(i+pom,mini);
	}

	cout << mini+sig << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pint pair<int,int>
#define pb push_back
#define F first
#define S second
#define I insert
#define vint vector<int>
int power(int a, int b, int mod){ int c = 1; while(b>0){ if(b%2) c*=a, c%=mod; b/=2; a*=a; a%=mod; } return c; }
#define MAX 1000000007
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   int n,m;
   cin>>n>>m;
   vint ver;
   for(int i=0;i<n;i++)
   {
       int a;
       cin>>a;
       ver.push_back(a);
   }
   ver.push_back(1e9);
   sort(ver.begin(),ver.end());
   vint hor;

   for(int i = 0; i < m; i++)
   {
       int a,b,y;
       cin>>a>>b>>y;
       if(a<2)hor.push_back(b);
   }
    hor.push_back(1e9);
   sort(hor.begin(),hor.end());
   int j=0;
   int ans=hor.size();
   for(int i = 0; i < ver.size(); i++)
   {

       for(; hor[j] < ver[i]; j++);
       ans = min(ans,(int)(i+(hor.size())-j-1));

   }
   cout<<ans;

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pll pair<ll, ll>
#define pb push_back
#define F first
#define S second
#define I insert
#define vll vector<ll>
ll power(ll a, ll b, ll mod)
{
    ll c = 1;
    while (b > 0)
    {
        if (b % 2)
            c *= a, c %= mod;
        b /= 2;
        a *= a;
        a %= mod;
    }
    return c;
}
#define MAX 1000000007
struct dt
{
    ll x1, x2, y;
};
bool comp(dt a, dt b)
{
    return a.y < b.y;
}
vector<ll> ver;
vector<dt> hor;
ll n, m;

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

    for (ll i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        ver.push_back(a);
    }

    for (ll i = 0; i < m; i++)
    {
        dt temp;
        cin >> temp.x1 >> temp.x2 >> temp.y;
        hor.push_back(temp);
    }
    sort(ver.begin(), ver.end());
    sort(hor.begin(), hor.end(), comp);
    ll step = m;
    for (ll j = 0; j <= min(n, step); j++)
    {
        ll start, end;
        if (j == 0)
            start = 1;
        else
            start = ver[j - 1];
        if (j == n)
            end = 1e9;
        else
            end = ver[j];
        ll s = j;
        for (ll i = m - 1; i >= 0; i--)
        {
            if ((hor[i].x1 > start) || (hor[i].x2 < end))
                continue;
            else
                s++;
            if(s>step)
            break;
        }
        step=min(s,step);
    }
    cout<<step;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pll pair<ll, ll>
#define pb push_back
#define F first
#define S second
#define I insert
#define vll vector<ll>
ll power(ll a, ll b, ll mod)
{
    ll c = 1;
    while (b > 0)
    {
        if (b % 2)
            c *= a, c %= mod;
        b /= 2;
        a *= a;
        a %= mod;
    }
    return c;
}
#define MAX 1000000007
struct dt
{
    ll x1, x2, y;
};
bool comp(dt a, dt b)
{
    return a.y < b.y;
}
vector<ll> ver;
vector<dt> hor;
ll n, m;

ll step(ll v, ll h)
{
    if (h > m - 1)
        return 0;
    if (v > n - 1)
    {
        if ((hor[h].x1 > 1) || (hor[h].x2 < 1e9))
        {
            return step(v, h + 1);
        }
        else
        {
            return 1 + step(v, h + 1);
        }
    }
    if ((hor[h].x1 > 1) || (hor[h].x2 < ver[v]))
    {
        return step(v, h + 1);
    }
    else
    {
        return 1 + min(step(v + 1, h), step(v, h + 1));
    }
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;

    for (ll i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        ver.push_back(a);
    }

    for (ll i = 0; i < m; i++)
    {
        dt temp;
        cin >> temp.x1 >> temp.x2 >> temp.y;
        hor.push_back(temp);
    }
    sort(ver.begin(), ver.end());
    sort(hor.begin(), hor.end(), comp);
    cout<<step(0,0);
}


#include <bits/stdc++.h>

using namespace std;

const int N = (int)1e5+1;
int v[N];

int main() {
	int n, m;
	cin >> n >> m;
	for (int i=0;i<n;i++)
		cin>>v[i];
	sort(v, v+n);
	v[n] = (int)1e9;

	vector<int> h;
	for (int i=0;i<m;i++) {
		int x1, x2, y;
		cin >>x1>>x2>>y;
		if (x1 == 1)
			h.push_back(x2);
	}
	sort(h.begin(), h.end());

	int ans = h.size();
	for (int i=0;i<=n;i++) {
		int k = h.end() - lower_bound(h.begin(), h.end(), v[i]);
		cerr << k << " " << v[i] << endl;
		ans = min(ans, i+k);
		if (ans <= i)
			break;
	}
	cout << ans << endl;
}


#include <bits/stdc++.h>

using namespace std;

const int N = (int)1e5+1;
int v[N];

int main() {
	int n, m;
	cin >> n >> m;
	for (int i=0;i<n;i++)
		cin>>v[i];
	v[n] = (int)1e9;

	vector<int> h;
	for (int i=0;i<m;i++) {
		int x1, x2, y;
		cin >>x1>>x2>>y;
		if (x1 == 1)
			h.push_back(x2);
	}
	sort(h.begin(), h.end());

	int ans = h.size();
	for (int i=0;i<=n;i++) {
		int k = h.end() - lower_bound(h.begin(), h.end(), v[i]);
		ans = min(ans, i+k);
		if (ans <= i)
			break;
	}
	cout << ans << endl;
}


#include <bits/stdc++.h>

using namespace std;

const int N = (int)1e5+1;
int v[N];

int main() {
	int n, m;
	cin >> n >> m;
	for (int i=0;i<n;i++)
		cin>>v[i];
	sort(v, v+n);
	v[n] = (int)1e9;

	vector<int> h;
	h.reserve(m);
	for (int i=0;i<m;i++) {
		int x1, x2, y;
		cin >>x1>>x2>>y;
		if (x1 == 1)
			h.push_back(x2);
	}
	sort(h.begin(), h.end());

	int ans = h.size();
	for (int i=0;i<=n;i++) {
		int k = h.end() - lower_bound(h.begin(), h.end(), v[i]);
		ans = min(ans, i+k);
		if (ans <= i)
			break;
	}
	cout << ans << endl;
}


#include <bits/stdc++.h>
#define x first
#define y second
#define MaxN 100000
using namespace std;

int oriz[MaxN+1];
int vert[MaxN+1];
int N,K,M;

int main(){

    int i, j, x1, x2, y, res = 1 << 30;

    scanf("%d %d", &N, &K);
    for(i = 1; i <= N; ++i) scanf("%d", &vert[i]);
    for(i = 1; i <= K; ++i)
    {
        scanf("%d %d %d", &x1, &x2, &y);
        if(x1 == 1) oriz[++M] = x2;
    }

    sort(vert + 1, vert + N + 1);
    sort(oriz + 1, oriz + M + 1);
    if(!N){
        for(i = M; i >= 1 && oriz[i] == 1000000000; --i);
        printf("%d\n", M - i);
        return 0;
    }

    for(j = 1; j <= M && oriz[j] < vert[1]; ++j);
    for(i = 1; i < N; ++i)
    {
        res = min(res, i - 1 + M - j + 1);
        for(; j <= M && oriz[j] < vert[i+1]; ++j);
    }

    res = min(res, N);
    printf("%d\n", res);

return 0;
}


#include <bits/stdc++.h>
#define x first
#define y second
#define MaxN 100000
using namespace std;

int oriz[MaxN+1];
int vert[MaxN+1];
int N,K,M;

int main(){

    int i, j, qnt, x1, x2, y, res = 1 << 30;

    scanf("%d %d", &N, &K);
    for(i = 1; i <= N; ++i) scanf("%d", &vert[i]);
    for(i = 1; i <= K; ++i)
    {
        scanf("%d %d %d", &x1, &x2, &y);
        if(x1 == 1) oriz[++M] = x2;
    }

    sort(vert + 1, vert + N + 1);
    sort(oriz + 1, oriz + M + 1);
    if(!M) { printf("0\n"); return 0; }
    if(!N) {
        for(i = M; i >= 1 && oriz[i] == 1000000000; --i);
        printf("%d\n", M - i);
        return 0;
    }

    for(j = 1; j <= M && oriz[j] < vert[1]; ++j);
    for(i = 1; i < N; ++i)
    {
        res = min(res, i - 1 + M - j + 1);
        for(; j <= M && oriz[j] < vert[i+1]; ++j);
    }

    for(i = M; i >= 1 && oriz[i] == 1000000000; --i);
    qnt = M - i;

    res = min(res, N + qnt);
    printf("%d\n", res);

return 0;
}


#include <bits/stdc++.h>
#define x first
#define y second
#define MaxN 100000
using namespace std;

int oriz[MaxN+1];
int vert[MaxN+1];
int N,K,M;

int main(){

    int i, j, x1, x2, y, res = 1 << 30;

    scanf("%d %d", &N, &K);
    for(i = 1; i <= N; ++i) scanf("%d", &vert[i]);
    for(i = 1; i <= K; ++i)
    {
        scanf("%d %d %d", &x1, &x2, &y);
        if(x1 == 1) oriz[++M] = x2;
    }

    sort(vert + 1, vert + N + 1);
    sort(oriz + 1, oriz + M + 1);
    if(!M) { printf("0\n"); return 0; }
    if(!N){
        for(i = M; i >= 1 && oriz[i] == 1000000000; --i);
        printf("%d\n", M - i);
        return 0;
    }

    for(j = 1; j <= M && oriz[j] < vert[1]; ++j);
    for(i = 1; i < N; ++i)
    {
        res = min(res, i - 1 + M - j + 1);
        for(; j <= M && oriz[j] < vert[i+1]; ++j);
    }

    res = min(res, N);
    printf("%d\n", res);

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib>
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);

int main(){
	ll maax=(ll)1e9;
   ll n,m;
   IOS
	cin>>n>>m;
	std::vector<ll> verti(n);
	std::vector<ll> hori;
	ll aa,bb,cc;
	ll cnt=0;
	fo(i,n) cin>>verti[i];
	fo(i,m){
		cin>>aa>>bb>>cc;
		if(aa==1){
			//dbg(bb);
			if(bb==maax) cnt++;
			else hori.pb(bb);

		}

	}
	sort(all(verti));
	sort(all(hori));
	//dbg2(sz(verti),sz(hori));

	ll total=0;
	ll hori_p=0;
	ll verti_p=0;
	ll cnt1,cnt2;
	while(true){
		//dbg("f");
		if(verti_p==n||hori_p==sz(hori)) break;
		cnt1=hori.end()-lower_bound(hori.begin()+hori_p,hori.end(),verti[verti_p]);

		cnt2=upper_bound(verti.begin()+verti_p,verti.end(),hori[hori_p])-(verti.begin()+verti_p);
		//dbg2(verti_p, hori_p);
		//dbg2(cnt1,cnt2);
		if(cnt1==0){
			verti_p++;
			continue;
		}
		if(cnt2==0){
			hori_p++;
			continue;
		}
		//dbg2(cnt1,cnt2);

		cnt++;
		if(cnt1>cnt2) verti_p++;
		else hori_p++;

	}
	cout<<cnt<<endl;

}


#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib>
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);

int main(){
	ll maax=(ll)1e9;
   ll n,m;
   IOS
	cin>>n>>m;
	std::vector<ll> verti(n);
	std::vector<ll> hori;
	ll aa,bb,cc;
	ll cnt=0;
	fo(i,n) cin>>verti[i];
	fo(i,m){
		cin>>aa>>bb>>cc;
		if(aa==1){
			//dbg(bb);
			if(bb==maax) cnt++;
			else hori.pb(bb);

		}

	}
	sort(all(verti));
	sort(all(hori));
	//dbg2(sz(verti),sz(hori));

	ll total=0;
	ll hori_p=0;
	ll verti_p=0;
	ll cnt1,cnt2;
	while(true){
		//dbg("f");
		if(verti_p==n||hori_p==sz(hori)) break;
		cnt1=hori.end()-lower_bound(hori.begin()+hori_p,hori.end(),verti[verti_p]);

		cnt2=upper_bound(verti.begin()+verti_p,verti.end(),hori[hori_p])-(verti.begin()+verti_p);
		//dbg2(verti_p, hori_p);
		//dbg2(cnt1,cnt2);
		if(cnt1==0){
			verti_p++;
			continue;
		}
		if(cnt2==0){
			hori_p++;
			continue;
		}
		//dbg2(cnt1,cnt2);

		cnt++;
		if(cnt1>=cnt2) verti_p++;
		else hori_p++;

	}
	cout<<cnt<<endl;

}


#include <bits/stdc++.h>
using namespace std;
int a[100005],b[100005];
int main(){
	int x,y,z,lb=0,n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int i=1;i<=m;i++){
		cin>>x>>y>>z;
		if(x==1){
			b[++lb]=y;
		}
	}
	sort(a+1,a+n+1);
	sort(b+1,b+lb+1);
	a[n+1]=1000000000;
	int ans=n+m;
	for(int i=1;i<=n+1;i++){
		ans=min(ans,(int)(i+lb-(lower_bound(b+1,b+lb+1,a[i])-b)));
	}
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=3e5+10;
struct Point{int x,y;}p[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)scanf("%d%d",&p[i].x,&p[i].y);
    int minx=1e9,miny=1e9;
    int maxx=-1e9,maxy=-1e9;
    for(int i=0;i<n;i++)
    {
        minx=min(minx,p[i].x);
        miny=min(miny,p[i].y);
        maxy=max(maxy,p[i].y);
        maxx=max(maxx,p[i].x);
    }
    int ans=0;
    for(int i=0;i<n;i++)
    {
        ans=max(ans,p[i].x-minx+p[i].y-miny);
        ans=max(ans,p[i].x-minx+maxy-p[i].y);
        ans=max(ans,maxx-p[i].x+maxy-p[i].y);
        ans=max(ans,maxx-p[i].x+p[i].y-miny);
    }
    printf("%d",ans);
    for(int i=4;i<=n;i++)printf(" %d",2*(maxx-minx+maxy-miny));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=3e5+10;
struct Point
{
    int x,y;
    bool operator==(const Point&A)const{return A.x==x&&A.y==y;}
    bool operator<(const Point&A)const
    {
        if(A.x==x)return y>A.y;
        return x>A.x;
    }
}p[MAX];
int dis(Point A,Point B){return abs(A.x-B.x)+abs(A.y-B.y);}
vector<Point>v;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)scanf("%d%d",&p[i].x,&p[i].y);
    int minx=1e9,miny=1e9;
    int maxx=-1e9,maxy=-1e9;
    for(int i=0;i<n;i++)
    {
        minx=min(minx,p[i].x);
        miny=min(miny,p[i].y);
        maxy=max(maxy,p[i].y);
        maxx=max(maxx,p[i].x);
    }
    for(int i=0;i<n;i++)
    {
        if(minx==p[i].x)v.push_back(p[i]);
        if(miny==p[i].y)v.push_back(p[i]);
        if(maxx==p[i].x)v.push_back(p[i]);
        if(maxy==p[i].y)v.push_back(p[i]);
    }
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
    int ans=0;
    for(int i=0;i<v.size();i++)
    for(int j=i+1;j<v.size();j++)
    for(int k=j+1;k<v.size();k++)ans=max(ans,dis(v[i],v[j])+dis(v[i],v[k])+dis(v[j],v[k]));
    printf("%d",ans);
    for(int i=4;i<=n;i++)printf(" %d",2*(maxx-minx+maxy-miny));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=3e5+10;
struct Point{int x,y;}p[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)scanf("%d%d",&p[i].x,&p[i].y);
    int minx=1e9,miny=1e9;
    int maxx=-1e9,maxy=-1e9;
    for(int i=0;i<n;i++)
    {
        minx=min(minx,p[i].x);
        miny=min(miny,p[i].y);
        maxy=max(maxy,p[i].y);
        maxx=max(maxx,p[i].x);
    }
    int ans=0;
    for(int i=0;i<n;i++)
    {
        ans=max(ans,p[i].x-minx+p[i].y-miny);
        ans=max(ans,p[i].x-minx+maxy-p[i].y);
        ans=max(ans,maxx-p[i].x+maxy-p[i].y);
        ans=max(ans,maxx-p[i].x+p[i].y-miny);
    }
    printf("%d",2*ans);
    for(int i=4;i<=n;i++)printf(" %d",2*(maxx-minx+maxy-miny));
	return 0;
}


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

const int N = 3e5 + 5;

int n, x[N], y[N], ans[N];

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n;
    int mnx = 2e9, mxx = -2e9, mny = 2e9, mxy = -2e9;
    for(int i = 1; i <= n; i++){
        cin >> x[i] >> y[i];
        mnx = min(mnx, x[i]);
        mxx = max(mxx, x[i]);
        mny = min(mny, y[i]);
        mxy = max(mxy, y[i]);
    }
    for(int i = 1; i <= n; i++){
        ans[3] = max(ans[3], mxx - x[i] + mxy - y[i]);
        ans[3] = max(ans[3], mxx - x[i] + y[i] - mny);
        ans[3] = max(ans[3], x[i] - mnx + y[i] - mny);
        ans[3] = max(ans[3], x[i] - mnx + mxy - y[i]);
    }
    ans[3] *= 2;
    for(int i = 4; i <= n; i++){
        ans[i] = (mxx - mnx + mxy - mny) * 2;
    }
    for(int i = 3; i <= n; i++){
        cout << ans[i] << " ";
    }
}


#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <random>
#include <chrono>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>

using namespace std;

class Solution {
public:
	vector<int> calc(vector<pair<int,int>>& pv, int n) {
		int maxX = INT_MIN, minX = INT_MAX, maxY = INT_MIN, minY = INT_MAX;
		for (auto& p : pv) {
			int x = p.first, y = p.second;
			maxX = max(maxX, x);
			minX = min(minX, x);
			maxY = max(maxY, y);
			minY = min(minY, y);
		}

		int ans1 = 2 * (maxX - minX + maxY - minY);

		vector<vector<int>> base;
		for (int i = 0; i < 3; ++i) {
			int a = i;
			int b = (i + 1) % 3;
			base.emplace_back(vector<int>{a, 1, b, -1});
		}

		vector<vector<int>> cs;
		vector<int> tmp(3, 0);
		dfs(0, base, tmp, cs);

		int ans0 = 0;
		for (auto xs : cs) {
			for (auto ys : cs) {
				vector<pair<int,int>> xys(3);
				xys[0] = make_pair(xs[0], ys[0]);
				xys[1] = make_pair(xs[1], ys[1]);
				xys[2] = make_pair(xs[2], ys[2]);
				ans0 = max(ans0, calc(pv, xys));
			}
		}

		vector<int> res(n - 2);
		res[0] = ans0;
		for (int i = 4, j = 1; i <= n; ++i, ++j) {
			res[j] = ans1;
		}

		return res;
	}

private:

	void dfs(int i, vector<vector<int>>& base, vector<int>& tmp, vector<vector<int>>& res) {
		if (i == base.size()) {
			res.push_back(tmp);
			return;
		}
		int a = base[i][0], da = base[i][1], b = base[i][2], db = base[i][3];
		tmp[a] += da;
		tmp[b] += db;
		dfs(i + 1, base, tmp, res);
		tmp[a] -= da;
		tmp[b] -= db;
		tmp[a] -= da;
		tmp[b] -= db;
		dfs(i + 1, base, tmp, res);
		tmp[a] += da;
		tmp[b] += db;
	}

	int calc(vector<pair<int,int>>& pv, vector<pair<int,int>>& cs) {
		int n = pv.size();
		int m = cs.size();
		if (n == 0 || m == 0) {
			return 0;
		}

		int res = 0;

		const int NINF = INT_MIN / 2;
		vector<int> cur(m + 1, NINF);
		cur[0] = 0;
		vector<int> nxt(m + 1, NINF);

		for (int i = 0; i < n; ++i) {
			cur[0] = 0;
			fill(nxt.begin(), nxt.end(), NINF);
			for (int j = 0; j <= i && j < m; ++j) {
				int num = pv[i].first * cs[j].first + pv[i].second * cs[j].second;
				nxt[j + 1] = max(cur[j + 1], cur[j] + num);
				// cout << "dp " << i << "," << j << "," << num << " -> "  << nxt[j + 1] << endl;
			}
			swap(cur, nxt);
		}

		for (auto num : cur) {
			res = max(res, num);
		}

		res = cur[m];
		// cout << "ans " << res << endl;
		return res;
	}
};

int main(int argc, char** argv) {
	ios::sync_with_stdio(false);
	cin.tie(0);

	Solution sol;
	int n;
	cin >> n;

	vector<pair<int,int>> pv;
	pv.reserve(n);

	for (int i = 0, x = 0, y = 0; i < n; ++i) {
		cin >> x >> y;
		pv.emplace_back(x, y);
	}

	auto res = sol.calc(pv, n);

	for (auto r : res) {
		cout << r << " ";
	}
	cout << endl;
	return 0;
}


#include<bits\stdc++.h>
using namespace std;
int x[300000], y[300000];
int MMMAX = 1000000000, MMMIN = -1000000000;
int main() {
    int n;
    cin >> n;
    int minx = MMMAX, miny = MMMAX, maxx = MMMIN, maxy = MMMIN;
    int pminx = 0, pminy = 0, pmaxx = 0, pmaxy = 0;
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
        if(x[i] > maxx){
            maxx = x[i];
            pmaxx = i;
        }
        if(x[i] < minx){
            minx = x[i];
            pminx = i;
        }
        if(y[i] > maxy){
            maxy = y[i];
            pmaxy = i;
        }
        if(y[i] < miny){
            miny = y[i];
            pminy = i;
        }
    }
    long long ans = 0;
    int mmmin = MMMAX;
    for(int i = 0; i < n; i++){
        int l = i, r = (i + 1) % n;
        ans += abs(x[l] - x[r]) + abs(y[l] - y[r]);
        mmmin = min( mmmin, min(maxx - x[i], x[i] - miny) + min(maxy - y[i], y[i] - miny));
    }
    cout << ans - 2*mmmin << " ";
    for(int i = 4; i <= n; i++){
        cout << ans << " ";
    }

    return 0;

}


#include<bits\stdc++.h>
using namespace std;
int x[300000], y[300000];
int MMMAX = 1000000000, MMMIN = -1000000000;
int main() {
    int n;
    cin >> n;
    int minx = MMMAX, miny = MMMAX, maxx = MMMIN, maxy = MMMIN;
    int pminx = 0, pminy = 0, pmaxx = 0, pmaxy = 0;
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
        if(x[i] > maxx){
            maxx = x[i];
            pmaxx = i;
        }
        if(x[i] < minx){
            minx = x[i];
            pminx = i;
        }
        if(y[i] > maxy){
            maxy = y[i];
            pmaxy = i;
        }
        if(y[i] < miny){
            miny = y[i];
            pminy = i;
        }
    }
    long long ans = 0;
    int mmmin = MMMAX;
    for(int i = 0; i < n; i++){
        int l = i, r = (i + 1) % n;
        ans += abs(x[l] - x[r]) + abs(y[l] - y[r]);
        mmmin = min( mmmin, min(maxx - x[i], x[i] - minx) + min(maxy - y[i], y[i] - miny));
    }
    cout << ans - 2*mmmin << " ";
    for(int i = 4; i <= n; i++){
        cout << ans << " ";
    }

    return 0;

}


#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <algorithm>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <set>
#include <cassert>
#include <unordered_map>
#include <iterator>
#include <functional>
#include <random>
#define MOD (ll)1e9 + 7
#define eps 1e-9
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
#define sz(a) a.size()
#define loop(i, n) for(long long (i) = 0; (i) < (n) ; ++ (i))
#define pii pair<int,int>
#define pll pair<long long,long long>
#define vii vector<int>
#define vll vector<long long>
typedef long long ll;
typedef long double ld;

using namespace std;

ll per(vector <pll>& v) {
    ll lx = v[0].ft;
    ll hx = v[0].ft;
    ll ly = v[0].sd;
    ll hy = v[0].sd;
    loop(i,sz(v)) {
        lx = min(lx, v[i].ft);
        hx = max(hx, v[i].ft);
        ly = min(ly, v[i].sd);
        hy = max(hy, v[i].sd);
    }

    return 2 * (hx - lx + hy - ly);
}

void solve() {
    ll n;
    cin >> n;
    vector <pll> v(n);

    loop(i,n) {
        cin >> v[i].ft >> v[i].sd;
    }

    if(n == 3) {
        cout << per(v) << endl;
        return;
    }

    ll lx = v[0].ft;
    ll hx = v[0].ft;
    ll ly = v[0].sd;
    ll hy = v[0].sd;

    loop(i,sz(v)) {
        lx = min(lx, v[i].ft);
        hx = max(hx, v[i].ft);
        ly = min(ly, v[i].sd);
        hy = max(hy, v[i].sd);
    }

    ll m3 = 0;
    loop(i,n) {
        vector<pll> tv(2);
        tv[0] = v[i];
        tv[1] = make_pair(lx, ly);
        m3 = max(m3, per(tv));
        tv[1] = make_pair(lx, hy);
        m3 = max(m3, per(tv));
        tv[1] = make_pair(hx, ly);
        m3 = max(m3, per(tv));
        tv[1] = make_pair(hx, hy);
        m3 = max(m3, per(tv));
    }

    cout << m3 << " ";
    ll m4 = per(v);
    loop(i, n - 3) {
        cout << m4 << " ";
    }
}

int main () {
    ios::sync_with_stdio(false);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    solve();

    return 0;
}


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

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

#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=(n-1); i>=0; --i)
#define forn(i,n) for(int i=1; i<=(n); ++i)
#define ford(i,n) for(int i=(n); i>=1; --i)

const int maxn = 1000;

void solve()
{
	int n; cin>>n;
	vector<pii> v(n);
	rep(i,n) cin>>v[i].st>>v[i].nd;
	int minx=v[0].st,maxx=v[0].st,miny=v[0].nd,maxy=v[0].nd;
	rep(i,n) {
		minx=min(minx,v[i].st);
		maxx=max(maxx,v[i].st);
		miny=min(miny,v[i].nd);
		maxy=max(maxy,v[i].nd);
	}
	int best=0;
	rep(i,n) {
		best=max(best,max(v[i].st-minx,maxx-v[i].st)+max(v[i].nd-miny,maxy-v[i].nd));
	}
	cout<<2*best;
	for(int i=4; i<=n; ++i) cout<<" "<<2*(maxx-minx+maxy-miny);
	cout<<"\n";
}

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


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

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

#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=(n-1); i>=0; --i)
#define forn(i,n) for(int i=1; i<=(n); ++i)
#define ford(i,n) for(int i=(n); i>=1; --i)

const int maxn = 100 * 1000 + 5;

int n;
pii v[maxn];
int P[maxn][3];

int check(int m) {
	int t[3][2];
	memset(t,0,sizeof t);
	rep(i,3) {
		if(m & (1<<(2*i))) {
			t[i][0]++;
			t[(i+1)%3][0]--;
		} else {
			t[i][0]--;
			t[(i+1)%3][0]++;
		}
		if(m & (1<<(2*i+1))) {
			t[i][1]++;
			t[(i+1)%3][1]--;
		} else {
			t[i][1]--;
			t[(i+1)%3][1]++;
		}
	}
	rep(i,n) rep(j,3) P[i][j]=t[j][0]*v[i].st+t[j][1]*v[i].nd;
	int b0,b1,b2;
	rep(i,n) {
		if(i==2) b2=b1+P[i][2];
		else b2=max(b2,b1+P[i][2]);
		if(i==1) b1=b0+P[i][1];
		else b1=max(b1,b0+P[i][1]);
		if(i==0) b0=P[i][0];
		else b0=max(b0,P[i][0]);
	}
	return b2;
}

void solve()
{
	cin>>n;
	rep(i,n) cin>>v[i].st>>v[i].nd;
	int mix=v[0].st,mx=v[0].st,miy=v[0].nd,my=v[0].nd;
	rep(i,n) {mix=min(mix,v[i].st);mx=max(mx,v[i].st);miy=min(miy,v[i].nd);my=max(my,v[i].nd);}
	int best=0;
	rep(i,(1<<6)) best=max(best,check(i));
	cout<<best;
	for(int i=4; i<=n; ++i) cout<<" "<<2*(mx-mix+my-miy);
	cout<<"\n";
}

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


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

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

#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=(n-1); i>=0; --i)
#define forn(i,n) for(int i=1; i<=(n); ++i)
#define ford(i,n) for(int i=(n); i>=1; --i)

const int maxn = 1000;

struct pt {
	int x, y;
};

void solve()
{
	int n; cin>>n;
	pt v[n];
	ll dis=0;
	rep(i,n) cin>>v[i].x>>v[i].y;
	auto check = [&](int i, int j) {return llabs(v[i].x-v[j].x)+llabs(v[i].y-v[j].y);};

	forn(i,n-1) dis+=check(i,i-1);
	dis+=check(0,n-1);
	int u=0,l=0,r=0,d=0;
	forn(i,n-1) {
		if(v[i].x<v[l].x) l=i;
		if(v[i].x>v[r].x) r=i;
		if(v[i].y>v[u].y) u=i;
		if(v[i].y<v[d].y) d=i;
	}
	ll ans[n+1];
	vi w;
	w.pb(u); w.pb(l); w.pb(r); w.pb(d);
	sort(w.begin(), w.end());
	auto it=unique(w.begin(), w.end());
	int m=distance(w.begin(),it);
	w.resize(m);
	for(int i=m; i<=n; ++i) ans[i]=dis;
	if(m==4) {
		ll best;
		for(int i=0; i<4; ++i) {
			int a=w[i], b=w[(i+1)%4], c=w[(i+2)%4];
			ll cur=check(a,b)+check(b,c)+check(c,a);
			if(i==0) best=cur;
			else best=max(best,cur);
		}
		ans[3]=best;
	}
	for(int i=3; i<=n; ++i) cout<<ans[i]<<" ";
	cout<<"\n";
}

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


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

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

#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=(n-1); i>=0; --i)
#define forn(i,n) for(int i=1; i<=(n); ++i)
#define ford(i,n) for(int i=(n); i>=1; --i)

const int maxn = 300 * 1000 + 5;

int n;
pii v[maxn];
int P[maxn][3];

int check(int m) {
	int t[3][2];
	memset(t,0,sizeof t);
	rep(i,3) {
		if(m & (1<<(2*i))) {
			t[i][0]++;
			t[(i+1)%3][0]--;
		} else {
			t[i][0]--;
			t[(i+1)%3][0]++;
		}
		if(m & (1<<(2*i+1))) {
			t[i][1]++;
			t[(i+1)%3][1]--;
		} else {
			t[i][1]--;
			t[(i+1)%3][1]++;
		}
	}
	rep(i,n) rep(j,3) P[i][j]=t[j][0]*v[i].st+t[j][1]*v[i].nd;
	int b0,b1,b2;
	rep(i,n) {
		if(i==2) b2=b1+P[i][2];
		else b2=max(b2,b1+P[i][2]);
		if(i==1) b1=b0+P[i][1];
		else b1=max(b1,b0+P[i][1]);
		if(i==0) b0=P[i][0];
		else b0=max(b0,P[i][0]);
	}
	return b2;
}

void solve()
{
	cin>>n;
	rep(i,n) cin>>v[i].st>>v[i].nd;
	int mix=v[0].st,mx=v[0].st,miy=v[0].nd,my=v[0].nd;
	rep(i,n) {mix=min(mix,v[i].st);mx=max(mx,v[i].st);miy=min(miy,v[i].nd);my=max(my,v[i].nd);}
	int best=0;
	rep(i,(1<<6)) best=max(best,check(i));
	cout<<best;
	for(int i=4; i<=n; ++i) cout<<" "<<2*(mx-mix+my-miy);
	cout<<"\n";
}

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


/*
 ID: bradyawn
 PROG: contest
 LANG: C++11
 */

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <vector>
#include <deque>
#include <string>
#include <cmath>
#include <map>
#include <unordered_map>
#include <utility>
#include <set>
#include <unordered_set>
#include <ctime>
#include <queue>
#include <stack>
#include <bitset>
#include <random>
#include <cstring>
#include <complex>
#include <cassert>

#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> i2;
typedef pair<ll,ll> ll2;

ll Ds(ll2 p1, ll2 p2)
{
    return abs(p1.fi-p2.fi) + abs(p1.se - p2.se);
}

ll Area(ll2 p1, ll2 p2, ll2 p3)
{
    if (p1.fi > p2.fi) return Area(p2, p1, p3);
    if (p2.fi > p3.fi) return Area(p1, p3, p2);
    return Ds(p1, p2) + Ds(p2, p3) + Ds(p3, p1);
}

int n;
int A, B, C, D;
int X[300001];
int Y[300001];

ll2 get(int i) { return make_pair(X[i], Y[i]); }

ll calc(ll2 p1, ll2 p2)
{
    ll ret = 0;
    for (int i = 1; i <= n; i++)
        ret = max(ret, Area(p1, p2, get(i)));
    return ret;
}

int main()
{
    //ifstream inf("");
    //ofstream outf("");
    cout << setprecision(10);
    ios::sync_with_stdio(0); cin.tie(0);

    cin >> n;
    for (int i = 1; i <= n; i++) cin >> X[i] >> Y[i];
    A = B = C = D = 1;

    for (int i = 1; i <= n; i++)
    {
        if (X[i] > X[A]) A = i; // A maximizes X[i]
        if (X[i] < X[B]) B = i; // B minimizes X[i]
        if (Y[i] > Y[C]) C = i; // C maximizes Y[i]
        if (Y[i] < Y[D]) D = i; // D minimizes Y[i]
    }

    ll f3 = max({
        calc(get(A),get(B)),
        calc(get(A),get(C)),
        calc(get(A),get(D)),
        calc(get(B),get(C)),
        calc(get(B),get(D)),
        calc(get(C),get(D))
    });
    ll f4 = 2*(X[A]-X[B]+Y[C]-Y[D]);

    for (int i = 3; i <= n; i++)
        if (i == 3) cout << f3 << " \n"[i==n];
        else cout << f4 << " \n"[i==n];

    return 0;

}

/*
 Read the problem carefully.
 Don't forget to sort(), mod, ll!!!!
 Initial value = +/- infinity instead of zero!!!
 */


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

const int N=3e5+5;

int x[N],y[N];

int main()
{
    int n;scanf("%d",&n);
    int mx_x=-1e9,mi_x=1e9,mx_y=-1e9,mi_y=1e9;
    for(int i=1;i<=n;i++)
    {
        scanf("%d%d",x+i,y+i);
        mx_x=max(x[i],mx_x);
        mi_x=min(x[i],mi_x);
        mx_y=max(y[i],mx_y);
        mi_y=min(y[i],mi_y);
    }
    int res4=2*(mx_x-mi_x+mx_y-mi_y);
    int res3=0;
    for(int i=1;i<=n;i++)
    {
        res3=max(res3,2*(x[i]-mi_x+y[i]-mi_y));
        res3=max(res3,2*(x[i]-mi_x+mx_y-y[i]));
        res3=max(res3,2*(mx_x-x[i]+y[i]-mi_y));
        res3=max(res3,2*(mx_x-x[i]+mx_y-y[i]));
    }
    printf("%d",res3);
    for(int i=4;i<=n;i++)
        printf(" %d",res4);
    printf("\n");
    return 0;
}


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

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//#define int ll
//#define endl '\n'

int n;
pii a[maxn];

int32_t main()
{
    IOS
    cin>>n;
    int xmax=-inf,xmin=inf,ymax=-inf,ymin=inf;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i].F>>a[i].S;
        xmax=max(xmax,a[i].F);
        xmin=min(xmin,a[i].F);
        ymax=max(ymax,a[i].S);
        ymin=min(ymin,a[i].S);
    }

    int ans3=-1;
    for (int i=1;i<=n;i++)
    {
        ans3=max(ans3,2*(xmax-a[i].F+ymax-a[i].S));
        ans3=max(ans3,2*(a[i].F-xmin+a[i].S-ymin));
    }
    cout<<ans3<<' ';
    for (int i=4;i<=n;i++) cout<<2*(xmax-xmin+ymax-ymin)<<' ';
    cout<<endl;
}


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

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//#define int ll
//#define endl '\n'

int n;
pii a[maxn];

int32_t main()
{
    IOS
    cin>>n;
    int xmax=-inf,xmin=inf,ymax=-inf,ymin=inf;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i].F>>a[i].S;
        xmax=max(xmax,a[i].F);
        xmin=min(xmin,a[i].F);
        ymax=max(ymax,a[i].S);
        ymin=min(ymin,a[i].S);
    }

    int ans3=-1;
    for (int i=1;i<=n;i++)
    {
        if (a[i].F<=xmax&&a[i].S<=ymax) ans3=max(ans3,2*(xmax-a[i].F+ymax-a[i].S));
        if (a[i].F>=xmin&&a[i].S>=ymin) ans3=max(ans3,2*(a[i].F-xmin+a[i].S-ymin));
    }
    cout<<ans3<<' ';
    for (int i=4;i<=n;i++) cout<<2*(xmax-xmin+ymax-ymin)<<' ';
    cout<<endl;
}


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

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//#define int ll
//#define endl '\n'

int n;
pii a[maxn];

int32_t main()
{
    IOS
    cin>>n;
    int xmax=-inf,xmin=inf,ymax=-inf,ymin=inf;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i].F>>a[i].S;
        xmax=max(xmax,a[i].F);
        xmin=min(xmin,a[i].F);
        ymax=max(ymax,a[i].S);
        ymin=min(ymin,a[i].S);
    }

    int ans3=-1;
    for (int i=1;i<=n;i++)
    {
        ans3=max(ans3,2*(xmax-a[i].F+ymax-a[i].S));
        ans3=max(ans3,2*(a[i].F-xmin+a[i].S-ymin));
        ans3=max(ans3,2*(xmax-a[i].F+a[i].S-ymin));
        ans3=max(ans3,2*(a[i].F-xmin+ymax-a[i].S));
    }
    cout<<ans3<<' ';
    for (int i=4;i<=n;i++) cout<<2*(xmax-xmin+ymax-ymin)<<' ';
    cout<<endl;
}


// dile a la jardinera que traigo flores
#include <bits/stdc++.h>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define sz(x) int(x.size())
#define fill(x,v) memset(x,v,sizeof(x))
#define FER(i,a,b) for(int i = int(a); i < int(b); ++i)
#define trace(x) cout << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define N 1024
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;

int dist(ii a, ii b){
	return abs(a.ff-b.ff)+abs(a.ss-b.ss);
}

int solve2(vector<ii> &vec){
	FER(i,0,3){
		//trace(i);
		//trace(vec[i].ff);
		//trace(vec[i].ss);
	}
	//trace(dist(vec[0],vec[1]) + dist(vec[1],vec[2]) + dist(vec[2],vec[0]));
	return dist(vec[0],vec[1]) + dist(vec[1],vec[2]) + dist(vec[2],vec[0]);
}

int solve(vector<ii> &vec){
	int ans = INT_MIN;
	FER(i,0,4){
		//trace(i);
		//trace(vec[i].ff);
		//trace(vec[i].ss);
	}
	for(int i = 0; i < 16; ++i){
		if(__builtin_popcount(i) == 3){
			vector<ii> v;
			for(int j = 0; j < 4; ++j)
				if(i&(1<<j)) v.pb(vec[j]);
			ans = max(ans,solve2(v));
		}
	}
	return ans;
}

int main(){

	fastio;
	int n,a,b;
	cin >> n;

	int mxx = INT_MIN ,mnx = INT_MAX,mxy = INT_MIN,mny = INT_MAX;
	ii top,bot,izq,der;
	FER(i,0,n){
		cin >> a >> b;
		if(b > mxy) top = ii(a,b);
		if(b < mny) bot = ii(a,b);
		if(a > mxx) der = ii(a,b);
		if(a < mnx) izq = ii(a,b);
		mxx = max(mxx,a);
		mnx = min(mnx,a);
		mxy = max(mxy,b);
		mny = min(mny,b);
	}

	vector<ii> vec;
	vec.pb(top); vec.pb(bot);
	vec.pb(izq); vec.pb(der);
	cout << solve(vec);

	int res = 2*(mxx-mnx+mxy-mny);
	FER(i,4,n+1) cout << " " << res;
	cout << endl;

	return 0;
}


// dile a la jardinera que traigo flores
#include <bits/stdc++.h>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define sz(x) int(x.size())
#define fill(x,v) memset(x,v,sizeof(x))
#define FER(i,a,b) for(int i = int(a); i < int(b); ++i)
#define trace(x) cout << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;

int n;

int dist(ii a, ii b){
	return abs(a.ff-b.ff) + abs(a.ss-b.ss);
}

int solve(ii a, ii b, ii c){
	return dist(a,b) + dist(b,c) + dist(c,a);
}

int main(){

	fastio;
	cin >> n;
	int a,b;
	ii top(0,INT_MIN),bot(0,INT_MAX),izq(INT_MAX,0),der(INT_MIN,0);
	vector<ii> pts;
	FER(i,0,n){
		cin >> a >> b;
		pts.pb(ii(a,b));
		if(b > top.ss) top = ii(a,b);
		if(b < bot.ss) bot = ii(a,b);
		if(a > der.ff) der = ii(a,b);
		if(a < izq.ff) izq = ii(a,b);
	}

	vector<ii> vec;
	vec.pb(top); vec.pb(der);
	vec.pb(bot); vec.pb(izq); vec.pb(top);

	int ans = INT_MIN;
	for(int i = 0; i < sz(vec)-1; ++i){
		for(ii p : pts){
			ans = max(ans,solve(p,vec[i],vec[i+1]));
		}
	}
	cout << ans;
	ans = 2*(top.ss-bot.ss+der.ff-izq.ff);
	FER(i,4,n+1) cout << " " << ans; cout << endl;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

#define MAXIMUM ( 1 << 31 ) - 1
#define MINIMUM ( 1 << 31 )
#define pb push_back
#define endl '\n'

typedef long long ll;
using namespace std;

const int maxN=2000;
int n,arr[maxN+1];
vector<int> abc[maxN+1],abd;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        if(abc[arr[i]].size()==0)
            abd.push_back(arr[i]);
        if(abc[arr[i]].size()==1)
            count++;

        abc[arr[i]].push_back(i);
    }
    sort(abd.begin(),abd.end());
    int count1=1;
    for(int i=0;i<abd.size();i++)
    {
        count1=count1*(abc[abd[i]].size());
        if(count1>=3)
            break;
    }
    if(count1<3)
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
        for(int i=0;i<abd.size();i++)
        {
            for(int j=0;j<abc[abd[i]].size();j++)
            {
                cout << abc[abd[i]][j] +1<<" ";
            }
        }
        int flag=0;
        cout<<endl;
        for(int i=0;i<abd.size();i++)
        {
            if(abc[abd[i]].size()>1&&flag==0)
            {
                cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                flag =1;
                if(abc[abd[i]].size()>2)
                    for(int j=2;j<abc[abd[i]].size();j++)
                        cout<<abc[abd[i]][j]+1<<" " ;
            }
            else
            {
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
        flag=0;
        int flag1=0;
        for(int i=0;i<abd.size();i++)
        {
            if((abc[abd[i]].size()>1&&flag==1||count==1)&&flag1==0)
            {
                flag1=1;
                if(arr[abc[abd[i]][1]]!=arr[abc[abd[i]][0]]&&count!=1)
                {
                    cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                    flag =2;
                    if(abc[abd[i]].size()>2)
                        for(int j=2;j<abc[abd[i]].size();j++)
                            cout<<abc[abd[i]][j]+1<<" " ;
                }
                else
                {
                    cout<<abc[abd[i]][2]+1<<" " <<abc[abd[i]][1]+1<<" " ;
                    cout<<abc[abd[i]][0]+1<<" " ;
                    if(abc[abd[i]].size()>3)
                        for(int j=3;j<abc[abd[i]].size();j++)
                            cout<<abc[abd[i]][j]+1<<" " ;
                }
            }
            else
            {
                if(abc[abd[i]].size()>1)
                    flag++;
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;

struct node {
    int val;
    int id;
};
bool cmp(struct node x,struct node y) {
    return (x.val < y.val);
}
int main() {
    int n;
    scanf("%d",&n);
    vector <node> a(n);
    int rf[2001];
    for (int i = 0; i <= 2000; i++)
        rf[i] = 0;
    for (int i = 0; i < n; i++) {
        int temp;
        scanf("%d",&temp);
        rf[temp] = rf[temp] + 1;
        a[i].val = temp;
        a[i].id = i;
    }
    int ans = 1;
    for (int i = 1; i <= 2000; i++) {
        if (rf[i] != 0)
        ans *= rf[i];
        if (ans >= 3)
            break;
    }
    if (ans < 3) {
        printf("NO\n");
    }
    else {
        printf("YES\n");
        sort(a.begin(),a.end(),cmp);
        for (int i = 0; i < n; i++) {
            printf("%d ",a[i].id+1);
            int temp = a[i].val;
        }
        printf("\n");
        int f = 1,v;
        for (int i = 0; i < n; i++) {
            int temp = a[i].val;
            if (rf[temp] > 1 && f) {
                v = temp;
                printf("%d ",a[i+1].id+1);
                printf("%d ",a[i].id+1);
                rf[temp] = rf[temp]- 1;
                i++;
                f = 0;
            }
            else {
                printf("%d ",a[i].id+1);
            }
        }
        printf("\n");
        f = 1;
        for (int i = 0; i < n; i++) {
            int temp = a[i].val;
            if (rf[temp] > 1 && f) {
                if (v == temp) {
                    printf("%d %d %d ",a[i+2].id+1,a[i+1].id+1,a[i].id+1);
                    i = i+2;
                    f = 0;
                }
                else if (f) {
                    printf("%d %d ",a[i+1].id+1,a[i].id+1);
                    i += 1;
                    f = 0;
                }
            }
            else {
                printf("%d ",a[i].id+1);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

#define MAXIMUM ( 1 << 31 ) - 1
#define MINIMUM ( 1 << 31 )
#define pb push_back
#define endl '\n'

typedef long long ll;
using namespace std;

const int maxN=2000;
int n,arr[maxN+1];
vector<int> abc[maxN+1],abd;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        if(abc[arr[i]].size()==0)
            abd.push_back(arr[i]);
        if(abc[arr[i]].size()==1)
            count++;

        abc[arr[i]].push_back(i);
    }
    sort(abd.begin(),abd.end());
    int count1=1;
    for(int i=0;i<abd.size();i++)
    {
        count1=count1*(abc[abd[i]].size());
        if(count1>=3)
            break;
    }
    if(count1<3)
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
        for(int i=0;i<abd.size();i++)
        {
            for(int j=0;j<abc[abd[i]].size();j++)
            {
                cout << abc[abd[i]][j] +1<<" ";
            }
        }
        int flag=0;
        cout<<endl;
        for(int i=0;i<abd.size();i++)
        {
            if(abc[abd[i]].size()>1&&flag==0)
            {
                cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                flag =1;
                if(abc[abd[i]].size()>2)
                    for(int j=2;j<abc[abd[i]].size();j++)
                        cout<<abc[abd[i]][j]+1<<" " ;
            }
            else
            {
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
        flag=0;
        int flag1=0;
        for(int i=0;i<abd.size();i++)
        {
            if((abc[abd[i]].size()>1&&flag==1||count==1)&&flag1==0)
            {
                flag1=1;
                if(count!=1)
                {
                    cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                    flag =2;
                    if(abc[abd[i]].size()>2)
                        for(int j=2;j<abc[abd[i]].size();j++)
                            cout<<abc[abd[i]][j]+1<<" " ;
                }
                else
                {
                    cout<<abc[abd[i]][2]+1<<" " <<abc[abd[i]][1]+1<<" " ;
                    cout<<abc[abd[i]][0]+1<<" " ;
                    if(abc[abd[i]].size()>3)
                        for(int j=3;j<abc[abd[i]].size();j++)
                            cout<<abc[abd[i]][j]+1<<" " ;
                }
            }
            else
            {
                if(abc[abd[i]].size()>1)
                    flag++;
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

#define MAXIMUM ( 1 << 31 ) - 1
#define MINIMUM ( 1 << 31 )
#define pb push_back
#define endl '\n'

typedef long long ll;
using namespace std;

const int maxN=2000;
int n,arr[maxN+1];
vector<int> abc[maxN+1],abd;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        if(abc[arr[i]].size()==0)
            abd.push_back(arr[i]);
        if(abc[arr[i]].size()==1)
            count++;

        abc[arr[i]].push_back(i);
    }
    sort(abd.begin(),abd.end());
    if(count<2)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        for(int i=0;i<abd.size();i++)
        {
            for(int j=0;j<abc[abd[i]].size();j++)
            {
                cout << abc[abd[i]][j] +1<<" ";
            }
        }
        int flag=0;
        cout<<endl;
        for(int i=0;i<abd.size();i++)
        {
            if(abc[abd[i]].size()>1&&flag==0)
            {
                cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                flag =1;
                if(abc[abd[i]].size()>2)
                    for(int j=2;j<abc[abd[i]].size();j++)
                        cout<<abc[abd[i]][j]+1<<" " ;
            }
            else
            {
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
        flag=0;
        for(int i=0;i<abd.size();i++)
        {
            if(abc[abd[i]].size()>1&&flag==1)
            {
                cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                flag =2;
                if(abc[abd[i]].size()>2)
                    for(int j=2;j<abc[abd[i]].size();j++)
                        cout<<abc[abd[i]][j]+1<<" " ;
            }
            else
            {
                if(abc[abd[i]].size()>1)
                    flag++;
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;

    }

    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

#define MAXIMUM ( 1 << 31 ) - 1
#define MINIMUM ( 1 << 31 )
#define pb push_back
#define endl '\n'

typedef long long ll;
using namespace std;

const int maxN=2000;
int n,arr[maxN+1];
vector<int> abc[maxN+1],abd;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        if(abc[arr[i]].size()==0)
            abd.push_back(arr[i]);
        if(abc[arr[i]].size()==1)
            count++;

        abc[arr[i]].push_back(i);
    }
    sort(abd.begin(),abd.end());
    int count1=1;
    for(int i=0;i<abd.size();i++)
    {
        count1=count1*(abc[abd[i]].size());
        if(count1>=3)
            break;
    }
    if(count1<3)
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
        for(int i=0;i<abd.size();i++)
        {
            for(int j=0;j<abc[abd[i]].size();j++)
            {
                cout << abc[abd[i]][j] +1<<" ";
            }
        }
        int flag=0;
        cout<<endl;
        for(int i=0;i<abd.size();i++)
        {
            if(abc[abd[i]].size()>1&&flag==0)
            {
                cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                flag =1;
                if(abc[abd[i]].size()>2)
                    for(int j=2;j<abc[abd[i]].size();j++)
                        cout<<abc[abd[i]][j]+1<<" " ;
            }
            else
            {
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
        flag=0;
        for(int i=0;i<abd.size();i++)
        {
            if(abc[abd[i]].size()>1&&flag==1)
            {
                cout<<abc[abd[i]][1]+1<<" " <<abc[abd[i]][0]+1<<" " ;
                flag =2;
                if(abc[abd[i]].size()>2)
                    for(int j=2;j<abc[abd[i]].size();j++)
                        cout<<abc[abd[i]][j]+1<<" " ;
            }
            else
            {
                if(abc[abd[i]].size()>1)
                    flag++;
                for(int j=0;j<abc[abd[i]].size();j++)
                    cout<<abc[abd[i]][j]+1<<" " ;
            }
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector <pair<int,int> > tab;
    for(int i=0;i<n;++i){
    int a;
    cin >> a;
    tab.push_back(make_pair(a,i+1));
    }
    sort(tab.begin(),tab.end());
    int r=0;
    for(int i=0;i<n-1;++i){
    if (tab[i].first==tab[i+1].first) r++;
    }
    if (r<2) cout << "NO\n" ;
    else {
    cout << "YES\n";
    int t=3,loc=0;
    while(t--){
    for(int i=0;i<n-1;++i){
    cout << tab[i].second << ' ';
    }
    cout << tab[n-1].second << endl;

    for(int i=loc;i<n-1;++i){
    if (tab[i].first==tab[i+1].first) {
   swap (tab[i].second,tab[i+1].second);
   loc=i+1;
    break;
    }
    }
    }}
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector <pair<int,int> > tab;
    for(int i=0;i<n;++i){
    int a;
    cin >> a;
    tab.push_back(make_pair(a,i+1));
    }
    sort(tab.begin(),tab.end());
    int r=0;
    for(int i=0;i<n-1;++i){
    if (tab[i].first==tab[i+1].first) r++;
    }
    if (r<2) cout << "NO\n" ;
    else {
    cout << "Yes\n";
    int t=3,loc=0;
    while(t--){
    for(int i=0;i<n-1;++i){
    cout << tab[i].second << ' ';
    }
    cout << tab[n-1].second << endl;

    for(int i=loc;i<n-1;++i){
    if (tab[i].first==tab[i+1].first) {
   swap (tab[i].second,tab[i+1].second);
   loc=i+1;
    break;
    }
    }
    }}
    return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 2005
using namespace std;
struct node{
	int h;
	int p;
};

node nd[N];

int vis[N];

bool cmp(node a, node b){
	return a.h < b.h;
}

void swap(int *p, int *q){
	int t = *p;
	*p = *q;
	*q = t;
}

int main(){
	int n;
	scanf("%d", &n);
	for(int i=1; i<=n; ++i){
		scanf("%d", &nd[i].h);
		nd[i].p=i;
	}
	sort(nd+1, nd+n+1, cmp);
	int cnt = 0;
	for(int i=1; i<n; ++i){
		for(int j=i+1; j<=n; ++j)
			if(nd[i].h == nd[j].h)
			    ++cnt;
			else{ i=j-1; break; }
	}

	if(cnt<2) cout<<"NO"<<endl;
	else{
		 cout<<"YES"<<endl;
		 cout<<nd[1].p;
		 for(int i=2; i<=n; ++i)
		 	cout<<" "<<nd[i].p;
		 cout<<endl;
		 int p;
		 for(int i=1; i<n; ++i)
		 	if( nd[i].h == nd[i+1].h){
			 	p = i;
			 	swap(&nd[i].p, &nd[i+1].p);
			 	break;
			}
		 cout<<nd[1].p;
		 for(int i=2; i<=n; ++i)
		 	cout<<" "<<nd[i].p;
		 cout<<endl;
		for(int i=1; i<n; ++i)
		 	if( nd[i].h == nd[i+1].h && i != p){
			 	swap(&nd[i].p, &nd[i+1].p);
			 	break;
			}

		 cout<<nd[1].p;
		 for(int i=2; i<=n; ++i)
		 	cout<<" "<<nd[i].p;
		 cout<<endl;
	}

	return 0;
}


//#include<iostream>
//#include<cstring>
//#include<cstdio>
//#include<algorithm>
//#define N 200
//using namespace std;
//
//int main(){
//  int a[6];
//  for(int i=0; i<6; ++i)
//      scanf("%d", &a[i]);
//  sort(a, a+6);
//  int cnt = 0;
//  for(int i=0; i<5; ++i)
//      if(a[i] == a[i+1]){
//          a[i] = a[i+1] = -1;
//          ++cnt;
//      }
//  if(cnt < 2)
//     cout<<"Alien"<<endl;
//  else{
//      if(cnt == 3)
//          cout<<"Elephant"<<endl;
//      else cout<<"Bear"<<endl;
//  }
//
//  return 0;
//}

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 2005
using namespace std;
struct node{
    int h;
    int p;
};

node nd[N];

int vis[N];

bool cmp(node a, node b){
    return a.h < b.h;
}

void swap(int *p, int *q){
    int t = *p;
    *p = *q;
    *q = t;
}

int main(){
    int n;
    scanf("%d", &n);
    for(int i=1; i<=n; ++i){
        scanf("%d", &nd[i].h);
        nd[i].p=i;
    }
    sort(nd+1, nd+n+1, cmp);
    int cnt = 0;
    for(int i=1; i<n; ++i){
        if(nd[i].h == nd[i+1].h){
            nd[i].h = nd[i+1].h = -1;
            ++cnt;
        }
    }

    if(cnt<2) cout<<"NO"<<endl;
    else{
        cout<<"YES"<<endl;
        cout<<nd[1].p;
        for(int i = 2; i <= n; ++i)
            cout<<" "<<nd[i].p;
        cout<<endl;
        for(int i=1; i<n; ++i)
            if(nd[i].h == nd[i+1].h && nd[i].h==-1){
                swap(&nd[i].p, &nd[i+1].p);
                nd[i].h = nd[i+1].h = -2;
                break;
            }
        cout<<nd[1].p;
            for(int i = 2; i <= n; ++i)
            cout<<" "<<nd[i].p;
        cout<<endl;
        for(int i=1; i<n; ++i)
            if(nd[i].h == nd[i+1].h && nd[i].h==-1){
                swap(&nd[i].p, &nd[i+1].p);
                nd[i].h = nd[i+1].h = -2;
                break;
            }
            cout<<nd[1].p;
            for(int i = 2; i <= n; ++i)
            cout<<" "<<nd[i].p;
    }

    return 0;
}


//#include<iostream>
//#include<cstring>
//#include<cstdio>
//#include<algorithm>
//#define N 200
//using namespace std;
//
//int main(){
//  int a[6];
//  for(int i=0; i<6; ++i)
//      scanf("%d", &a[i]);
//  sort(a, a+6);
//  int cnt = 0;
//  for(int i=0; i<5; ++i)
//      if(a[i] == a[i+1]){
//          a[i] = a[i+1] = -1;
//          ++cnt;
//      }
//  if(cnt < 2)
//     cout<<"Alien"<<endl;
//  else{
//      if(cnt == 3)
//          cout<<"Elephant"<<endl;
//      else cout<<"Bear"<<endl;
//  }
//
//  return 0;
//}

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 2005
using namespace std;
struct node{
    int h;
    int p;
};

node nd[N];

int vis[N];

bool cmp(node a, node b){
    return a.h < b.h;
}

void swap(int *p, int *q){
    int t = *p;
    *p = *q;
    *q = t;
}

int main(){
    int n;
    scanf("%d", &n);
    for(int i=1; i<=n; ++i){
        scanf("%d", &nd[i].h);
        nd[i].p=i;
    }
    sort(nd+1, nd+n+1, cmp);
    int cnt = 0;
    for(int i=1; i<n; ++i){
        if(nd[i].h == nd[i+1].h){
            nd[i].h = nd[i+1].h = -1;
            ++cnt;
        }
    }

    if(cnt<2) cout<<"NO"<<endl;
    else{
        cout<<"YES"<<endl;
        cout<<nd[1].p;
        for(int i = 2; i <= n; ++i)
            cout<<" "<<nd[i].p;
        cout<<endl;
        for(int i=1; i<n; ++i)
            if(nd[i].h == nd[i+1].h && nd[i].h==-1){
                swap(&nd[i].p, &nd[i+1].p);
                nd[i].h = nd[i].h = -2;
                break;
            }
        cout<<nd[1].p;
            for(int i = 2; i <= n; ++i)
            cout<<" "<<nd[i].p;
        cout<<endl;
        for(int i=1; i<n; ++i)
            if(nd[i].h == nd[i+1].h && nd[i].h==-1){
                swap(&nd[i].p, &nd[i+1].p);
                nd[i].h = nd[i].h = -2;
                break;
            }
            cout<<nd[1].p;
            for(int i = 2; i <= n; ++i)
            cout<<" "<<nd[i].p;
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
const int MAX_N = 2000;
pair<int, int> affairs_sorter[MAX_N];
int affairs[MAX_N];
int order[3][MAX_N];

void print (int n)
{
    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < n; ++j)
            cout<<order[i][j]+1<<" ";
        cout<<endl;
    }
}

int main()
{
    int n = 0;
    cin>>n;
    for (int i= 0; i < n; ++i)
    {
        cin>>affairs_sorter[i].first;
        affairs[i] = affairs_sorter[i].first;
        affairs_sorter[i].second = i;
    }
    sort(affairs_sorter,affairs_sorter+n);
    for (int i = 0; i < n; ++i)
    {
        order[0][i] = order[1][i] = order[2][i] = affairs_sorter[i].second;

    }
    int i = 0;
    for (int j = 0; j < n-1; ++j)
    {
        if (affairs[order[i][j]] == affairs[order[i][j+1]])
        {
            for (int k = i + 1; k < 3; ++k)
            {
                swap(order[k][j], order[k][j+1]);

            }
            ++i;
            if (i==2)
                break;
        }
    }
    if (i==2)
    {
        cout<<"YES"<<endl;
        print(n);
    }
    else cout<<"NO"<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
const int MAX_N = 2000;
pair<int, int> affairs_sorter[MAX_N];
int affairs[MAX_N];
int order[3][MAX_N];

void print (int n)
{
    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < n; ++j)
            cout<<order[i][j]+1<<" ";
        cout<<endl;
    }
}

int main()
{
    int n = 0;
    cin>>n;
    for (int i= 0; i < n; ++i)
    {
        cin>>affairs_sorter[i].first;
        affairs[i] = affairs_sorter[i].first;
        affairs_sorter[i].second = i;
    }
    sort(affairs_sorter,affairs_sorter+n);
    for (int i = 0; i < n; ++i)
    {
        order[0][i] = order[1][i] = order[2][i] = affairs_sorter[i].second;

    }
    int i = 0;
    for (int j = 0; j < n-1; ++j)
    {
        if (affairs[order[i][j]] == affairs[order[i][j+1]])
        {
            for (int k = i + 1; k < 3; ++k)
            {
                swap(order[k][j], order[k][j+1]);

            }
            ++i;
        }
    }
    if (i==2)
    {
        cout<<"YES"<<endl;
        print(n);
    }
    else cout<<"NO"<<endl;
}