#include <iostream>
#include <bits/stdc++.h>
#include <vector>
// #include <chrono>
// #include <string>
#include <algorithm>

using namespace std;
// using namespace std::chrono;

// typedef std::chrono::high_resolution_clock::time_point timen;
typedef long long ll;
typedef long double ld;

#define duration(a) std::chrono::duration_cast<std::chrono::nanoseconds>(a).count()
#define timeNow() std::chrono::high_resolution_clock::now()
#define f(i, n) for(int (i)=0; (i)<(n); (i)++)
#define frp(i, a, b) for(int (i)=a; (i)<(b); (i)++)
#define frn(i, a, b) for(int (i)=a; (i)>(b); (i)--)
#define pb(a) push_back(a)

#define p(aaa) cout<<"debug "<<aaa<<endl;
#define PI 3.14159265358979323846

const int mod=1e9+7;
const int mx=1e3;

struct s
{
	int v;
	int len;
	int rose;
	int lily;
	vector<int> adj;
};

int n, m, tl, tr;
vector<struct s> a;
vector<int> g;
vector<int> l, r, fri;

bool complen(const s &a, const s &b){
	return a.len<b.len;
}

void putflowers(int t, int p){

	while(!a[t].adj.empty()){
		// cout<<a[t].adj.back()<<endl;
		putflowers(a[t].adj.back(), t);
		a[t].adj.pop_back();
	}
	// check which location are filled, fill the remaining
	// subtract from a[p].rose and a[p].lily
	// check which locations are filled fill the remaining with a[p].rose and a[p].lily
	frp(j, l[a[t].v]-1, r[a[t].v]){
		// cout<<g[j]<<" "<<a[t].rose<<endl;
		if(g[j]==0) a[t].rose-=1;
		else if(g[j]==1) a[t].lily-=1;
	}
	frp(j, l[a[t].v]-1, r[a[t].v]){
		if(a[t].rose+a[t].lily>0 && g[j]==-1){
			if(a[t].rose>0){g[j]=0; a[t].rose-=1;}
			else {g[j]=1; a[t].lily-=1;}
		}
	}
	return;
}

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

	s tmp;

	cin>>n>>m;
	f(i, n) g.pb(-1);

	f(i, m){
		cin>>tl>>tr;
		l.pb(tl);
		r.pb(tr);
		tmp.v=i;
		tmp.len=r[i]-l[i]+1;
		tmp.rose=(r[i]-l[i]+1)/2;
		tmp.lily=(r[i]-l[i]+2)/2;
		a.pb(tmp);
	}
	sort(a.begin(), a.end(), complen);

	f(i, m-1){
		int flag=0;
		frp(j, i+1, m){
			if(r[a[i].v]<=r[a[j].v] && l[a[i].v]>=l[a[j].v]){
			// cout<<r[a[i].v]<<" "<<r[a[j].v]<<" "<<l[a[i].v]<<" "<<l[a[j].v]<<endl;
				a[j].adj.pb(a[i].v);
				flag=1;
				break;
			}
		}
		if(flag==0) fri.pb(i);
	}
	fri.pb(m-1);
	// cout<<"hello"<<endl;
	f(i, fri.size()){
		// cout<<fri[i]<<endl;
		putflowers(fri[i], -1);
	}

	f(i, n) if(g[i]==-1) g[i]=1;
	f(i, n) cout<<g[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <vector>
// #include <chrono>
// #include <string>
#include <algorithm>

using namespace std;
// using namespace std::chrono;

// typedef std::chrono::high_resolution_clock::time_point timen;
typedef long long ll;
typedef long double ld;

#define duration(a) std::chrono::duration_cast<std::chrono::nanoseconds>(a).count()
#define timeNow() std::chrono::high_resolution_clock::now()
#define f(i, n) for(int (i)=0; (i)<(n); (i)++)
#define frp(i, a, b) for(int (i)=a; (i)<(b); (i)++)
#define frn(i, a, b) for(int (i)=a; (i)>(b); (i)--)
#define pb(a) push_back(a)

#define p(aaa) cout<<"debug "<<aaa<<endl;
#define PI 3.14159265358979323846

const int mod=1e9+7;
const int mx=1e3;

struct s
{
	int v;
	int len;
	int rose;
	int lily;
	vector<int> adj;
};

int n, m, tl, tr;
vector<struct s> a;
vector<int> g;
vector<int> l, r, fri;

bool complen(const s &a, const s &b){
	return a.len<b.len;
}

void putflowers(int t, int p){

	while(!a[t].adj.empty()){
		// cout<<a[t].adj.back()<<endl;
		putflowers(a[t].adj.back(), t);
		a[t].adj.pop_back();
	}
	// check which location are filled, fill the remaining
	// subtract from a[p].rose and a[p].lily
	// check which locations are filled fill the remaining with a[p].rose and a[p].lily
	frp(j, l[a[t].v]-1, r[a[t].v]){
		// cout<<g[j]<<" "<<a[t].rose<<endl;
		if(g[j]==0) a[t].rose-=1;
		else if(g[j]==1) a[t].lily-=1;
	}
	frp(j, l[a[t].v]-1, r[a[t].v]){
		if(a[t].rose+a[t].lily>0 && g[j]==-1){
			if(a[t].rose>0){g[j]=0; a[t].rose-=1;}
			else {g[j]=1; a[t].lily-=1;}
		}
	}
	return;
}

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

	s tmp;

	cin>>n>>m;
	f(i, n) g.pb(-1);

	f(i, m){
		cin>>tl>>tr;
		l.pb(tl);
		r.pb(tr);
		if(m>100) cout<<tl<<" "<<tr<<" ";
		tmp.v=i;
		tmp.len=r[i]-l[i]+1;
		tmp.rose=(r[i]-l[i]+1)/2;
		tmp.lily=(r[i]-l[i]+2)/2;
		a.pb(tmp);
	}
	sort(a.begin(), a.end(), complen);

	f(i, m-1){
		int flag=0;
		frp(j, i+1, m){
			if(r[a[i].v]<=r[a[j].v] && l[a[i].v]>=l[a[j].v]){
			// cout<<r[a[i].v]<<" "<<r[a[j].v]<<" "<<l[a[i].v]<<" "<<l[a[j].v]<<endl;
				a[j].adj.pb(a[i].v);
				flag=1;
				break;
			}
		}
		if(flag==0) fri.pb(i);
	}
	fri.pb(m-1);
	// cout<<"hello"<<endl;
	f(i, fri.size()){
		// cout<<fri[i]<<endl;
		putflowers(fri[i], -1);
	}

	f(i, n) if(g[i]==-1) g[i]=1;
	f(i, n) cout<<g[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <vector>
// #include <chrono>
// #include <string>
#include <algorithm>

using namespace std;
// using namespace std::chrono;

// typedef std::chrono::high_resolution_clock::time_point timen;
typedef long long ll;
typedef long double ld;

#define duration(a) std::chrono::duration_cast<std::chrono::nanoseconds>(a).count()
#define timeNow() std::chrono::high_resolution_clock::now()
#define f(i, n) for(int (i)=0; (i)<(n); (i)++)
#define frp(i, a, b) for(int (i)=a; (i)<(b); (i)++)
#define frn(i, a, b) for(int (i)=a; (i)>(b); (i)--)
#define pb(a) push_back(a)

#define p(aaa) cout<<"debug "<<aaa<<endl;
#define PI 3.14159265358979323846

const int mod=1e9+7;
const int mx=1e3;

struct s
{
	int v;
	int len;
	int rose;
	int lily;
	vector<int> adj;
};

int n, m, tl, tr;
vector<struct s> a;
vector<int> g;
vector<int> l, r, fri;

bool complen(const s &a, const s &b){
	return a.len<b.len;
}

void putflowers(int t, int p){

	while(!a[t].adj.empty()){
		// cout<<a[t].adj.back()<<endl;
		putflowers(a[t].adj.back(), t);
		a[t].adj.pop_back();
	}
	// check which location are filled, fill the remaining
	// subtract from a[p].rose and a[p].lily
	// check which locations are filled fill the remaining with a[p].rose and a[p].lily
	frp(j, l[a[t].v]-1, r[a[t].v]){
		// cout<<g[j]<<" "<<a[t].rose<<endl;
		if(g[j]==0) a[t].rose-=1;
		else if(g[j]==1) a[t].lily-=1;
		else{
			if(a[t].rose>0){g[j]=0; a[t].rose-=1;}
			else {g[j]=1; a[t].lily-=1;}
		}
		// cout<<j<<" "<<g[j]<<" "<<a[t].rose<<endl;

	}
	return;
}

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

	s tmp;

	cin>>n>>m;
	f(i, n) g.pb(-1);

	f(i, m){
		cin>>tl>>tr;
		l.pb(tl);
		r.pb(tr);
		tmp.v=i;
		tmp.len=r[i]-l[i]+1;
		tmp.rose=(r[i]-l[i]+1)/2;
		tmp.lily=(r[i]-l[i]+2)/2;
		a.pb(tmp);
	}
	sort(a.begin(), a.end(), complen);

	f(i, m-1){
		int flag=0;
		frp(j, i+1, m){
			if(r[a[i].v]<=r[a[j].v] && l[a[i].v]>=l[a[j].v]){
			// cout<<r[a[i].v]<<" "<<r[a[j].v]<<" "<<l[a[i].v]<<" "<<l[a[j].v]<<endl;
				a[j].adj.pb(a[i].v);
				flag=1;
				break;
			}
		}
		if(flag==0) fri.pb(i);
	}
	fri.pb(m-1);
	// cout<<"hello"<<endl;
	f(i, fri.size()){
		// cout<<fri[i]<<endl;
		putflowers(fri[i], -1);
	}

	// f(i, n) if(g[i]==-1) g[i]=1;
	f(i, n) cout<<g[i]<<" ";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <vector>
// #include <chrono>
// #include <string>
#include <algorithm>

using namespace std;
// using namespace std::chrono;

// typedef std::chrono::high_resolution_clock::time_point timen;
typedef long long ll;
typedef long double ld;

#define duration(a) std::chrono::duration_cast<std::chrono::nanoseconds>(a).count()
#define timeNow() std::chrono::high_resolution_clock::now()
#define f(i, n) for(int (i)=0; (i)<(n); (i)++)
#define frp(i, a, b) for(int (i)=a; (i)<(b); (i)++)
#define frn(i, a, b) for(int (i)=a; (i)>(b); (i)--)
#define pb(a) push_back(a)

#define p(aaa) cout<<"debug "<<aaa<<endl;
#define PI 3.14159265358979323846

const int mod=1e9+7;
const int mx=1e3;

struct s
{
	int v;
	int len;
	int rose;
	int lily;
	vector<int> adj;
};

int n, m, tl, tr;
vector<struct s> a;
vector<int> g;
vector<int> l, r, fri;

bool complen(const s &a, const s &b){
	return a.len<b.len;
}

void putflowers(int t, int p){

	while(!a[t].adj.empty()){
		// cout<<a[t].adj.back()<<endl;
		putflowers(a[t].adj.back(), t);
		a[t].adj.pop_back();
	}
	// check which location are filled, fill the remaining
	// subtract from a[p].rose and a[p].lily
	// check which locations are filled fill the remaining with a[p].rose and a[p].lily
	frp(j, l[a[t].v]-1, r[a[t].v]){
		// cout<<g[j]<<" "<<a[t].rose<<endl;
		if(g[j]==0) a[t].rose-=1;
		else if(g[j]==1) a[t].lily-=1;
	}
	frp(j, l[a[t].v]-1, r[a[t].v]){
		if(a[t].rose+a[t].lily>0 && g[j]==-1){
			if(a[t].rose>0){g[j]=0; a[t].rose-=1;}
			else {g[j]=1; a[t].lily-=1;}
		}
	}
	return;
}

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

	s tmp;

	cin>>n>>m;
	f(i, n) g.pb(-1);

	f(i, m){
		cin>>tl>>tr;
		l.pb(tl);
		r.pb(tr);
		tmp.v=i;
		tmp.len=r[i]-l[i]+1;
		tmp.rose=(r[i]-l[i]+1)/2;
		tmp.lily=(r[i]-l[i]+2)/2;
		a.pb(tmp);
	}
	sort(a.begin(), a.end(), complen);

	f(i, m-1){
		int flag=0;
		frp(j, i+1, m){
			if(r[a[i].v]<=r[a[j].v] && l[a[i].v]>=l[a[j].v]){
			// cout<<r[a[i].v]<<" "<<r[a[j].v]<<" "<<l[a[i].v]<<" "<<l[a[j].v]<<endl;
				a[j].adj.pb(a[i].v);
				flag=1;
				break;
			}
		}
		if(flag==0) fri.pb(i);
	}
	fri.pb(m-1);
	// cout<<"hello"<<endl;
	f(i, fri.size()){
		// cout<<fri[i]<<endl;
		putflowers(fri[i], -1);
	}

	// f(i, n) if(g[i]==-1) g[i]=1;
	f(i, n) cout<<g[i];
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	int l, r;
	for(int i=0;i<m;i++)cin >>l>>r;
	for(int i=0;i<n;i++)
	{
		if(i%2)cout<<1;
		else cout<<0;
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, k, l, r;
	cin >> n >> k;
	for(int i=1;i<=k;i++)cin >> l >> r;
	for(int i=1;i<=n;i++)
	{
		if(i%2)cout<<1;
		else cout<<0;
	}
	cout<<"\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	int l, r;
	for(int i=0;i<m;i++)cin >>l>>r;
	for(int i=0;i<n;i++)
	{
		printf("%d",i%2?1:0);
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	int l, r;
	for(int i=0;i<m;i++)cin >>l>>r;
	for(int i=0;i<n;i++)
	{
		if(!i%2)cout<<0;
		else cout<<1;
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std ;
int main(){
    int n;
    scanf("%d",&n) ;
    for (int i=1;i<=n;i++) printf("%d",i&1) ;
}


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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str() // int to string
#define fill1(a, c, x) fr(_I, 0, (c)) (a)[_I] = (x)
#define fill2(a, r, c, x) fr(_I, 0, (r)) fr(_J, 0, (c)) (a)[_I][_J] = (x)
#define boost ios_base::sync_with_stdio(false)
#define sz(x) ((int)(x).size())
#define deb(x) cout << #x" = " << x << '\n';
#define dist(x1, y1, x2, y2) sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
#define com(x, a, b) x/a + x/b - x/(a*b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, m;
pii a[1234];
char res[1234];

bool cmp(pii a, pii b) {
	return a.sc - a.fs < b.sc - b.fs;
}

int main() {
//    freopen("input.in", "r", stdin);
	scanf("%d %d", &n, &m);
	fr(i, 0, 1233) res[i] = '#';
	fr(i, 0, m) {
		int vie1, vie2;
		scanf("%d %d", &vie1, &vie2);
		a[i] = mp(vie1, vie2);
	}
	sort(a, a+m, cmp);
//	puts("");
//	fr(i, 0, m) printf("%d %d\n", a[i].fs, a[i].sc);
//	puts("");
//	fr(i, 0, m) {
//		fr(k, 1, n+1) putchar(res[k]);
//		puts("");
//		int range = a[i].sc - a[i].fs + 1;
//		int remain1;
//		remain1 = range/2;
//		if(range % 2 != 0) remain1++;
//		fr(j, a[i].fs, a[i].sc+1) {
//			if(res[j] == '1') remain1--;
//		}
//		fr(j, a[i].fs, a[i].sc+1) {
//			if(res[j] == '#')
//				if(remain1 > 0) res[j] = '1', remain1--;
//				else res[j] = '0';
//		}
//	}
//	fr(i, 0, 1233) if(res[i] == '#') res[i] = '0';
//	fr(i, 1, n+1) putchar(res[i]);
//	puts("");
	fr(i, 0, n)
		putchar(i % 2 == 0 ? '0' : '1');
	puts("");
	return 0;
}


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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str() // int to string
#define fill1(a, c, x) fr(_I, 0, (c)) (a)[_I] = (x)
#define fill2(a, r, c, x) fr(_I, 0, (r)) fr(_J, 0, (c)) (a)[_I][_J] = (x)
#define boost ios_base::sync_with_stdio(false)
#define sz(x) ((int)(x).size())
#define deb(x) cout << #x" = " << x << '\n';
#define dist(x1, y1, x2, y2) sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
#define com(x, a, b) x/a + x/b - x/(a*b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, m;
pii a[1234];
char res[1234];

bool cmp(pii a, pii b) {
	return a.sc - a.fs < b.sc - b.fs;
}

int main() {
//    freopen("input.in", "r", stdin);
	scanf("%d %d", &n, &m);
	fr(i, 0, 1233) res[i] = '#';
	fr(i, 0, m) {
		int vie1, vie2;
		scanf("%d %d", &vie1, &vie2);
		a[i] = mp(vie1, vie2);
	}
	sort(a, a+m, cmp);
//	puts("");
//	fr(i, 0, m) printf("%d %d\n", a[i].fs, a[i].sc);
//	puts("");
	fr(i, 0, m) {
//		fr(k, 1, n+1) putchar(res[k]);
//		puts("");
		int range = a[i].sc - a[i].fs + 1;
		int remain1;
		remain1 = range/2;
		if(range % 2 != '0') remain1++;
		fr(j, a[i].fs, a[i].sc+1) {
			if(res[j] == '1') remain1--;
		}
		fr(j, a[i].fs, a[i].sc+1) {
			if(res[j] == '#')
				if(remain1 > 0) res[j] = '1', remain1--;
				else res[j] = '0';
		}
	}
	fr(i, 0, 1233) if(res[i] == '#') res[i] = '0';
	fr(i, 1, n+1) putchar(res[i]);
	puts("");
	return 0;
}


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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str() // int to string
#define fill1(a, c, x) fr(_I, 0, (c)) (a)[_I] = (x)
#define fill2(a, r, c, x) fr(_I, 0, (r)) fr(_J, 0, (c)) (a)[_I][_J] = (x)
#define boost ios_base::sync_with_stdio(false)
#define sz(x) ((int)(x).size())
#define deb(x) cout << #x" = " << x << '\n';
#define dist(x1, y1, x2, y2) sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
#define com(x, a, b) x/a + x/b - x/(a*b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, m;
pii a[1234];
char res[1234];

bool cmp(pii a, pii b) {
	return a.sc - a.fs < b.sc - b.fs;
}

int main() {
//    freopen("input.in", "r", stdin);
	scanf("%d %d", &n, &m);
	fr(i, 0, 1233) res[i] = '#';
	fr(i, 0, m) {
		int vie1, vie2;
		scanf("%d %d", &vie1, &vie2);
		a[i] = mp(vie1, vie2);
	}
	sort(a, a+m, cmp);
//	puts("");
//	fr(i, 0, m) printf("%d %d\n", a[i].fs, a[i].sc);
//	puts("");
	fr(i, 0, m) {
//		fr(k, 1, n+1) putchar(res[k]);
//		puts("");
		int range = a[i].sc - a[i].fs + 1;
		int remain1;
		remain1 = range/2;
		if(range % 2 != 0) remain1++;
		fr(j, a[i].fs, a[i].sc+1) {
			if(res[j] == '1') remain1--;
		}
		fr(j, a[i].fs, a[i].sc+1) {
			if(res[j] == '#')
				if(remain1 > 0) res[j] = '1', remain1--;
				else res[j] = '0';
		}
	}
	fr(i, 0, 1233) if(res[i] == '#') res[i] = '0';
	fr(i, 1, n+1) putchar(res[i]);
	puts("");
	return 0;
}


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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define fs first
#define sc second
#define fr(i, a, b) for(int i = a ; i < b ; i++)
#define frr(i, a, b) for(int i = a ; i >= b ; i--)
#define tr(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define trr(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define its(x) static_cast< ostringstream & >( ( ostringstream() << dec << x ) ).str() // int to string
#define fill1(a, c, x) fr(_I, 0, (c)) (a)[_I] = (x)
#define fill2(a, r, c, x) fr(_I, 0, (r)) fr(_J, 0, (c)) (a)[_I][_J] = (x)
#define boost ios_base::sync_with_stdio(false)
#define sz(x) ((int)(x).size())
#define deb(x) cout << #x" = " << x << '\n';
#define dist(x1, y1, x2, y2) sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
#define com(x, a, b) x/a + x/b - x/(a*b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, m;
pii a[1234];
char res[1234];

bool cmp(pii a, pii b) {
	return a.sc - a.fs < b.sc - b.fs;
}

int main() {
//    freopen("input.in", "r", stdin);
	scanf("%d %d", &n, &m);
	fr(i, 0, 1233) res[i] = '#';
	fr(i, 0, m) {
		int vie1, vie2;
		scanf("%d %d", &vie1, &vie2);
		a[i] = mp(vie1, vie2);
	}
	sort(a, a+m, cmp);
//	puts("");
//	fr(i, 0, m) printf("%d %d\n", a[i].fs, a[i].sc);
//	puts("");
	fr(i, 0, m) {
//		fr(k, 1, n+1) putchar(res[k]);
//		puts("");
		int range = a[i].sc - a[i].fs + 1;
		int remain1;
		remain1 = range/2;
		if(range % 2 != 0) remain1++;
		fr(j, a[i].fs, a[i].sc+1) {
			if(res[j] == '1') remain1--;
		}
		fr(j, a[i].fs, a[i].sc+1) {
			if(res[j] == '#')
				if(remain1 > 0) res[j] = '1', remain1--;
				else res[j] = '0';
		}
	}
	fr(i, 1, n+1) if(res[i] == '#') res[i] = '0';
	fr(i, 1, n+1) putchar(res[i]);
	puts("");
	return 0;
}


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

const int maxn=1e3+10;
int val[maxn];
struct Seg{
    int l,r;
    bool operator<(const Seg& obj)const{
        if(r==obj.r)return l>obj.l;
        return r<obj.r;
    }
}seg[maxn];
int main()
{
    memset(val,-1,sizeof(val));
   // for(int i=1;i<=10;i++)printf("%d\n",val[i]);
    int n,m;
    scanf("%d %d",&n,&m);
    for(int i=0;i<m;i++){
        scanf("%d %d",&seg[i].l,&seg[i].r);
    }
    if(m==1&&seg[0].r==seg[0].l){
        printf("0\n");
        return 0;
    }

    sort(seg,seg+m);
    for(int i=0;i<m;i++){
        int tmp1=seg[i].r-seg[i].l+1;
        int tmp2=tmp1/2;
        int num_0=0,num_1=0;
        for(int j=seg[i].l;j<=seg[i].r;j++){
            if(val[j]==1)num_1++;
            if(val[j]==0)num_0++;
        }
        int n_0,n_1;

        if(tmp1%2==0){
            n_0=tmp2-num_0,n_1=tmp2-num_1;

        }
        else{
            n_0=tmp2-num_0,n_1=tmp2-num_1+1;

        }
        //cout<<seg[i].l<<" "<<seg[i].r<<endl;
        //cout<<n_0<<n_1<<endl;
        for(int j=seg[i].l;j<=seg[i].r;j++){
                if(val[j]==-1){
                    if(n_0)val[j]=0,n_0--;
                    else if(n_1)val[j]=1,n_1--;
                }

         }
    }

    for(int i=1;i<=n;i++){
        if(val[i]==-1)val[i]=0;
    }
    for(int i=1;i<=n;i++){
        printf("%d",val[i]);
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
    for(int i=1;i<=m;i++){
        int l,r;
        scanf("%d %d",&l,&r);
    }
    for(int i=1;i<=n;i++){
        if(i%2)printf("1");
        else printf("0");
    }
    printf("\n");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    int n,m,l[1001],r[1001],rose,lil;
    cin>>n>>m;
    int s[n+1],p;
    for(int i=1;i<=n;i++)
        s[i]=-1;
    for(int i=1;i<=m;i++)
    {
        cin>>l[i]>>r[i];
        p=r[i]-l[i]+1;
        //cout<<p<<endl;
        if(p%2==0)
        {
            rose=p/2;
            lil=p/2;
        }
        else
        {
            rose=p/2;
            lil=(p/2)+1;
        }
        //cout<<rose<<" "<<lil<<endl;
        for(int j=l[i];j<=r[i];j++)
        {
           if(s[j] == -1)
           {
               if(rose>=lil)
               {
                   s[j]=0;
                   rose--;
               }
               else
               {
                   s[j]=1;
                   lil--;
               }
           }
           else if(s[j]==0)
            rose--;
           else
            lil--;
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(s[i]!=-1)
        cout<<s[i];
        else
        cout<<0;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    int n,m,l[1001],r[1001],rose,lil;
    cin>>n>>m;
    int s[n+1],p;
    for(int i=1;i<=n;i++)
        s[i]=-1;
    for(int i=1;i<=m;i++)
    {
        cin>>l[i]>>r[i];
        p=r[i]-l[i]+1;
        //cout<<p<<endl;
        if(p%2==0)
        {
            rose=p/2;
            lil=p/2;
        }
        else
        {
            rose=p/2;
            lil=(p/2)+1;
        }
        //cout<<rose<<" "<<lil<<endl;
        for(int j=l[i];j<=r[i];j++)
        {
           if(s[j] == -1)
           {
               if(rose>=lil)
               {
                   s[j]=0;
                   rose--;
               }
               else
               {
                   s[j]=1;
                   lil--;
               }
           }
           else if(s[j]==0)
            rose--;
           else
            lil--;
        }
    }
    for(int i=1;i<=n;i++)
        cout<<s[i];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    int n,m,l[1001],r[1001],rose,lil;
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        cin>>l[i]>>r[i];
    }
    for(int i=1;i<=n;i++)
    {
        if(i%2==0)
        cout<<0;
        else
        cout<<1;
    }
    return 0;
}


#include <iostream>
using namespace std;

int main() {
int n,m;
cin>>n>>m;
int a,b;
for(int i=0;i<m;i++){cin>>a>>b;}
int f=1;
for(int i=0;i<n;i++){
	if(f){cout<<1;f=0;}
	else{cout<<0;f=1;}
}

	return 0;
}


#include <iostream>
using namespace std;

int main() {
int n;
cin>>n;
int f=1;
for(int i=0;i<n;i++){
	if(f){cout<<1;f=0;}
	else{cout<<0;f=1;}}
	return 0;
}


#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
	int n,v;
	while(cin>>n>>v)
	{
		for(int i=0;i<v;i++)
		{
			int a,b;
			cin>>a>>b;
		}
		for(int i=1;i<=n;i++)
		{
			if(i%2==0)
			cout<<"0";
			else
			cout<<"1";
		}
		cout<<endl;

	}
	return 0;
}


#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
	int n,v;
	while(cin>>n>>v)
	{
		for(int i=0;i<v;i++)
		{
			int a,b;
			cin>>a>>b;
		}
		for(int i=1;i<=n;i++)
		{
			if(i%2==1)
			cout<<"0";
			else
			cout<<"1";
		}
		cout<<endl;

	}
	return 0;
}


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

const int maxn=1e3+10;

int A[maxn];

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	memset(A,-1,sizeof A);
	while(m--){
		int l,r;
		scanf("%d%d",&l,&r);
	//	cout<<l<<" "<<r<<endl;
	/*	int cnt1=0,cnt0=0;
		for(int i=l;i<=r;i++){
			//cout<<i<<" "<<A[i]<<endl;
			if(A[i]==0) cnt0++;
			else if(A[i]==1) cnt1++;
			else{
				if(cnt0>cnt1){
					A[i]=1;
					cnt1++;
				}
				else{
					A[i]=0;
					cnt0++;
				}
			}
		}*/
	}
	for(int i=1;i<=n;i++){
		if(i%2==1) printf("1");
		else printf("0");
	}
	printf("\n");
	return 0;
}


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

const int maxn=1e3+10;

int A[maxn];

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	memset(A,-1,sizeof A);
	while(m--){
		int l,r;
		scanf("%d%d",&l,&r);
	//	cout<<l<<" "<<r<<endl;
		int cnt1=0,cnt0=0;
		for(int i=l;i<=r;i++){
			//cout<<i<<" "<<A[i]<<endl;
			if(A[i]==0) cnt0++;
			else if(A[i]==1) cnt1++;
			else{
				if(cnt0>cnt1){
					A[i]=1;
					cnt1++;
				}
				else{
					A[i]=0;
					cnt0++;
				}
			}
		}
	}
	for(int i=1;i<=n;i++) printf("%d",A[i]);
	printf("\n");
	return 0;
}


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

const int maxn=1e3+10;

int A[maxn];

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	memset(A,-1,sizeof A);
	while(m--){
		int l,r;
		scanf("%d%d",&l,&r);
	//	cout<<l<<" "<<r<<endl;
		int cnt1=0,cnt0=0;
		for(int i=l;i<=r;i++){
			//cout<<i<<" "<<A[i]<<endl;
			if(A[i]==0) cnt0++;
			else if(A[i]==1) cnt1++;
			else{
				if(cnt0>cnt1){
					A[i]=1;
					cnt1++;
				}
				else{
					A[i]=0;
					cnt0++;
				}
			}
		}
	}
	for(int i=1;i<=n;i++){
		if(A[i]==-1) printf("1");
		else printf("%d",A[i]);
	}
	printf("\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cout<<(i&1);
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cout<<(i&1);
    cout<<endl;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i;
scanf("%d",&n);
for(i=0;i<n/2;i++){
   printf("01");
}
if(n%2==1)printf("0");
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i;
cin>>n;
for(i=0;i<n/2;i++){
    cout<<"01";
}
if(n%2==1)cout<<"0";
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i;
scanf("%d",&n);
for(i=0;i<n/2;i++){
   printf("01");
}
if(n%2==1) printf("0");
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--)cout<<n%2;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second

int main() {
    int n,q;
    int l,r,d;
    cin>>n>>q;
    vector<pair<int,pair<int,int> > > v(q);
    vector<char>s(n,'.');
    for(int i=0;i<q;i++){
        cin>>l>>r;
        d=r-l;
        v[i].f=d;
        v[i].s.f=l-1;
        v[i].s.s=r-1;
    }

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

    for(int i=0;i<q;i++){
        l=v[i].s.f;
        r=v[i].s.s;
        d=r-l;
        int o=0,x=0;//o=0 x=1
        bool f=false;
        for(int i=l;i<=r;i++){
            if(s[i]=='.'){
                if(x>o)s[i]='0',o++;
                else s[i]='1',x++;
            }
            else{
                f=true;
                if(s[i]=='0')o++;
                else x++;
            }

            for(int i=l;l<=r && abs(x-o)>1;i++){
                 if(s[i]=='1' && x>o)s[i]='0',o++,x--;
                    else if(s[i]=='0' && o>x)s[i]='1',o--,x++;
                }

        }

    }
    for(int i=0;i<s.size();i++)if(s[i]=='.')cout<<'1';else cout<<s[i];
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second

int main() {
    int n,q;
    int l,r,d;
    cin>>n>>q;
    vector<pair<int,pair<int,int> > > v(q);
    vector<char>s(n,'.');
    for(int i=0;i<q;i++){
        cin>>l>>r;
        d=r-l;
        v[i].f=d;
        v[i].s.f=l-1;
        v[i].s.s=r-1;
    }

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

    for(int i=0;i<q;i++){
        l=v[i].s.f;
        r=v[i].s.s;
        d=r-l;
        int o=0,x=0;//o=0 x=1
        bool f=false;
        for(int i=l;i<=r;i++){
            if(s[i]=='.'){
                if(x>o)s[i]='0',o++;
                else s[i]='1',x++;
            }
            else{
                f=true;
                if(s[i]=='0')o++;
                else x++;
            }

            for(int i=l;l<=r && abs(x-o)>1;i++){
                 if(s[i]=='1' && x>o)s[i]='0',o++,x--;
                    else if(s[i]=='0' && o>x)s[i]='1',o--,x++;
                }

        }

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


#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second

int main() {
    int n,q;
    int l,r,d;
    cin>>n>>q;
    vector<pair<int,pair<int,int> > > v(q);
    vector<char>s(n,'.');
    for(int i=0;i<q;i++){
        cin>>l>>r;
        d=r-l;
        v[i].f=d;
        v[i].s.f=l-1;
        v[i].s.s=r-1;
    }

   for(int i=0;i<n;i++)cout<<i % 2;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second

int main() {

    int n;
    cin>>n;
    for(int i=0;i<n;i++)printf("%d",i%2);

    return 0;
}


#include <iostream>

using namespace std;

int main() {
	int n, m;
	cin>>n>>m;
	int A[m][2];
	for(int i = 0; i < m; i++)
	cin>>A[i][0]>>A[i][1];
	for(int j = 0; j < n; j++)
	if(j % 2 == 0)
	cout<<0;
	else
	cout<<1;

}


#include <bits/stdc++.h>
#define FOR(i, a b) for(int i = a; i <= b; i++)
using namspace std;
int n;
int main() {
    cin >> n;
    FOR(i, 1, n) cout << i&1;
}


#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i <= b; i++)
using namespace std;
int n;
int main() {
    cin >> n;
    FOR(i, 1, n) cout << i&1;
}


#include <bits/stdc++.h>
#define FOR(i, a b) for(int i = a; i <= b; i++)
using namespace std;
int n;
int main() {
    cin >> n;
    FOR(i, 1, n) cout << i&1;
}


#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i <= b; i++)
using namespace std;
int n;
int main() {
    cin >> n;
    FOR(i, 1, n) cout << i%2;
}


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

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

	int s[n];

	memset(s,-1,sizeof(s));

	map< pair<long long int , pair< int, int> >, pair<int, int> >  m;
	map< pair<long long int , pair< int, int> >, pair<int, int> > :: iterator it;

	while(g--)
	{
		int l,r;

		cin>>l>>r;

	 	int x= (r-l+1);

	    m[{x,{l,r}}]= {l,r};
	}

	int l,r;

	for(it = m.begin(); it!= m.end(); it++)
	{
		l=it->second.first; r = it->second.second;
	//	cout<<l<<" "<<r<<"\n";

		int n1,n2;
		n1 = n2 = 0;
		for(int i=l-1; i<r; i++)
		  	{
		    	if(s[i] == 0) n1++;
				else if(s[i] == 1) n2++;

			}

		int d = abs(n1 - n2);

		if(n1 > n2)
		{
			int f = 0;

			for(int i=l-1; i<r; i++)
			{
				if(s[i] != 1 && s[i]!=0)
				{
					if(d) {s[i] = 1; d--;}

					else
					{
						if(f) {s[i] = 0; f=0;}

						else {s[i] = 1; f=1;}
					}
				}
			}
		}

		else
		{
			int f = 0;

			for(int i=l-1; i<r; i++)
			{
				if(s[i] != 1 && s[i]!=0)
				{
					if(d) {s[i] = 0; d--;}

					else
					{
						if(f) {s[i] = 0; f=0;}

						else {s[i] = 1; f=1;}
					}
				}
			}
		}

}

	for(int i=0; i<n; i++)
	 {  if(s[i]!=0 && s[i]!=1) cout<<0;
	    else cout<<s[i];
	}
}


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

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

	while(g--)
	{
		int l,r;

		cin>>l>>r;

	}

	int f=0;

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

		 if(f==0) f=1;
		 else f=0;
	}
}


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

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

	int s[n+1];

	memset(s,-1,sizeof(s));

	while(g--)
	{
		int l,r;

		cin>>l>>r;

		int x = r-l+1;

		int f;

	 	if(l-1 > 0)
	 	{
	 		if(s[l-2] == 0) f=1;
	 		else if(s[l-2] == 1) f=0;

	 		else if(s[r] == 0) { if(x%2) f= 1; else f= 0;}

	 		else if(s[r] == 1) { if(x%2) f= 0; else f= 1;}

			else {f=0;}
		}

		else
		{

		   if(s[r] == 0) { if(x%2) f= 1; else f= 0;}

	 		else if(s[r] == 1) { if(x%2) f= 0; else f= 1;}

			else f = 0;
		}

		for(int i = l-1; i<r; i++)
		  {
		  	  if(f) {s[i] = 1; f=0;}

		  	  else {s[i] = 0; f= 1;}
		 }
	}

		for(int i=0; i<n; i++)
		 {
		 	if(s[i] == -1) cout<<0;
		 	else cout<<s[i];
		}
}


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

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

	int s[n];

	memset(s,-1,sizeof(s));

	map<long long int, pair<int, int> > m;
	map<long long int , pair<int, int> > :: iterator it;

	while(g--)
	{
		int l,r;

		cin>>l>>r;

	    m[(r-l+1)] = {l,r};
	}

	int l,r;

	for(it = m.begin(); it!= m.end(); it++)
	{
		l=it->second.first; r = it->second.second;

		int n1,n2;
		n1 = n2 = 0;
		for(int i=l-1; i<r; i++)
		  	{
		    	if(s[i] == 0) n1++;
				else if(s[i] == 1) n2++;

			}

		//	cout<<n1<<" "<<n2<<"\n";

		int d = abs(n1 - n2);

		if(n1 > n2)
		{
			int f = 0;

			for(int i=l-1; i<r; i++)
			{
				if(s[i] != 1 && s[i]!=0)
				{
					if(d) {s[i] = 1; d--;}

					else
					{
						if(f) {s[i] = 0; f=0;}

						else {s[i] = 1; f=1;}
					}
				}
			}
		}

		else
		{
			int f = 0;

			for(int i=l-1; i<r; i++)
			{
				if(s[i] != 1 && s[i]!=0)
				{
					if(d) {s[i] = 0; d--;}

					else
					{
						if(f) {s[i] = 0; f=0;}

						else {s[i] = 1; f=1;}
					}
				}
			}
		}

}

	for(int i=0; i<n; i++)
	 {  if(s[i]!=0 && s[i]!=1) cout<<0;
	    else cout<<s[i];
	}
}


#include <bits/stdc++.h>
using namespace std;
void solve()
{
    int n,m;
    cin>>n>>m;
    for (int i = 0; i < m; ++i)
    {
        int l,r;
        cin>>l>>r;
    }
    string temp(n,'1');
    for (int i = 0; i < n; ++i)
    {
        if(i&1)
        {
            temp[i]='0';
        }
    }
    cout << temp << endl;
}
int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    long long t=1;
    // cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int,int> p1,pair<int,int> p2)
{
    return p1.second - p1.first < p2.second - p2.first;
}
void solve()
{
    int n,m;
    cin>>n>>m;
    vector<pair<int,int> > v;
    for (int i = 0; i < m; ++i)
    {
        int l,r;
        cin>>l>>r;
        v.push_back(make_pair(l,r));
    }
    sort(v.begin(),v.end(),cmp);
    string temp(n,'#');
    for (int j = 0; j < m; ++j)
    {
        int l = v[j].first;
        int r = v[j].second;
        int zr=0;
        int on=0;
        // cout << l << " " << r <<endl;
        for (int i = l-1; i <= r-1; ++i)
        {
            if(temp[i]=='0')
            {
                zr++;
            }
            if(temp[i]=='1')
            {
                on++;
            }
        }
        for (int i = l-1; i <= r-1; ++i)
        {
            if(temp[i]=='#')
            {
                if(zr<on)
                {
                    temp[i]='0';
                    zr++;
                }
                else
                {
                    temp[i]='1';
                    on++;
                }
            }
        }
        // cout<<temp<<endl;
    }
    int ans = 0;
    for (int j = 0; j < m; ++j)
    {
        int l = v[j].first;
        int r = v[j].second;
        int zr=0;
        int on=0;
        for (int i = l-1; i <= r-1; ++i)
        {
            if(temp[i]=='0')
            {
                zr++;
            }
            if(temp[i]=='1')
            {
                on++;
            }
        }
        ans +=zr*on;
    }
    cout << temp << endl;
}
int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    long long t=1;
    // cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
void solve()
{
    int n,m;
    cin>>n>>m;
    for (int i = 0; i < m; ++i)
    {
        int l,r;
        cin>>l>>r;
    }
    string temp(n,'0');
    for (int i = 0; i < n; ++i)
    {
        if(i&1)
        {
            temp[i]='1';
        }
    }
    cout << temp << endl;
}
int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    long long t=1;
    // cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int,int> p1,pair<int,int> p2)
{
    return p1.second - p1.first < p2.second - p2.first;
}
void solve()
{
    int n,m;
    cin>>n>>m;
    vector<pair<int,int> > v;
    for (int i = 0; i < m; ++i)
    {
        int l,r;
        cin>>l>>r;
        v.push_back(make_pair(l,r));
    }
    sort(v.begin(),v.end(),cmp);
    string temp(n,'#');
    for (int j = 0; j < m; ++j)
    {
        int l = v[j].first;
        int r = v[j].second;
        int zr=0;
        int on=0;
        // cout << l << " " << r <<endl;
        for (int i = l-1; i <= r-1; ++i)
        {
            if(temp[i]=='0')
            {
                zr++;
            }
            if(temp[i]=='1')
            {
                on++;
            }
        }
        for (int i = l-1; i <= r-1; ++i)
        {
            if(temp[i]=='#')
            {
                if(zr<on)
                {
                    temp[i]='0';
                    zr++;
                }
                else
                {
                    temp[i]='1';
                    on++;
                }
            }
        }
        // cout<<temp<<endl;
    }
    int ans = 0;
    for (int j = 0; j < m; ++j)
    {
        int l = v[j].first;
        int r = v[j].second;
        int zr=0;
        int on=0;
        for (int i = l-1; i <= r-1; ++i)
        {
            if(temp[i]=='0')
            {
                zr++;
            }
            if(temp[i]=='1')
            {
                on++;
            }
        }
        ans +=zr*on;
    }
    cout << temp << endl;
}
int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    long long t=1;
    // cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


/// Bismillahir Rahmanir Rahim
/// S. M. Shakir Ahsan Romeo
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int dx4[] = { -1, 0, 1, 0 };
const int dy4[] = { 0, 1, 0, -1 };
const int dx8[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
typedef long long lng;
typedef unsigned long long ulng;
typedef double db;
typedef vector < int >  vi;
typedef pair < int, int >  pii;
typedef pair < long long, long long >  pll;
typedef vector < pair < int, int > >  vpii;
typedef vector < pair < long long, long long > >  vpll;
inline long long Int()
{
	long long ret = 0;
	bool sign = true;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-')
		c = getchar();
	if (c == '-')
		c = getchar(), sign = false;
	while (c >= '0' && c <= '9')
		ret *= 10, ret += (c - '0'), c = getchar();
	return sign ? ret : -ret;
}
#define II Int()
template < class S, class T> ostream& operator << (ostream& out, const pair < S, T >& P)
{
	out << '{' << P.first << ", " << P.second << '}';
	return out;
}

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

template < class S, class T> ostream& operator << (ostream& out, const map < S, T >& mp)
{
	out << "[\n";
	for (const auto& x : mp)
	{
		out << '{' << x.first << ", " << x.second << "}\n";
	}
	out << "]\n";
	return out;
}

template < class T> ostream& operator << (ostream& out, const set < T >& cs)
{
	out << '{';
	for (auto it = cs.begin(); it != cs.end();)
	{
		out << *it;
		it++;
		if (it != cs.end())
			out << ", ";
		else
			out << '}';
	}
	return out;
}

void solve();
#define Vai_Brasil main()
#define xx first
#define yy second
#define endl '\n'
#define sf scanf
#define pf printf
#define PC putchar
#define NL putchar('\n')
#define pb push_back
#define MP make_pair
#define sqr(x) ((x) * (x))
#define mem(x, y) memset((x), (y), sizeof((x)))
#define wait system("pause");
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define forcon(x, y) for(const auto& x : (y))
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define repb(i, n) for(int i = (n) - 1; i >= 0; --i)
#define repb1(i, n) for(int i = (n); i >= 1; --i)
#define repab(i, a, b) for(int i = (a); i <= (b); ++i)
#define repba(i, a, b) for(int i = (a); i >= (b); --i)
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define repstl(x, y) for(auto x = (y).begin(); x != (y).end(); x++)
#define repbstl(x, y) for(auto x = (y).rbegin(); x != (y).rend(); x++)
#define segtree int lft = node << 1, rgt = lft | 1, mid = b + e >> 1;
#define Case int __T; scanf("%d", &__T); for(int cas = 1; cas <= __T; ++cas)
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

int Vai_Brasil
{
	//FAST;
	cout << fixed << setprecision(10);
//cerr << fixed << setprecision(10);
solve();
#ifdef romeo
cerr << "\nElapsed time: " << 1.0 * clock() / CLOCKS_PER_SEC << '\n';
#endif // romeo
#ifdef visualstudio
system("pause");
#endif // visualstudio
/// Please, hack my code, save me from system testing ^_^
return 0;
}

const double eps = 1e-10;

const int mod = 1e9 + 7;
const int N = 2e5 + 5;

void solve()
{
	int n = II, m = II;
	vpii in(m);
	rep(i, m)
	{
		in[i].xx = II - 1;
		in[i].yy = II - 1;
	}
	sort(all(in), [&](pii& a, pii& b) {
		return (a.yy - a.xx) > (b.yy - b.xx);
	});
	string s(n, ' ');
	lng sum = 0;
	rep(i, m)
	{
		int x = in[i].xx, y = in[i].yy;
		int zero = 0, one = 0;
		repab(j, x, y)
		{
			if (s[j] == '0') ++zero;
			else if (s[j] == '1') ++one;
		}
		char last = 0;
		repab(j, x, y)
		{
			if (s[j] != ' ')
			{
				last = s[j];
				continue;
			}
			else if (zero == one)
			{
				if (last == '0')
				{
					s[j] = '1';
					last = s[j];
					++one;
				}
				else
				{
					s[j] = '0';
					last = s[j];
					++zero;
				}
			}
			else if (zero < one)
			{
				s[j] = '0';
				++zero;
				last = '0';
			}
			else
			{
				s[j] = '1';
				++one;
				last = '1';
			}
		}
		int mul = zero * one;
		sum += mul;
	}
	//dbg(sum);
	cout << s << endl;
}


/// Bismillahir Rahmanir Rahim
/// S. M. Shakir Ahsan Romeo
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int dx4[] = { -1, 0, 1, 0 };
const int dy4[] = { 0, 1, 0, -1 };
const int dx8[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
typedef long long lng;
typedef unsigned long long ulng;
typedef double db;
typedef vector < int >  vi;
typedef pair < int, int >  pii;
typedef pair < long long, long long >  pll;
typedef vector < pair < int, int > >  vpii;
typedef vector < pair < long long, long long > >  vpll;
inline long long Int()
{
	long long ret = 0;
	bool sign = true;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-')
		c = getchar();
	if (c == '-')
		c = getchar(), sign = false;
	while (c >= '0' && c <= '9')
		ret *= 10, ret += (c - '0'), c = getchar();
	return sign ? ret : -ret;
}
#define II Int()
template < class S, class T> ostream& operator << (ostream& out, const pair < S, T >& P)
{
	out << '{' << P.first << ", " << P.second << '}';
	return out;
}

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

template < class S, class T> ostream& operator << (ostream& out, const map < S, T >& mp)
{
	out << "[\n";
	for (const auto& x : mp)
	{
		out << '{' << x.first << ", " << x.second << "}\n";
	}
	out << "]\n";
	return out;
}

template < class T> ostream& operator << (ostream& out, const set < T >& cs)
{
	out << '{';
	for (auto it = cs.begin(); it != cs.end();)
	{
		out << *it;
		it++;
		if (it != cs.end())
			out << ", ";
		else
			out << '}';
	}
	return out;
}

void solve();
#define Vai_Brasil main()
#define xx first
#define yy second
#define endl '\n'
#define sf scanf
#define pf printf
#define PC putchar
#define NL putchar('\n')
#define pb push_back
#define MP make_pair
#define sqr(x) ((x) * (x))
#define mem(x, y) memset((x), (y), sizeof((x)))
#define wait system("pause");
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define forcon(x, y) for(const auto& x : (y))
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define repb(i, n) for(int i = (n) - 1; i >= 0; --i)
#define repb1(i, n) for(int i = (n); i >= 1; --i)
#define repab(i, a, b) for(int i = (a); i <= (b); ++i)
#define repba(i, a, b) for(int i = (a); i >= (b); --i)
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define repstl(x, y) for(auto x = (y).begin(); x != (y).end(); x++)
#define repbstl(x, y) for(auto x = (y).rbegin(); x != (y).rend(); x++)
#define segtree int lft = node << 1, rgt = lft | 1, mid = b + e >> 1;
#define Case int __T; scanf("%d", &__T); for(int cas = 1; cas <= __T; ++cas)
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

int Vai_Brasil
{
//FAST;
cout << fixed << setprecision(10);
//cerr << fixed << setprecision(10);
solve();
#ifdef romeo
cerr << "\nElapsed time: " << 1.0 * clock() / CLOCKS_PER_SEC << '\n';
#endif // romeo
#ifdef visualstudio
system("pause");
#endif // visualstudio
/// Please, hack my code, save me from system testing ^_^
return 0;
}

const double eps = 1e-10;

const int mod = 1e9 + 7;
const int N = 2e5 + 5;

void solve()
{
	int n = II, m = II;
	vpii in(m);
	rep(i, m)
	{
		in[i].xx = II - 1;
		in[i].yy = II - 1;
	}
	sort(all(in), [&](pii& a, pii& b) {
		return (a.yy - a.xx) < (b.yy - b.xx);
	});
	string s(n, ' ');
	for (auto p : in)
	{
		int x = p.xx, y = p.yy;
		int zero = 0, one = 0;
		for (int i = x; i <= y; ++i)
		{
			if (s[i] == '0') ++zero;
			else if (s[i] == '1') ++one;
		}
		int faka = (y - x + 1) - (zero + one);
		for (int i = x; i <= y; ++i)
		{
			if (s[i] != ' ') continue;
			if (one < zero)
			{
				s[i] = '1';
				++one;
			}
			else
			{
				s[i] = '0';
				++zero;
			}
		}
	}
	/*int sum = 0;
	for (auto p : in)
	{
		int z = 0, o = 0;
		for (int i = p.xx; i <= p.yy; ++i)
		{
			if (s[i] == '0') ++z;
			else if (s[i] == '1') ++o;
			else cout << "ERROR" << endl;
		}
		int a = z * o;
		dbg3(p.xx, p.yy, a);
		sum += (z * o);
	}
	dbg(sum);*/
	cout << s << endl;
}


/// Bismillahir Rahmanir Rahim
/// S. M. Shakir Ahsan Romeo
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int dx4[] = { -1, 0, 1, 0 };
const int dy4[] = { 0, 1, 0, -1 };
const int dx8[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
typedef long long lng;
typedef unsigned long long ulng;
typedef double db;
typedef vector < int >  vi;
typedef pair < int, int >  pii;
typedef pair < long long, long long >  pll;
typedef vector < pair < int, int > >  vpii;
typedef vector < pair < long long, long long > >  vpll;
inline long long Int()
{
	long long ret = 0;
	bool sign = true;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-')
		c = getchar();
	if (c == '-')
		c = getchar(), sign = false;
	while (c >= '0' && c <= '9')
		ret *= 10, ret += (c - '0'), c = getchar();
	return sign ? ret : -ret;
}
#define II Int()
template < class S, class T> ostream& operator << (ostream& out, const pair < S, T >& P)
{
	out << '{' << P.first << ", " << P.second << '}';
	return out;
}

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

template < class S, class T> ostream& operator << (ostream& out, const map < S, T >& mp)
{
	out << "[\n";
	for (const auto& x : mp)
	{
		out << '{' << x.first << ", " << x.second << "}\n";
	}
	out << "]\n";
	return out;
}

template < class T> ostream& operator << (ostream& out, const set < T >& cs)
{
	out << '{';
	for (auto it = cs.begin(); it != cs.end();)
	{
		out << *it;
		it++;
		if (it != cs.end())
			out << ", ";
		else
			out << '}';
	}
	return out;
}

void solve();
#define Vai_Brasil main()
#define xx first
#define yy second
#define endl '\n'
#define sf scanf
#define pf printf
#define PC putchar
#define NL putchar('\n')
#define pb push_back
#define MP make_pair
#define sqr(x) ((x) * (x))
#define mem(x, y) memset((x), (y), sizeof((x)))
#define wait system("pause");
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define forcon(x, y) for(const auto& x : (y))
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define repb(i, n) for(int i = (n) - 1; i >= 0; --i)
#define repb1(i, n) for(int i = (n); i >= 1; --i)
#define repab(i, a, b) for(int i = (a); i <= (b); ++i)
#define repba(i, a, b) for(int i = (a); i >= (b); --i)
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define repstl(x, y) for(auto x = (y).begin(); x != (y).end(); x++)
#define repbstl(x, y) for(auto x = (y).rbegin(); x != (y).rend(); x++)
#define segtree int lft = node << 1, rgt = lft | 1, mid = b + e >> 1;
#define Case int __T; scanf("%d", &__T); for(int cas = 1; cas <= __T; ++cas)
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

int Vai_Brasil
{
	//FAST;
	cout << fixed << setprecision(10);
//cerr << fixed << setprecision(10);
solve();
#ifdef romeo
cerr << "\nElapsed time: " << 1.0 * clock() / CLOCKS_PER_SEC << '\n';
#endif // romeo
#ifdef visualstudio
system("pause");
#endif // visualstudio
/// Please, hack my code, save me from system testing ^_^
return 0;
}

const double eps = 1e-10;

const int mod = 1e9 + 7;
const int N = 2e5 + 5;
vpii in;
string s;

void doit(int i, char c)
{
	for (int ii = i - 1; ii >= 0; --ii)
	{
		bool f = false;
		for (int k = in[ii].xx; k <= in[ii].yy; ++k)
		{
			if (s[k] != c)
			{
				s[k] = c;
				s[in[i].yy] = (c == '0' ? '1' : '0');
				doit(ii, (c == '0' ? '1' : '0'));
				return;
			}
		}
	}
}

void solve()
{
	int n = II, m = II;
	in.resize(m);
	rep(i, m)
	{
		in[i].xx = II - 1;
		in[i].yy = II - 1;
	}
	sort(all(in), [&](pii& a, pii& b) {
		return (a.yy - a.xx) > (b.yy - b.xx);
	});
	s.resize(n, ' ');
	lng sum = 0;
	rep(i, m)
	{
		int x = in[i].xx, y = in[i].yy;
		int zero = 0, one = 0;
		repab(j, x, y)
		{
			if (s[j] == '0') ++zero;
			else if (s[j] == '1') ++one;
		}
		repab(j, x, y)
		{
			if (s[j] != ' ')
			{
				continue;
			}
			else if (zero <= one)
			{
				s[j] = '0';
				++zero;
			}
			else
			{
				s[j] = '1';
				++one;
			}
		}
		if (one == 0)
		{
			doit(i, '1');
		}
		else if (zero == 0)
		{
			doit(i, '0');
		}
		int mul = zero * one;
		sum += mul;
	}
	//dbg(sum);
	cout << s << endl;
}


/// Bismillahir Rahmanir Rahim
/// S. M. Shakir Ahsan Romeo
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int dx4[] = { -1, 0, 1, 0 };
const int dy4[] = { 0, 1, 0, -1 };
const int dx8[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dy8[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
typedef long long lng;
typedef unsigned long long ulng;
typedef double db;
typedef vector < int >  vi;
typedef pair < int, int >  pii;
typedef pair < long long, long long >  pll;
typedef vector < pair < int, int > >  vpii;
typedef vector < pair < long long, long long > >  vpll;
inline long long Int()
{
	long long ret = 0;
	bool sign = true;
	char c = getchar();
	while ((c < '0' || c > '9') && c != '-')
		c = getchar();
	if (c == '-')
		c = getchar(), sign = false;
	while (c >= '0' && c <= '9')
		ret *= 10, ret += (c - '0'), c = getchar();
	return sign ? ret : -ret;
}
#define II Int()
template < class S, class T> ostream& operator << (ostream& out, const pair < S, T >& P)
{
	out << '{' << P.first << ", " << P.second << '}';
	return out;
}

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

template < class S, class T> ostream& operator << (ostream& out, const map < S, T >& mp)
{
	out << "[\n";
	for (const auto& x : mp)
	{
		out << '{' << x.first << ", " << x.second << "}\n";
	}
	out << "]\n";
	return out;
}

template < class T> ostream& operator << (ostream& out, const set < T >& cs)
{
	out << '{';
	for (auto it = cs.begin(); it != cs.end();)
	{
		out << *it;
		it++;
		if (it != cs.end())
			out << ", ";
		else
			out << '}';
	}
	return out;
}

void solve();
#define Vai_Brasil main()
#define xx first
#define yy second
#define endl '\n'
#define sf scanf
#define pf printf
#define PC putchar
#define NL putchar('\n')
#define pb push_back
#define MP make_pair
#define sqr(x) ((x) * (x))
#define mem(x, y) memset((x), (y), sizeof((x)))
#define wait system("pause");
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define forcon(x, y) for(const auto& x : (y))
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define repb(i, n) for(int i = (n) - 1; i >= 0; --i)
#define repb1(i, n) for(int i = (n); i >= 1; --i)
#define repab(i, a, b) for(int i = (a); i <= (b); ++i)
#define repba(i, a, b) for(int i = (a); i >= (b); --i)
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define repstl(x, y) for(auto x = (y).begin(); x != (y).end(); x++)
#define repbstl(x, y) for(auto x = (y).rbegin(); x != (y).rend(); x++)
#define segtree int lft = node << 1, rgt = lft | 1, mid = b + e >> 1;
#define Case int __T; scanf("%d", &__T); for(int cas = 1; cas <= __T; ++cas)
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

int Vai_Brasil
{
	//FAST;
	cout << fixed << setprecision(10);
//cerr << fixed << setprecision(10);
solve();
#ifdef romeo
cerr << "\nElapsed time: " << 1.0 * clock() / CLOCKS_PER_SEC << '\n';
#endif // romeo
#ifdef visualstudio
system("pause");
#endif // visualstudio
/// Please, hack my code, save me from system testing ^_^
return 0;
}

const double eps = 1e-10;

const int mod = 1e9 + 7;
const int N = 2e5 + 5;

void solve()
{
	int n = II;
	rep(i, n)
	{
		PC(i & 1 ? '1' : '0');
	}
}


#include<bits/stdc++.h>
using namespace std;
#define mem(a,val) memset(a, (val), sizeof a)
int main()
{
    long long int n,m,i,j,p,q;
    cin>>n>>m;
    long long int a[m][2];
    vector<pair<int ,pair<int,int> > > ss;
    for(i=0;i<m;i++)
    {

        cin>>a[i][0]>>a[i][1];
        pair<int,int> w1;
        pair<int ,pair<int,int> >w2;
        w1.first=a[i][0];
        w1.second=a[i][1];
        w2.first=a[i][1]-a[i][0]+1;
       w2.second=w1;
       ss.push_back(w2);

    }
    char finall[m];

    sort(ss.begin(),ss.end());
    for(i=0;i<ss.size();i++)
    {

       // cout<<ss[i].first<<" "<< ss[i].second.first<<" "<< ss[i].second.second<<endl;

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

                if(flag==0)
                {
                     finall[i]='0';
                     flag=1;
                }
                else
                {
                    finall[i]='1';
                    flag=0;
                }
    }

   for(i=0;i<m;i++)
    cout<<finall[i];

}


#include<bits/stdc++.h>
using namespace std;
#define mem(a,val) memset(a, (val), sizeof a)
int main()
{
    long long int n,m,i,j,p,q;
    cin>>n>>m;
    long long int a[m][2];
    vector<pair<int ,pair<int,int> > > ss;
    for(i=0;i<m;i++)
    {

        cin>>a[i][0]>>a[i][1];
        pair<int,int> w1;
        pair<int ,pair<int,int> >w2;
        w1.first=a[i][0];
        w1.second=a[i][1];
        w2.first=a[i][1]-a[i][0]+1;
       w2.second=w1;
       ss.push_back(w2);

    }

    char finall[m];
    int flag=1;
     for(i=0;i<n;i++)
    {

                if(flag==0)
                {
                     finall[i]='0';
                     flag=1;
                }
                else
                {
                    finall[i]='1';
                    flag=0;
                }
    }

   for(i=0;i<n;i++)
    cout<<finall[i];

}


#include<bits/stdc++.h>
using namespace std;
#define mem(a,val) memset(a, (val), sizeof a)
int main()
{
    long long int n,m,i,j,p,q;
    cin>>n>>m;
    long long int a[m][2];
    for(i=0;i<m;i++)
    {

        cin>>a[i][0]>>a[i][1];

    }

    char finall[m];

   for(i=0;i<n;i++)
   {
       if(i%2==0)
        cout<<'0';
       else
        cout<<'1';
   }

}


#include<bits/stdc++.h>
using namespace std;
#define mem(a,val) memset(a, (val), sizeof a)
int main()
{
    long long int n,m,i,j,p,q;
    cin>>n>>m;
    long long int a[m][2];
    vector<pair<int ,pair<int,int> > > ss;
    for(i=0;i<m;i++)
    {

        cin>>a[i][0]>>a[i][1];
        pair<int,int> w1;
        pair<int ,pair<int,int> >w2;
        w1.first=a[i][0];
        w1.second=a[i][1];
        w2.first=a[i][1]-a[i][0]+1;
       w2.second=w1;
       ss.push_back(w2);

    }
    char finall[m];

    sort(ss.begin(),ss.end());
    for(i=0;i<ss.size();i++)
    {

       // cout<<ss[i].first<<" "<< ss[i].second.first<<" "<< ss[i].second.second<<endl;

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

                if(flag==0)
                {
                     finall[i]='0';
                     flag=1;
                }
                else
                {
                    finall[i]='1';
                    flag=0;
                }
    }

   for(i=0;i<m;i++)
    cout<<finall[i];

}


#include<bits/stdc++.h>
using namespace std;
int a[1000];
int main()
{
    int n,m;
    pair<int,int>p[1000];
    cin>>n>>m;
    for(int i=1; i<=m; i++)
    {

        cin>>p[i].first>>p[i].second;

    }
    sort(p+1,p+m+1);
    for(int i=1; i<=m; i++)
    {
        int fl=0,bel=0;
        int c=p[i].first;
        int d=p[i].second;
        if((d-c)==1)
        {
            a[c]=3;
            a[d]=4;
        }
        else
        {
        for(int j=c; j<=d; j++)
        {

            if(a[j]==3)fl++;
            else if(a[j]==4)bel++;
            else if(a[j]!=3&&a[j]!=4)
            {
                if(fl>bel)
                {
                    a[j]=4;
                    bel++;
                }
                else
                {
                    a[j]=3;
                    fl++;
                }
            }

        }
        }
    }
    for(int i=1; i<=n; i++)
    {
        if(a[i]==3)cout<<0;
        else cout<<1;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1000];
int main()
{
    int n,m;
    int c,d;
    cin>>n>>m;
    for(int i=1; i<=m; i++)
    {int fl=0,bel=0;
        cin>>c>>d;
        for(int j=c; j<=d; j++)
        {

            if(a[j]==3)fl++;
            else if(a[j]==4)bel++;
            else if(a[j]!=3&&a[j]!=4)
            {
                if(fl>bel)
                {
                    a[j]=4;
                    bel++;
                }
                else
                {
                    a[j]=3;
                    fl++;
                }
            }

        }
    }
    for(int i=1; i<=n; i++)
    {
        if(a[i]==3)cout<<0;
        else cout<<1;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1000];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=m;i++)cin>>a[i]>>a[i];
    for(int i=1;i<=n;i++)
    {
        if(i%2==0)cout<<1;
        else cout<<0;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
bool compr(pair<ll,ll>p1,pair<ll,ll>p2)
{
	return p1.second-p1.first>p2.second-p1.first;
}
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone,cz=0,co=0;
	in2(n,m);
	vector<ll>str(n+1);
	vector<pair<ll,ll> >vec;
	nfl(i,n+1)
	{
		str[i]=2;
	}
	nfl(i,m)
	{
		in2(l,r);
		vec.pb(mp(l,r));
	}
	sort(vec.begin(),vec.end(),compr);
	nfl(i,m)
	{
		l=vec[i].first;
		r=vec[i].second;
		pp=r-l+1;
		co=0;
		cz=0;
		sfl(j,l,r+1)
		{
			if(str[j]==0)
				cz++;
			else
			if(str[j]==1)
				co++;
		}
		if(pp%2==0)
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
		}
		else
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
			if(rzero>rone)
			{
				rzero++;
			}
			else
			{
				rone++;
			}
		}
		sfl(j,l,r+1)
		{
			if(str[j]==2)
			{
				if(rzero)
				{
					str[j]=0;
					rzero--;
					continue;
				}
				if(rone)
				{
					str[j]=1;
					rone--;
				}
			}
		}
	}
	sfl(i,1,n+1)
	{
		cout<<str[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
bool compr(pair<ll,ll>p1,pair<ll,ll>p2)
{
	return p1.second-p1.first>p2.second-p1.first;
}
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone,cz=0,co=0;
	in2(n,m);
	vector<ll>str(n+1);
	vector<pair<ll,ll> >vec;
	nfl(i,n+1)
	{
		str[i]=2;
	}
	nfl(i,m)
	{
		in2(l,r);
		vec.pb(mp(l,r));
	}
	sort(vec.begin(),vec.end(),compr);
	nfl(i,m)
	{
		l=vec[i].first;
		r=vec[i].second;
		pp=r-l+1;
		co=0;
		cz=0;
		sfl(j,l,r+1)
		{
			if(str[j]==0)
				cz++;
			else
			if(str[j]==1)
				co++;
		}
		if(pp%2==0)
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
		}
		else
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
			if(co>cz)
			{
				rzero++;
			}
			else
			{
				rone++;
			}
		}
		sfl(j,l,r+1)
		{
			if(str[j]==2)
			{
				if(rzero)
				{
					str[j]=0;
					rzero--;
					continue;
				}
				if(rone)
				{
					str[j]=1;
					rone--;
				}
			}
		}
	}
	sfl(i,1,n+1)
	{
		cout<<str[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone;
	in2(n,m);
	vector<ll>str(n+1);
	nfl(i,n+1)
	{
		str[i]=2;
	}
	nfl(i,m)
	{
		in2(l,r);
		pp=r-l+1;
		if(pp%2==0)
		{
			rone=pp/2;
			rzero=pp/2;
		}
		else
		{
			rone=pp/2+1;
			rzero=pp/2;
		}
		cout<<rzero<<' '<<rone<<'\n';
		sfl(j,l,r+1)
		{
			if(str[j]==0)
			rzero--;
			else
			if(str[j]==1)
			rone--;
		}
		cout<<rzero<<' '<<rone<<'\n';
		sfl(j,l,r+1)
		{
			if(str[j]==2)
			{
				if(rzero!=0)
				{
					str[j]=0;
					rzero--;
					continue;
				}
				else
				{
					if(rone!=0)
					{
						str[j]=1;
						rone--;
						continue;
					}
				}
			}
		}
	}
	sfl(i,1,n+1)
	{
		cout<<str[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone,cz=0,co=0;
	in2(n,m);
	//vector<ll>str(n+1);
	vector<pair<ll,ll> >vec;
	nfl(i,m)
	{
		in2(l,r);
		vec.pb(mp(l,r));
	}
	ll chance=0;
	string str="";
	nfl(i,n)
	{
		if(chance==0)
		{
			str+="0";
		}
		else
		{
			str+="1";
		}
		chance=1-chance;
	}
	cout<<str<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
bool compr(pair<ll,ll>p1,pair<ll,ll>p2)
{
	return p1.second-p1.first>p2.second-p1.first;
}
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone,cz=0,co=0;
	in2(n,m);
	vector<ll>str(n+1);
	vector<pair<ll,ll> >vec;
	nfl(i,n+1)
	{
		str[i]=2;
	}
	nfl(i,m)
	{
		in2(l,r);
		vec.pb(mp(l,r));
	}
	//sort(vec.begin(),vec.end(),compr);
	nfl(i,m)
	{
		l=vec[i].first;
		r=vec[i].second;
		pp=r-l+1;
		co=0;
		cz=0;
		sfl(j,l,r+1)
		{
			if(str[j]==0)
				cz++;
			else
			if(str[j]==1)
				co++;
		}
		if(pp%2==0)
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
		}
		else
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
			if(rzero>rone)
			{
				rzero++;
			}
			else
			{
				rone++;
			}
		}
		sfl(j,l,r+1)
		{
			if(str[j]==2)
			{
				if(rzero)
				{
					str[j]=0;
					rzero--;
					continue;
				}
				if(rone)
				{
					str[j]=1;
					rone--;
				}
			}
		}
	}
	sfl(i,1,n+1)
	{
		cout<<str[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone;
	in2(n,m);
	vector<ll>str(n+1);
	nfl(i,n+1)
	{
		str[i]=2;
	}
	nfl(i,m)
	{
		in2(l,r);
		pp=r-l+1;
		if(pp%2==0)
		{
			rone=pp/2;
			rzero=pp/2;
		}
		else
		{
			rone=pp/2+1;
			rzero=pp/2;
		}
		//cout<<rzero<<' '<<rone<<'\n';
		sfl(j,l,r+1)
		{
			if(str[j]==0)
			rzero--;
			else
			if(str[j]==1)
			rone--;
		}
		//cout<<rzero<<' '<<rone<<'\n';
		sfl(j,l,r+1)
		{
			if(str[j]==2)
			{
				if(rzero!=0)
				{
					str[j]=0;
					rzero--;
					continue;
				}
				else
				{
					if(rone!=0)
					{
						str[j]=1;
						rone--;
						continue;
					}
				}
			}
		}
	}
	sfl(i,1,n+1)
	{
		cout<<str[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 10000000
#define mod 1000000007
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
using namespace std;
bool compr(pair<ll,ll>p1,pair<ll,ll>p2)
{
	return p1.second-p1.first>p2.second-p1.first;
}
int main()
{
	gear_change;
	ll n,m,l,r,pp,j,i,rzero,rone,cz=0,co=0;
	in2(n,m);
	vector<ll>str(n+1);
	vector<pair<ll,ll> >vec;
	nfl(i,n+1)
	{
		str[i]=2;
	}
	nfl(i,m)
	{
		in2(l,r);
		vec.pb(mp(l,r));
	}
	sort(vec.begin(),vec.end(),compr);
	nfl(i,m)
	{
		l=vec[i].first;
		r=vec[i].second;
		pp=r-l+1;
		co=0;
		cz=0;
		sfl(j,l,r+1)
		{
			if(str[j]==0)
				cz++;
			else
			if(str[j]==1)
				co++;
		}
		if(pp%2==0)
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
		}
		else
		{
			rone=pp/2;
			rzero=pp/2;
			if(cz>rzero)
			{
				rzero=0;
			}
			else
			{
				rzero-=cz;
			}
			if(co>rone)
			{
				rone=0;
			}
			else
			{
				rone-=co;
			}
			if(rzero<rone)
			{
				rzero++;
			}
			else
			{
				rone++;
			}
		}
		sfl(j,l,r+1)
		{
			if(str[j]==2)
			{
				if(rzero)
				{
					str[j]=0;
					rzero--;
					continue;
				}
				if(rone)
				{
					str[j]=1;
					rone--;
				}
			}
		}
	}
	sfl(i,1,n+1)
	{
		cout<<str[i];
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>

using namespace std;
int main(){

 	long long n,m;
 	cin>>n>>m;
 	long long a[m+1][2];
 	// long long cnt=0, temp, rem = 0;
 	for(int i=0;i<m;i++){
 		cin>>a[i][0]>>a[i][1];
 	}
 	string s="";
 	for(int i=0;i<n;i++){
		if (i%2==0){
			s+="0";
		}else{
			s+="1";
		}
 	}
 	cout<<s;

}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>

using namespace std;
int main(){

 	long long n,m;
 	cin>>n>>m;
 	long long a[n+1][2];
 	// long long cnt=0, temp, rem = 0;
 	for(int i=0;i<m;i++){
 		cin>>a[i][0]>>a[i][1];
 	}
 	string s="";
 	for(int i=0;i<n;i++){
		if (i%2==0){
			s+="0";
		}else{
			s+="1";
		}
 	}
 	cout<<s;

}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>

using namespace std;
int main(){

 	int n,m;
 	cin>>n>>m;
 	int a[n][2];
 	// long long cnt=0, temp, rem = 0;
 	for(int i=0;i<m;i++){
 		cin>>a[i][0]>>a[i][1];
 	}
 	string s="";
 	for(int i=0;i<n;i++){
		if (i%2==0){
			s+="0";
		}else{
			s+="1";
		}
 	}
 	cout<<s;

}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>

using namespace std;
int main(){

 	int n,m;
 	cin>>n>>m;
 	int a[n+1][3];
 	// long long cnt=0, temp, rem = 0;
 	for(int i=0;i<m;i++){
 		cin>>a[i][0]>>a[i][1];
 	}
 	string s="";
 	for(int i=0;i<n;i++){
		if (i%2==0){
			s+="0";
		}else{
			s+="1";
		}
 	}
 	cout<<s;

}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>

using namespace std;
int main(){

 	int n,m;
 	cin>>n>>m;
 	int a[n+1][2];
 	// long long cnt=0, temp, rem = 0;
 	for(int i=0;i<m;i++){
 		cin>>a[i][0]>>a[i][1];
 	}
 	string s="";
 	for(int i=0;i<n;i++){
		if (i%2==0){
			s+="0";
		}else{
			s+="1";
		}
 	}
 	cout<<s;

}


#include <bits/stdc++.h>

using namespace std;
int type[1001];
typedef pair<int,int> ii;
bool cmp (ii a,ii b)
{
    return a.second < b.second || (a.second==b.second && a.first > b.first);
}
int main()
{
    int n,m;
    cin >> n >> m;
    vector<ii> contain;
    int x,y;
    for (int i=1;i<=m;i++)
    {
        cin >> x >> y;
        contain.push_back(ii(x,y));
    }
    contain.push_back(ii(1,n));
    sort(contain.begin(),contain.end(),cmp);
    for (int i=0;i<contain.size();i++)
    {
        ii data=contain[i];
        int xi=data.first;
        int yi=data.second;
        bool flag=true;
        int st_Idx;
        for (int j=xi;j<=yi;j++)
        {
            if (type[j])
            {
                flag=false;
                st_Idx=j;
                break;
            }
        }
        if (flag)
        {
            for (int j=xi;j<=yi;j++)
            {
                if (j==xi)
                    type[j]=1;
                else if (type[j-1]==1)type[j]=2;
                else if (type[j-1]==2)type[j]=1;
            }
        }
        else
        {
            for (int j = st_Idx-1;j>=xi;j--)
            {
                if (!type[j])
                {
                    if (type[j+1]==2)type[j]=1;
                    else if (type[j+1]==1)type[j]=2;
                }
            }
            for (int j=st_Idx+1;j<=yi;j++)
            {
                if (!type[j])
                {
                    if (type[j-1]==1)type[j]=2;
                    else if (type[j-1]==2)type[j]=1;
                }
            }
        }
    }
    for (int i=1;i<=n;i++)
        cout << type[i]-1;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int type[1001];
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
bool cmp (iii a,iii b)
{
    return a.first >b.first;
}
int main()
{
    int n,m;
    cin >> n >> m;
    vector<iii> contain;
    int x,y;
    for (int i=1;i<=m;i++)
    {
        cin >> x >> y;
        contain.push_back(iii(y-x+1,ii(x,y)));
    }
    sort(contain.begin(),contain.end(),cmp);
    for (int i=0;i<contain.size();i++)
    {
        iii data=contain[i];
        int xi=data.second.first;
        int yi=data.second.second;
        bool flag=true;
        int st_Idx;
        for (int j=xi;j<=yi;j++)
        {
            if (type[j])
            {
                flag=false;
                st_Idx=j;
                break;
            }
        }
        if (flag)
        {
            for (int j=xi;j<=yi;j++)
            {
                if (j==xi)
                    type[j]=1;
                else if (type[j-1]==1)type[j]=2;
                else if (type[j-1]==2)type[j]=1;
            }
        }
        else
        {
            for (int j = st_Idx-1;j>=xi;j--)
            {
                if (!type[j])
                {
                    if (type[j+1]==2)type[j]=1;
                    else if (type[j+1]==1)type[j]=2;
                }
            }
            for (int j=st_Idx+1;j<=yi;j++)
            {
                if (!type[j])
                {
                    if (type[j-1]==1)type[j]=2;
                    else if (type[j-1]==2)type[j]=1;
                }
            }
        }
    }
    for (int i=1;i<=n;i++)
        cout << type[i]-1;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int type[1001];
int main()
{
    int n,m;
    cin >> n >> m;
    int x,y;
    for (int i=1;i<=m;i++)
        cin >> x >> y;
    int change=0;
    for (int i=1;i<=n;i++)
    {
        if (change)
        {
            type[i]=1;
            change=0;
        }
        else
        {
            type[i]=0;
            change=1;
        }
    }
    for (int i=1;i<=n;i++)
        cout << type[i];
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int type[1001];
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
int main()
{
    int n,m;
    cin >> n >> m;
    vector<iii> contain;
    int x,y;
    for (int i=1;i<=m;i++)
    {
        cin >> x >> y;
        contain.push_back(iii(y-x+1,ii(x,y)));
    }
    sort(contain.begin(),contain.end());
    for (int i=0;i<contain.size();i++)
    {
        iii data=contain[i];
        int xi=data.second.first;
        int yi=data.second.second;
        bool flag=true;
        int st_Idx;
        for (int j=xi;j<=yi;j++)
        {
            if (type[j])
            {
                flag=false;
                st_Idx=j;
                break;
            }
        }
        if (flag)
        {
            for (int j=xi;j<=yi;j++)
            {
                if (j==xi)
                    type[j]=1;
                else if (type[j-1]==1)type[j]=2;
                else if (type[j-1]==2)type[j]=1;
            }
        }
        else
        {
            for (int j = st_Idx-1;j>=xi;j--)
            {
                if (type[j+1]==1)type[j]=2;
                else if (type[j+1]==2)type[j]=1;
            }
            for (int j=st_Idx+1;j<=yi;j++)
            {
                if (type[j-1]==1)type[j]=2;
                else if (type[j-1]==2)type[j]=1;
            }
        }
    }
    for (int i=1;i<=n;i++)
        cout << type[i]-1;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int type[1001];
typedef pair<int,int> ii;
bool cmp (ii a,ii b)
{
    return a.second < b.second || (a.second==b.second && a.first > b.first);
}
int main()
{
    int n,m;
    cin >> n >> m;
    vector<ii> contain;
    int x,y;
    for (int i=1;i<=m;i++)
    {
        cin >> x >> y;
        contain.push_back(ii(x,y));
    }
    sort(contain.begin(),contain.end(),cmp);
    for (int i=0;i<contain.size();i++)
    {
        ii data=contain[i];
        int xi=data.first;
        int yi=data.second;
        bool flag=true;
        int st_Idx;
        for (int j=xi;j<=yi;j++)
        {
            if (type[j])
            {
                flag=false;
                st_Idx=j;
                break;
            }
        }
        if (flag)
        {
            for (int j=xi;j<=yi;j++)
            {
                if (j==xi)
                    type[j]=1;
                else if (type[j-1]==1)type[j]=2;
                else if (type[j-1]==2)type[j]=1;
            }
        }
        else
        {
            for (int j = st_Idx-1;j>=xi;j--)
            {
                if (!type[j])
                {
                    if (type[j+1]==2)type[j]=1;
                    else if (type[j+1]==1)type[j]=2;
                }
            }
            for (int j=st_Idx+1;j<=yi;j++)
            {
                if (!type[j])
                {
                    if (type[j-1]==1)type[j]=2;
                    else if (type[j-1]==2)type[j]=1;
                }
            }
        }
    }
    for (int i=1;i<=n;i++)
        cout << type[i]-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a,b,mx=0;
    cin>>n>>m;
    while(m--)
    {
        cin>>a>>b;
        mx=max(mx,b);
    }
    for(int i=0;i<mx;i++)cout<<i%2;
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int ara[1009];
int main()
{
    int a,b,n,m;
    memset(ara,-1,sizeof ara);
    cin>>n>>m;
    while(m--)
    {
        cin>>a>>b;
        int one=(abs(a-b)+1)/2,zero=abs(b-a)+1-one;
        for(int i=a; i<=b; i++)
            if(ara[i]==1)one--;
            else if(ara[i]==0)zero--;
        for(int i=a; i<=b; i++)
            if(ara[i]==-1)
            {
                if(zero>0)ara[i]=0,zero--;
                else if(one>0)ara[i]=1,one--;
            }
    }
    for(int i=1; i<=n; i++)cout<<ara[i];
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int ara[1009];
priority_queue<pair<int,pair<int,int> > >pq;
int main()
{
    int a,b,n,m;
    memset(ara,-1,sizeof ara);
    cin>>n>>m;
    while(m--)
    {
        cin>>a>>b;
        pq.push({abs(a-b),{a,b}});
        int zero=(abs(a-b)+1)/2,one=abs(b-a)+1-zero;
        for(int i=a; i<=b; i++)
            if(ara[i]==1)one--;
            else if(ara[i]==0)zero--;
        for(int i=a; i<=b; i++)
            if(ara[i]==-1)
            {
                if(zero>0)ara[i]=0,zero--;
                else if(one>0)ara[i]=1,one--;
            }
    }
    for(int i=1; i<=n; i++)cout<<ara[i];
    cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a,b,mx=0;
    cin>>n>>m;
    while(m--)
    {
        cin>>a>>b;
        mx=max(mx,b);
    }
    for(int i=0;i<n;i++)cout<<i%2;
    cout<<endl;
}


#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define ll long long
#define pii pair<int,int>
#define pll pair<long,long>

using namespace std;

int main()
{
    ll n,m;
    cin>>n>>m;
    vector<pll> v;
    for(ll i=0; i<m; i++)
    {
    	ll l;
    	ll r;
    	cin>>l>>r;
    	v.pb(mp(l-1,r-1));
    }

    sort(v.begin(), v.end());
    string str = "";
    ll dif = v[0].second - v[0].first + 1;
    ll r;
    for(r=0; r<dif/2; r++)
    	str += "0";
    for(; r<dif; r++)
    	str += "1";
    // cout<<"hee";
    for(ll i=1; i<m; i++)
    {
    	ll zeros = 0;
    	ll ones = 0;
    	for(ll j=v[i].first; j<=v[i].second&&j<str.length(); j++)
    	{
    		if(str[j]=='1')
    			ones++;
    		if(str[j]=='0')
    			zeros++;
    	}

    	dif = v[i].second - v[i].first + 1;
    	ll cnt = dif/2 - zeros;
    	if(cnt>0)
    	{
	    	while(cnt)
	    	{
	    		str += "0";
	    		cnt--;
	    	}
	    }
    	cnt = dif/2 - ones;
    	// cout<<"cnt = "<<cnt<<" ";
    	if(cnt>0)
    	{
	    	while(cnt)
	    	{
	    		str += "1";
	    		cnt--;
	    	}
    	}
    }
    cout<<str;
    return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)x.size()
#define pushf push_front
#define popf pop_front
#define pushb push_back
#define popb pop_back
// caution: MLE/TLE → comment below and use explicit "ll"
#define int ll

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vii = vector<pii>;
using vll = vector<pll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
template <typename T> using pqmax = priority_queue<T>;
template <typename T> using pqmin = priority_queue<T, vector<T>, greater<T>>;

template <typename T> T inf() {return numeric_limits<T>::max()/2;}
template <typename T> inline T sq(T x){return x*x;}
template<typename A, typename B>
ostream& operator <<(ostream& os, const pair<A, B>& x) {
	os << x.fst << ' ' << x.snd; return os;
}
template<typename A, typename B>
istream& operator >>(istream& is, pair<A, B>& x) {
	is >> x.fst >> x.snd; return is;
}
template<typename A, typename B>
pair<A, B> operator +(const pair<A, B>& a, const pair<A, B>& b) {
	return pair<A, B>(a.fst+b.fst, a.snd+b.snd);
}
template<typename A, typename B>
pair<A, B> operator -(const pair<A, B>& a, const pair<A, B>& b) {
	return pair<A, B>(a.fst-b.fst, a.snd-b.snd);
}
template <typename T> auto cinvec(int n, int base=0) {
	vector<T> v(n+base);
	for (int i = base; i < sz(v); ++i) cin >> v[i];
	return v;
}
// multivec(size [1..D], (explicit)val)
template<class... Args>
auto multivec(size_t n, Args&&... args) {
	if constexpr(sizeof...(args) == 1)
		return vector(n, args...);
	else return vector(n, multivec(args...));
}
template <typename T> void sort(T& x, int base=0) {
	sort(x.begin()+base, x.end());
}
template <typename T> void reverse(T& x, int base=0) {
	reverse(x.begin()+base, x.end());
}
template <typename T> void uniq(T& x, int base=0) {
	x.erase(unique(x.begin()+base, x.end()), x.end());
}
template <typename T> int lbpos(T& x, int val, int base=0) {
	return lower_bound(x.begin()+base, x.end(), val) - x.begin();
}
template <typename T> ll getsum(vector<T>& x, int base=0) {
	ll ret = 0;
	for (int i = base; i < sz(x); ++i) ret += x[i];
	return ret;
}
template <typename T> T getmax(vector<T>& x, int base=0) {
	return *max_element(x.begin()+base, x.end());
}
template <typename T> T getmin(vector<T>& x, int base=0) {
	return *min_element(x.begin()+base, x.end());
}
ll rand(ll mn, ll mx=LLONG_MAX/2){
	static mt19937 rng(time(0)^(long long)(new int));
	return uniform_int_distribution<ll>(mn, mx-1)(rng);
}

/***********************************************************************************/
#define MULTITEST 0
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const ll MOD = 998244353;
const ll MAX = 3e5+2;

/***********************************************************************************/
int n, m;
vvi adj;
vector<bool> seen;
vector<int> us;

void dfs(int u) {
	seen[u] = true;
	us.pushb(u);
	for (auto v : adj[u]) {
		if (!seen[v]) dfs(v);
	}
}

void solve(int tc) {
	cin >> n >> m;
	if (n == 1) {
		if (m == 0) cout <<"YES\n1\n1 1\n";
		else if (m == 1) cout << "YES\n0\n";
		else cout << "NO\n";
		return;
	}
	if (n == 2) {
		if (m == 0) cout << "YES\n2\n1 2\n1 2\n";
		else if (m == 1) {
			int a, b; cin >> a >> b;
			if (a == b) cout << "NO\n";
			else cout << "YES\n1\n1 2\n";
		}
		else if (m == 2) {
			int a, b, c, d;
			cin >> a >> b >> c >> d;
			if (a==b || c==d) cout << "NO\n";
			else cout << "YES\n0\n";
		}
		else cout << "NO\n";
		return;
	}
	// 이제 loop와 multiple edge는 허용되지 않음
	adj = vvi(n+1);
	vector<int> in(n+1);
	auto chk = multivec(n+1, n+1, false);

	while (m--) {
		int u, v;
		cin >> u >> v;
		if (u == v || in[u] == 2 || in[v] == 2 || chk[u][v]) {
			cout << "NO\n"; return;
		}
		adj[u].pushb(v);
		adj[v].pushb(u);
		++in[u]; ++in[v];
		chk[u][v] = chk[v][u] = true;
	}
	// cycle을 이루는 컴포넌트가 있는가
	seen = vector<bool>(n+1);
	vii links;
	for (int u = 1; u <= n; ++u) {
		if (seen[u]) continue;
		us.clear(); dfs(u);
		pii link;
		for (auto v : us) {
			if (in[v] == 2) continue;
			if (!link.fst) link.fst = v;
			else {
				assert(!link.snd);
				link.snd = v;
			}
		}
		if (!link.fst) {
			if (sz(us) == n) cout << "YES\n0\n";
			else cout << "NO\n";
			return;
		}
		if (!link.snd) link.snd = link.fst;
		if (link.fst > link.snd) swap(link.fst, link.snd);
		links.pushb(link);
	}
	sort(links);
	cout << "YES\n";
	cout << sz(links) << '\n';
	for (int i = 0; i < sz(links); ++i) {
		int j = (i+1)%sz(links);
		cout << links[i].fst << ' ' << links[j].snd << '\n';
	}
}

/***********************************************************************************/
signed main(signed argc, char *argv[]) {
	ios::sync_with_stdio(0); cin.tie(0);
	cout << fixed << setprecision(11);
	bool mult = (MULTITEST && !(argc == 2 && (string)argv[1] == "test"));
	int T = 1; if (mult) cin >> T;
	for (int tc = 1; tc <= T; ++tc) solve(tc);
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)x.size()
#define pushf push_front
#define popf pop_front
#define pushb push_back
#define popb pop_back
// caution: MLE/TLE → comment below and use explicit "ll"
#define int ll

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vii = vector<pii>;
using vll = vector<pll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
template <typename T> using pqmax = priority_queue<T>;
template <typename T> using pqmin = priority_queue<T, vector<T>, greater<T>>;

template <typename T> T inf() {return numeric_limits<T>::max()/2;}
template <typename T> inline T sq(T x){return x*x;}
template<typename A, typename B>
ostream& operator <<(ostream& os, const pair<A, B>& x) {
	os << x.fst << ' ' << x.snd; return os;
}
template<typename A, typename B>
istream& operator >>(istream& is, pair<A, B>& x) {
	is >> x.fst >> x.snd; return is;
}
template<typename A, typename B>
pair<A, B> operator +(const pair<A, B>& a, const pair<A, B>& b) {
	return pair<A, B>(a.fst+b.fst, a.snd+b.snd);
}
template<typename A, typename B>
pair<A, B> operator -(const pair<A, B>& a, const pair<A, B>& b) {
	return pair<A, B>(a.fst-b.fst, a.snd-b.snd);
}
template <typename T> auto cinvec(int n, int base=0) {
	vector<T> v(n+base);
	for (int i = base; i < sz(v); ++i) cin >> v[i];
	return v;
}
// multivec(size [1..D], (explicit)val)
template<class... Args>
auto multivec(size_t n, Args&&... args) {
	if constexpr(sizeof...(args) == 1)
		return vector(n, args...);
	else return vector(n, multivec(args...));
}
template <typename T> void sort(T& x, int base=0) {
	sort(x.begin()+base, x.end());
}
template <typename T> void reverse(T& x, int base=0) {
	reverse(x.begin()+base, x.end());
}
template <typename T> void uniq(T& x, int base=0) {
	x.erase(unique(x.begin()+base, x.end()), x.end());
}
template <typename T> int lbpos(T& x, int val, int base=0) {
	return lower_bound(x.begin()+base, x.end(), val) - x.begin();
}
template <typename T> ll getsum(vector<T>& x, int base=0) {
	ll ret = 0;
	for (int i = base; i < sz(x); ++i) ret += x[i];
	return ret;
}
template <typename T> T getmax(vector<T>& x, int base=0) {
	return *max_element(x.begin()+base, x.end());
}
template <typename T> T getmin(vector<T>& x, int base=0) {
	return *min_element(x.begin()+base, x.end());
}
ll rand(ll mn, ll mx=LLONG_MAX/2){
	static mt19937 rng(time(0)^(long long)(new int));
	return uniform_int_distribution<ll>(mn, mx-1)(rng);
}

/***********************************************************************************/
#define MULTITEST 0
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const ll MOD = 998244353;
const ll MAX = 1e5+2;

/***********************************************************************************/
int n, m;
vvi adj;
vector<bool> seen;
vector<int> us;

void dfs(int u) {
	seen[u] = true;
	us.pushb(u);
	for (auto v : adj[u]) {
		if (!seen[v]) dfs(v);
	}
}

void solve(int tc) {
	cin >> n >> m;
	if (n == 1) {
		if (m == 0) cout <<"YES\n1\n1 1\n";
		else if (m == 1) cout << "YES\n0\n";
		else cout << "NO\n";
		return;
	}
	if (n == 2) {
		if (m == 0) cout << "YES\n2\n1 2\n1 2\n";
		else if (m == 1) {
			int a, b; cin >> a >> b;
			if (a == b) cout << "NO\n";
			else cout << "YES\n1\n1 2\n";
		}
		else if (m == 2) {
			int a, b, c, d;
			cin >> a >> b >> c >> d;
			if (a==b || c==d) cout << "NO\n";
			else cout << "YES\n0\n";
		}
		else cout << "NO\n";
		return;
	}
	// 이제 loop과 multiple edge는 허용하지 않음
	adj.resize(n+1);
	vector<int> in(n+1);
	auto isEdge = multivec(n+1, n+1, false);
	while (m--) {
		int u, v;
		cin >> u >> v;
		if (u == v || in[u] == 2 || in[v] == 2 || isEdge[u][v]) {
			cout << "NO\n"; return;
		}
		adj[u].pushb(v);
		adj[v].pushb(u);
		++in[u]; ++in[v];
		isEdge[u][v] = isEdge[v][u] = true;
	}
	// cycle을 이루는 컴포넌트가 있는지 확인
	seen.resize(n+1);
	auto port = multivec(n+1, 2, 0ll);
	int pIdx = 0;

	for (int u = 1; u <= n; ++u) {
		if (seen[u]) continue;
		us.clear(); dfs(u);
		pii tmp;
		for (auto v : us) {
			if (in[v] == 2) continue;
			if (!tmp.fst) tmp.fst = v;
			else {assert(!tmp.snd); tmp.snd = v;}
		}
		if (!tmp.fst) { // 사이클 발견
			if (sz(us) == n) cout << "YES\n0\n";
			else cout << "NO\n";
			return;
		}
		if (!tmp.snd) tmp.snd = tmp.fst;
		port[pIdx][0] = tmp.fst;
		port[pIdx][1] = tmp.snd;
		++pIdx;
	}
	cout << "YES\n";
	vii ans;
	auto chk = multivec(pIdx,2, false);
	in = vector<int>(pIdx);
	for (int u = 1; u <= n; ++u)
		for (int v = u+1; v <= n; ++v) {
			// port에서 (u, v) 찾기
			int a=-1, b=-1, c=-1, d=-1;
			for (int i = 0; i < pIdx; ++i)
				for (int j = 0; j < 2; ++j) {
					if (chk[i][j]) continue;
					if (port[i][j] == u) {a=i; b=j;}
					else if (port[i][j] == v) {c=i; d=j;}
				}
			if (a==-1 || c==-1 || in[a]+in[c] > 1) continue;
			ans.pushb({u, v});
			++in[a]; ++in[c];
			chk[a][b] = chk[c][d] = true;
		}
	int ru = -1, rv = -1;
	for (int i = 0; i < pIdx; ++i)
		for (int j = 0; j < 2; ++j) {
			if (chk[i][j]) continue;
			if (ru == -1) ru = port[i][j];
			else {assert(rv == -1); rv = port[i][j];}
		}
	if (ru != -1 && rv != -1) {
		if (ru > rv) swap(ru, rv);
		ans.pushb({ru, rv});
	}
	sort(ans);

	cout << sz(ans) << '\n';
	for (auto [u, v] : ans) {
		cout << u << ' ' << v << '\n';
	}
}

/***********************************************************************************/
signed main(signed argc, char *argv[]) {
	ios::sync_with_stdio(0); cin.tie(0);
	cout << fixed << setprecision(11);
	bool mult = (MULTITEST && !(argc == 2 && (string)argv[1] == "test"));
	int T = 1; if (mult) cin >> T;
	for (int tc = 1; tc <= T; ++tc) solve(tc);
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)x.size()
#define pushf push_front
#define popf pop_front
#define pushb push_back
#define popb pop_back
// caution: MLE/TLE → comment below and use explicit "ll"
#define int ll

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vii = vector<pii>;
using vll = vector<pll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
template <typename T> using pqmax = priority_queue<T>;
template <typename T> using pqmin = priority_queue<T, vector<T>, greater<T>>;

template <typename T> T inf() {return numeric_limits<T>::max()/2;}
template <typename T> inline T sq(T x){return x*x;}
template<typename A, typename B>
ostream& operator <<(ostream& os, const pair<A, B>& x) {
	os << x.fst << ' ' << x.snd; return os;
}
template<typename A, typename B>
istream& operator >>(istream& is, pair<A, B>& x) {
	is >> x.fst >> x.snd; return is;
}
template<typename A, typename B>
pair<A, B> operator +(const pair<A, B>& a, const pair<A, B>& b) {
	return pair<A, B>(a.fst+b.fst, a.snd+b.snd);
}
template<typename A, typename B>
pair<A, B> operator -(const pair<A, B>& a, const pair<A, B>& b) {
	return pair<A, B>(a.fst-b.fst, a.snd-b.snd);
}
template <typename T> auto cinvec(int n, int base=0) {
	vector<T> v(n+base);
	for (int i = base; i < sz(v); ++i) cin >> v[i];
	return v;
}
// multivec(size [1..D], (explicit)val)
template<class... Args>
auto multivec(size_t n, Args&&... args) {
	if constexpr(sizeof...(args) == 1)
		return vector(n, args...);
	else return vector(n, multivec(args...));
}
template <typename T> void sort(T& x, int base=0) {
	sort(x.begin()+base, x.end());
}
template <typename T> void reverse(T& x, int base=0) {
	reverse(x.begin()+base, x.end());
}
template <typename T> void uniq(T& x, int base=0) {
	x.erase(unique(x.begin()+base, x.end()), x.end());
}
template <typename T> int lbpos(T& x, int val, int base=0) {
	return lower_bound(x.begin()+base, x.end(), val) - x.begin();
}
template <typename T> ll getsum(vector<T>& x, int base=0) {
	ll ret = 0;
	for (int i = base; i < sz(x); ++i) ret += x[i];
	return ret;
}
template <typename T> T getmax(vector<T>& x, int base=0) {
	return *max_element(x.begin()+base, x.end());
}
template <typename T> T getmin(vector<T>& x, int base=0) {
	return *min_element(x.begin()+base, x.end());
}
ll rand(ll mn, ll mx=LLONG_MAX/2){
	static mt19937 rng(time(0)^(long long)(new int));
	return uniform_int_distribution<ll>(mn, mx-1)(rng);
}

/***********************************************************************************/
#define MULTITEST 0
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const ll MOD = 998244353;
const ll MAX = 1e5+2;

/***********************************************************************************/
int n, m;
vector<int> par;

int find(int u) {
	if (!par[u]) return u;
	return par[u] = find(par[u]);
}
void merge(int u, int v) {
	u = find(u); v = find(v);
	par[u] = v;
}

void solve(int tc) {
	cin >> n >> m;
	if (n == 1) {
		if (m == 0) cout <<"YES\n1\n1 1\n";
		else if (m == 1) cout << "YES\n0\n";
		else cout << "NO\n";
		return;
	}
	if (n == 2) {
		if (m == 0) cout << "YES\n2\n1 2\n1 2\n";
		else if (m == 1) {
			int a, b; cin >> a >> b;
			if (a == b) cout << "NO\n";
			else cout << "YES\n1\n1 2\n";
		}
		else if (m == 2) {
			int a, b, c, d;
			cin >> a >> b >> c >> d;
			if (a==b || c==d) cout << "NO\n";
			else cout << "YES\n0\n";
		}
		else cout << "NO\n";
		return;
	}
	// 이제 loop과 multiple edge는 허용하지 않음
	vector<int> in(n+1);
	auto isEdge = multivec(n+1, n+1, false);
	par.resize(n+1);

	while (m--) {
		int u, v;
		cin >> u >> v;
		if (u == v || in[u] == 2 || in[v] == 2 || isEdge[u][v]) {
			cout << "NO\n"; return;
		}
		++in[u]; ++in[v];
		isEdge[u][v] = isEdge[v][u] = true;
		merge(u, v);
	}
	vii ans;
	for (int u = 1; u <= n; ++u)
		for (int v = u+1; v <= n; ++v) {
			// edge u-v를 추가할 수 있는가
			if (find(u)==find(v) || in[u]==2 || in[v]==2) continue;
			merge(u, v); ++in[u]; ++in[v];
			ans.pushb({u, v});
		}
	int ru = -1, rv = -1;
	for (int i = 1; i <= n; ++i) {
		if (in[i] != 1) continue;
		if (ru == -1) ru = i;
		else rv = i;
	}
	if (ru > rv) swap(ru, rv);
	ans.pushb({ru, rv});
	sort(ans);

	cout << "YES\n" << sz(ans) << '\n';
	for (auto [u, v] : ans) {
		cout << u << ' ' << v << '\n';
	}
}

/***********************************************************************************/
signed main(signed argc, char *argv[]) {
	ios::sync_with_stdio(0); cin.tie(0);
	cout << fixed << setprecision(11);
	bool mult = (MULTITEST && !(argc == 2 && (string)argv[1] == "test"));
	int T = 1; if (mult) cin >> T;
	for (int tc = 1; tc <= T; ++tc) solve(tc);
}


#include <bits/stdc++.h>
using namespace std;
int i,j,x,y,n,m,p[502],a[502],ans;
int P(int u)
{
	if (p[u]==u) return u;
	p[u]=P(p[u]);
	return p[u];
}

void uni(int x, int y)
{
	p[P(x)]=P(y);
}

int main (){
	cin>>n>>m;
	if (m>n) {cout<<"NO"; return 0;}
	for (i=1;i<=n;i++) p[i]=i;
	for (i=1;i<=m;i++){
		cin>>x>>y;
		a[x]++; a[y]++;
		if (P(x)==P(y) && i!=n) {cout<<"NO"; return 0;}
		uni(x,y);
	}

	for (i=1;i<=n;i++)
	if (a[i]>2) {cout<<"NO"; return 0;}
	cout<<"YES"<<endl;
	cout<<n-m<<endl;
	for (i=1;i<=n;i++)
	while (a[i]<2)
	{
		ans=i+(n!=1);
		for (j=ans;j<=n;j++)
		if (a[j]<2 && (n<=2 || m+1==n || P(i)!=P(j)))
		{cout<<i<<" "<<j<<endl;  m++; a[i]++; a[j]++; uni(i,j); break;}
	}
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ll long long
#define zeros(x) x^(x-1)&x
#define pii pair<ll,ll>
#define Nmax 2500
using namespace std;

const int INF = 2e9;

int n, m, fst, a, b;
bool uz[Nmax];
vector<int> v[Nmax];
vector<pii> ans;

int cycle(int nod, int ant, int lg){
    if (uz[nod]) return 0;
    uz[nod] = 1;
    for (auto it : v[nod]){
        if (it == ant) continue;
        if (uz[it]){
            if (it != fst) return 1;
            else return lg;
        }
        int x = cycle(it, nod, lg+1);
        return x;
    }
    return 0;
}

bool conex(int a, int b){
    uz[a] = 1;
    if (a==b) return 1;
    for (auto it : v[a]){
        if (uz[it]) continue;
        return conex(it,b);
    }
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
    cin >> n >> m;
    for (int i=1;i<=m;i++){
        cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    int ok = -1;
    for (int i=1;i<=n;i++){
        if (v[i].size() > 2){
            cout << "NO\n";
            return 0;
        }
        fst = i;
        int x = cycle(i, -1, 1);
        if (x == n) ok = 1;
        else if (x) ok = 0;
    }
    if (ok == 0){
        cout << "NO\n";
        return 0;
    }

    vector<int> e;
    for (int i=1;i<=n;i++)
        if (v[i].size()==1)
            e.push_back(i);

    ok = 0;
    for (int i=0;i<e.size();i++){
        for (int j=i+1;j<e.size();j++){
            memset(uz,0,sizeof(uz));
            bool x = conex(e[i],e[j]);
            if (e[i] && e[j] && (!x || ok == 0)){
                if (x) ok = 1;
                v[e[i]].push_back(e[j]);
                v[e[j]].push_back(e[i]);
                ans.push_back({min(e[i],e[j]), max(e[i],e[j])});
                e[i] = 0;
                e[j] = 0;
                break;
            }
        }
        if(e[i]){
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    cout << ans.size() << '\n';
    for (auto it : ans){
        cout << it.first << ' ' << it.second << '\n';
    }

    return 0;
}