#include<bits/stdc++.h>
#include<math.h>
#include<limits>
#define ll long long
using namespace std;
int main()
{
	ll n,m;
	int flag=1;
	int a[3000003];
	for( int i=0; i<3000002; i++)
	{
		a[i]=2;
	}
	cin>>n>>m;
	for( int i=0; i<n; i++ )
		a[(3*i)+2] = 0;
	if(m<n-1 || m>(2*n)+2)
	{
		cout<<-1;
		flag =0;
	}
	else if(m == n-1|| m == n)
	{
		for( int i=0; i<m; i++)
			a[3*i] = 1;
	}
	else
	{
		for( int i=0; i<n+1; i++)
			a[3*i] = 1;
		m = m-n-1;
		for( int i=0; i<m; i++)
			a[(3*i)+1] = 1;
	}
	if(flag!=0)
	{
		for( int i=0; i<(3*n)+1; i++)
		{
			if(a[i]!=2)
				cout<<a[i];
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<math.h>
#include<limits>
#define ll long long
using namespace std;
int main()
{
	ll n,m;
	int flag=1;
	int a[3000003];
	for( int i=0; i<3000002; i++)
	{
		a[i]=2;
	}
	cin>>n>>m;
	for( int i=0; i<n; i++ )
		a[(3*i)+2] = 0;
	if(m<n-1 || m>(2*n)+2)
	{
		cout<<-1;
		flag =0;
	}
	else if(m == n-1|| m == n)
	{
		for( int i=0; i<m; i++)
			a[3*i] = 1;
	}
	else
	{
		for( int i=0; i<n+1; i++)
			a[3*i] = 1;
		m = m-n-1;
		for( int i=0; i<m; i++)
			a[(3*i)+1] = 1;
	}
	if(flag!=0)
	{
		for( int i=0; i<(3*n)-1; i++)
		{
			if(a[i]!=2)
				cout<<a[i];
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<math.h>
#include<limits>
#define ll long long
using namespace std;
int main()
{
	ll n,m;
	int a[3000001];
	for( int i=0; i<3000000; i++)
	{
		a[i]=2;
	}
	cin>>n>>m;
	for( int i=0; i<n; i++ )
		a[(3*i)+2] = 0;
	if(m<n-1 || m>(2*n)+2)
		cout<<-1;
	else if(m == n-1|| m == n)
	{
		for( int i=0; i<m; i++)
			a[3*i] = 1;
	}
	else
	{
		for( int i=0; i<n+1; i++)
			a[3*i] = 1;
		m = m-n-1;
		for( int i=0; i<m; i++)
			a[(3*i)+1] = 1;
	}
	for( int i=0; i<(3*n)+2; i++)
	{
		if(a[i]!=2)
			cout<<a[i];
	}
	return 0;
}


#include<bits/stdc++.h>
#include<math.h>
#include<limits>
#define ll long long
using namespace std;
int main()
{
	ll n,m;
	int flag=1;
	int a[3000003];
	for( int i=0; i<3000002; i++)
	{
		a[i]=2;
	}
	cin>>n>>m;
	for( int i=0; i<n; i++ )
		a[(3*i)+2] = 0;
	if(m<n-1 || m>(2*n)+2)
	{
		cout<<-1;
		flag =0;
	}
	else if(m == n-1|| m == n)
	{
		for( int i=0; i<m; i++)
			a[3*i] = 1;
	}
	else
	{
		for( int i=0; i<n+1; i++)
			a[3*i] = 1;
		m = m-n-1;
		for( int i=0; i<m; i++)
			a[(3*i)+1] = 1;
	}
	if(flag!=0)
	{
		for( int i=0; i<(3*n); i++)
		{
			if(a[i]!=2)
				cout<<a[i];
		}
	}
	return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    if(zeros-1 == ones){
        res = "1";

        for(int i = 1; i <= zeros+ones; i++)
        {
            if(res[res.length()-1] == '1') res+="0";else res+="1";
        }
        cout << res;
        return 0;
    }
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros-1;
        onesC = ones-1;
        res = "01";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros;
        onesC = ones;
        res = "10";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;
    string res="011";
    int zerosC = zeros-1, onesC = ones-2;
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    if(zeros-1 == ones){
        res = "0";

        for(int i = 1; i < zeros+ones; i++)
        {
            if(res[res.length()-1] == '1') res+="0";else res+="1";
        }
        cout << res;
        return 0;
    }
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros-1;
        onesC = ones-1;
        res = "01";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros-1;
        onesC = ones-1;
        res = "01";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros;
        oneC = ones;
        res = "10";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;
    string res = "";
    if(zeros == ones){
        res+="1";
        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros-1 == ones){
        res+="0";

        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros+1 == ones){
        res+="1";

        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros > ones){
        cout << -1;
        return 0;
    }
    bool answ = false;
    int oneCopy = ones, zeroCopy = zeros;
    int breakPoint = -1;

    while(oneCopy > 0 or zeroCopy > 0){
        if(oneCopy - 2 == zeroCopy -1){
            oneCopy-=2;
            zeroCopy-=1;
            res+="110";
        }else if(oneCopy - 1 == zeroCopy-1){
            oneCopy -= 1;
            zeroCopy -= 1;
            res+="10";
        }else{
            oneCopy -= 2;
            zeroCopy -= 1;
            res+="110";
        }
    }
    if(oneCopy == 0 && zeroCopy == 0) cout << res ;
    else
        cout << -1;

    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros;
        onesC = ones;
        res = "01";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;
    string res = "";
    if(zeros == ones){
        res+="1";
        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros-1 == ones){
        res+="0";

        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros+1 == ones){
        res+="1";

        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros > ones){
        cout << -1;
        return 0;
    }
    bool answ = false;
    int oneCopy = ones, zeroCopy = zeros;
    int breakPoint = -1;
    if(zeros*2 == ones)
    {
        for(int i = 1; i <= ones+zeros; i+=3){
            res+="011";
        }
        cout << res;
        return 0;
    }

    if(zeros*2+1 == ones){
        for(int i = 1; i <= (ones+zeros)+1; i+=3){
            res+="110";
        }
        res[res.length()-1] = ' ';
        res[res.length()-2] = ' ';
        cout << res;
        return 0;
    }

    if(zeros*2+2 == ones){
        for(int i = 1; i <= (ones+zeros)+1; i+=3){
            res+="110";
        }
        res[res.length()-1] = ' ';
        cout << res;

        return 0;
    }
    cout << -1;

    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;
    string res = "";
    if(zeros == ones){
        res+="1";
        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros+1 == ones){
        res+="0";

        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros > ones){
        cout << -1;
        return 0;
    }
    bool answ = false;
    int oneCopy = ones, zeroCopy = zeros;
    int breakPoint = -1;
    if(zeros*2 == ones)
    {
        for(int i = 1; i <= ones+zeros; i+=3){
            res+="011";
        }
        cout << res;
        return 0;
    }

    if(zeros*2+1 == ones){
        for(int i = 1; i <= (ones+zeros)+1; i+=3){
            res+="110";
        }
        res[res.length()-1] = ' ';
        res[res.length()-2] = ' ';
        cout << res;
        return 0;
    }

    if(zeros*2+2 == ones){
        for(int i = 1; i <= (ones+zeros)+1; i+=3){
            res+="110";
        }
        res[res.length()-1] = ' ';
        cout << res;

        return 0;
    }
    cout << -1;

    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;

    string res="011";
    if(zeros+1 == ones){
        res = "1";

        for(int i = 1; i <= zeros+ones; i++)
        {
            if(res[res.length()-1] == '1') res+="0";else res+="1";
        }
        cout << res;
        return 0;
    }
    int zerosC = zeros-1, onesC = ones-2;
    if(zeros == ones){
        zerosC = zeros-1;
        onesC = ones-1;
        res = "01";
    }
    while(onesC > 0 and zerosC > 0){
        if(zerosC == onesC){
            res+="01";
            zerosC--;
            onesC--;
        }else{
            res+="011";
            zerosC-=1;
            onesC-=2;
        }
    }

    if(zerosC == 0 and onesC == 0){
        cout << res;
        return 0;
    }

    if(zerosC == 0 and onesC == 2){
        string st = "11";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 0 and onesC == 1){
        string st = "1";
        st+=res;
        cout << st;
        return 0;
    }

    if(zerosC == 1 and onesC == 0){
        res+="0";
        cout << res; return 0;
    }
    cout <<  -1;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    int zeros, ones;
    cin >> zeros >> ones;
    string res = "";
    if(zeros == ones){
        res+="1";
        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros-1 == ones){
        res+="0";

        for(int i = 1; i < zeros+ones; i++){
            if(res[res.length()-1] == '1') res+="0";
            else res+="1";
        }

        cout << res;
        return 0;
    }

    if(zeros > ones){
        cout << -1;
        return 0;
    }
    bool answ = false;
    int oneCopy = ones, zeroCopy = zeros;
    int breakPoint = -1;
    if(zeros*2 == ones)
    {
        for(int i = 1; i <= ones+zeros; i+=3){
            res+="011";
        }
        cout << res;
        return 0;
    }

    if(zeros*2+1 == ones){
        for(int i = 1; i <= (ones+zeros)+1; i+=3){
            res+="110";
        }
        res[res.length()-1] = ' ';
        res[res.length()-2] = ' ';
        cout << res;
        return 0;
    }

    if(zeros*2+2 == ones){
        for(int i = 1; i <= (ones+zeros)+1; i+=3){
            res+="110";
        }
        res[res.length()-1] = ' ';
        cout << res;

        return 0;
    }
    cout << -1;

    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    print_node(root);
    printf("\n");
    p1=root->next;
    int tot=n;
    if(n==m+1)
        {
            node *pp3=newnode();
            pp3->num=0;
            pp3->next=root->next;
            root=pp3;
        }
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            printf("dfgdfg");
            in_sert(p1);
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }

    print_node(root);
    printf("\n");
    p1=root->next;
    int tot=n;
    if(n==m+1)
        {
            node *pp3=newnode();
            pp3->num=0;
            pp3->next=root->next;
            root=pp3;
        }
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    p1=root->next;
    int tot=n;
    if(n==m+1)
        {
            node *pp3=newnode();
            pp3->num=0;
            pp3->next=root->next;
            root=pp3;
        }
        /////////////////*********************��0**************************************
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    p1=root->next;
    int tot=n;
    if(n==m+1)
        {
            node *pp3=newnode();
            pp3->num=0;
            pp3->next=root->next;
            root=pp3;
        }
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    int tot=n;
    if(n==m+1)
        {
            root->num=0;
            p2=root->next;
            in_sert(p2);
            p2->next->num=1;
            tot--;
        }
        if(root->num==0)
        p1=root->next->next;
    else
        p1=root->next;
        /////////////////*********************��0**************************************
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    int tot=n;
        if(m==1)
        {
            if(tot==2)
            {
                printf("010"); return 0;
            }
            if(tot==1)
            {
                printf("10");return 0;
            }
        }
    if(n==m+1)
        {
            root->num=0;
            p2=root->next;
            in_sert(p2);
            p2->next->num=1;
            tot--;
        }

    if(root->num==0)
        p1=root->next->next;
    else
        p1=root->next;

        /////////////////*********************��0**************************************
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    p1=root->next;
    int tot=n;
    if(n==m+1)
        {
            node *pp3=newnode();
            pp3->num=0;
            pp3->next=root->next;
            root=pp3;
        }
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#define MAX  4002
using namespace std;

typedef struct Tnode
{
    int num;
    struct Tnode *next;
}node;

node * newnode()
{
    node *p=(node*)malloc(sizeof(node));
    if(p!=NULL)
        p->next=NULL;
    return p;
}

void in_sert(node *p)
{
    node *pp1;
    pp1=newnode();
    if(p->next!=NULL)
    pp1->next=p->next;
    p->next=pp1;
    pp1->num=0;
}

node *root=newnode();

int main()
{
    void print_node(node *p);
    int n,m;
    scanf("%d %d",&n,&m);
    if(n>m+1||m>2*n+2)
    {
        printf("-1\n");
        return 0;
    }
    root->num=1;
    node *p1,*p2;
    p2=root;
    for(int i=1;i<m;i++)
    {
        p1=newnode();
        p2->next=p1;
        p2=p1;
        p1->num=1;
    }
    p1=root->next;
    int tot=n;
    if(n==m+1)
        {
            node *pp3=newnode();
            pp3->num=0;
            pp3->next=root->next;
            root=pp3;
        }
        /////////////////*********************��0**************************************
    for(;;)
    {
        if(tot==0)break;
        if(p1->next==NULL)break;
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        in_sert(p1);
        p1=p1->next->next->next;
        tot--;
    }
    if(tot==0)
    {
        print_node(root);
        return 0;
    }
    if(root->num==0)
        p1=root->next;
    else
        p1=root;
    for(;;)
    {
        if(tot==0)
            break;
        if(p1->next==NULL)
        {
            in_sert(p1);
            tot--;
            break;
        }
        if(p1->next->next==NULL)
        {
            in_sert(p1);
            tot--;
            if(tot==0)break;
            in_sert(p1->next->next);
            tot--;
            break;
        }
        in_sert(p1);
        tot--;
        p1=p1->next->next->next->next;
    }
    print_node(root);
    return 0;
}

void print_node(node *p)
{
    for(;;)
    {
        printf("%d",p->num);
        p=p->next;
        if(p==NULL)break;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
string x="";
int main(){
cin>>n>>m;
if (m-(n*2)>2||n-m>1){cout << "-1\n"; return 0; }
  if(m-n*2==2){x+="11";m-=2;}
   else if(m-n==1){x+='1';m--;}
   while(m&&n)
   {
     x+="01";
     m--;n--;
     if(m>n){x+='1';m--;}
   }
   if(n)x+='0';
   if(m)x+='1';
     cout<<x<<endl;
                  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,each=1,mod,y;
string x="";
int main(){
cin>>n>>m;
 if(m>=3){each=m/n;}
   if(each>2){cout<<"-1\n";return 0;}
     while(true)
      {
        for(int i=0;i<each;i++){x+='1';}
          x+='0'; y++;
            if(y==n)break;
             }
            for(int i=0;i<m-(y*each);i++)x+='1';   //y*each number of ones added to string
             cout<<x<<endl;
               return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,each=1,mod,y,one;
string x="";
int main(){
cin>>n>>m;
 if(m>=3){each=m/n;}
  if(m>n){mod=m%n;}//cout<<"m%n = "<<mod<<endl;
  if(mod>2){each=2;}
   if(each>2){cout<<"-1\n";return 0;}
     while(true)
      {
        for(int i=0;i<each;i++){x+='1';one++;if(one==m){break;}}
          x+='0'; y++;
            if(y==n||one==m)break;
             }
            for(int i=0;i<m-(y*each);i++)x+='1';   //y*each number of ones added to string
             cout<<x<<endl;
               return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
string x="";
int main(){
cin>>n>>m;
if (m-(n*2)>2){cout << "-1\n"; return 0; }
  if(m-n*2==2){x+="11";m-=2;}
   else if(m-n==1){x+='1';m--;}
   while(m&&n)
   {
     x+="01";
     m--;n--;
     if(m>n){x+='1';m--;}
   }
   if(n)x+='0';
     cout<<x<<endl;
                  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
string x="";
int main(){
cin>>n>>m;
if (m-(n*2)>2||n-m>1){cout << "-1\n"; return 0; }
  if(m-n*2==2){x+="11";m-=2;}
   else if(m-n==1){x+='1';m--;}
   while(m&&n)
   {
     x+="01";
     m--;n--;
     if(m>n){x+='1';m--;}
   }
   if(n)x+='0';
     cout<<x<<endl;
                  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
string x="";
int main(){
cin>>n>>m;
if (m-(n*2)>2){cout << "-1\n"; return 0; }
  if(m-n*2==2){x+="11";m-=2;}
   else if(m-n==1){x+='1';m--;}
   while(m&&n)
   {
     x+="01";
     m--;n--;
     if(m>n){x+='1';m--;}
   }
     cout<<x<<endl;
                  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
string x="";
int main(){
cin>>n>>m;
if (m-n*2>2||n-m>1){cout << "-1\n"; return 0; }
  if(m-n*2==2){x+="11";m-=2;}
   else if(m-n*2==1){x+='1';m--;}
   while(m&&n)
   {
     x+="01";
     m--;n--;
     if(m>n){x+='1';m--;}
   }
   if(n)x+='0';
     cout<<x<<endl;
                  return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main(){
        string output = "";
        int n,m;
        cin >> n >> m;
        if(m<n-1 || m>2*n+2){
                cout << -1;
                return 0;
        }

        while(n<m && n!=0){
                output+="110";
                n--;
                m-=2;
        }

        while(m>0 && n>0){
                output+="10";
                n--;
                m--;
        }

        if(m == 1) output+="1";
        else if(m == 2) output += "11";
        else if(n>0) output="0"+output;

        cout << output;

        return 0;
}


#include <iostream>
#include <string>

int main(){
    int zeros,ones; std::cin >> zeros >> ones;
    const int total = zeros+ones;
    std::string chain;
    if(zeros>ones) chain+="x";
    //now create this weird set of stuff
    const int n = zeros+1;
    int blocks[n][2];
    //now distribute the first round of ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][0] = 1;
        ones--;
    }
    //repeat with the remaning ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][1] = 1;
        ones--;
    }
    //now add each one to the chain
    for (int i = 0; i < n; ++i) {
        if(blocks[i][0] == 1) chain+="1";
        if(blocks[i][1] == 1) chain+="1";
        chain+="0";
    }
    std::string output = chain.substr(0,total);
    if(output.find("00") != -1 || output.find("11") != -1 || output.length() < total)
        std::cout << -1;
    else
        std::cout << output;
}


#include <iostream>
#include <string>

int main(){
    int zeros,ones; std::cin >> zeros >> ones;
    const int total = zeros+ones;
    std::string chain;
    if(zeros>ones) chain+="x";
    //now create this weird set of stuff
    const int n = zeros+1;
    int blocks[n][2];
    //now distribute the first round of ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][0] = 1;
        ones--;
    }
    //repeat with the remaning ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][1] = 1;
        ones--;
    }
    //now add each one to the chain
    for (int i = 0; i < n; ++i) {
        if(blocks[i][0] == 1) chain+="1";
        if(blocks[i][1] == 1) chain+="1";
        chain+="0";
    }
    std::string output = chain.substr(0,total);

    if(output.find("00") != -1 || output.find("111")  != -1|| output.length() < total)
        std::cout << -1;
    else
        std::cout << output;
}


#include <iostream>
#include <string>

int main(){
    int zeros,ones; std::cin >> zeros >> ones;
    const int total = zeros+ones;
    std::string chain;
    if(zeros>ones) chain+="0";
    //now create this weird set of stuff
    const int n = zeros+1;
    int blocks[n][2];
    //now distribute the first round of ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][0] = 1;
        ones--;
    }
    //repeat with the remaning ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][1] = 1;
        ones--;
    }
    //now add each one to the chain
    for (int i = 0; i < n; ++i) {
        if(blocks[i][0] == 1) chain+="1";
        if(blocks[i][1] == 1) chain+="1";
        if(i<zeros) chain+="0";
    }
    std::string output = chain.substr(0,total);

    //std::cout << output << std::endl;

    if(output.find("00") != -1 || output.find("111")  != -1|| output.length() < total)
        std::cout << -1;
    else
        std::cout << output;
}


#include <iostream>
#include <string>

using namespace std;

int main(){
    string sequence = "";
    int zeros,ones;
    cin >> zeros >> ones;
    if(zeros*2+2<ones){
        cout << -1;
        return 0;
    }
    do{
        if(ones >= 2){
            sequence.append("11");
            ones-=2;
        } else if(ones == 1){
            sequence.append("1");
            ones-=1;
        }
        if(zeros > 0){
            sequence.append("0");
            zeros--;
        }
    }while(zeros > 0 || ones > 0);
    cout<<sequence;
}


#include <iostream>
#include <string>

int main(){
    int zeros,ones; std::cin >> zeros >> ones;
    const int total = zeros+ones;
    std::string chain;
    if(zeros>ones) chain+="x";
    //now create this weird set of stuff
    const int n = zeros+1;
    int blocks[n][2];
    //now distribute the first round of ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][0] = 1;
        ones--;
    }
    //repeat with the remaning ones
    for (int i = 0; i < n && ones > 0; ++i) {
        blocks[i][1] = 1;
        ones--;
    }
    //now add each one to the chain
    for (int i = 0; i < n; ++i) {
        if(blocks[i][0] == 1) chain+="1";
        if(blocks[i][1] == 1) chain+="1";
        chain+="0";
    }
    std::string output = chain.substr(0,total);
    if(output.find("00") != -1 || output.find("11") ||output.length() < total)
        std::cout << -1;
    else
        std::cout << output;
}


#include <iostream>
#include <string>

using namespace std;

int main(){
    string sequence = "";
    int zeros,ones;
    cin >> zeros >> ones;
    do{
        if(ones >= 2){
            sequence.append("11");
            ones-=2;
        } else if(ones == 1){
            sequence.append("1");
            ones-=1;
        }
        if(zeros > 0){
            sequence.append("0");
            zeros--;
        }
    }while(zeros > 1 || ones > 1);
    cout<<sequence;
}


#include<bits/stdc++.h>

#define rep(i, a, b) for(int i=int(a); i<int(b); i++)
#define debug(x) if(1) cout << #x << " = " << x << endl;
#define debug2(x,y) cout << #x << " = " << x << " --- " << #y << " " << y << "\n";
#define INF 0x3f3f3f3f

using namespace std;

int main(){

	int z, u;

	cin>>z>>u;

	if(z>u or (ceil(u/2.0)-1>z)) cout << "-1" << endl;
	else{
		if(u%2==0 or z%2==0){
			while(u>2 and z>0){
				if(u>2) cout << "11", u-=2;
				if(z>0) cout << "0", z--;
			}

			if(u==2 and z==0) cout << "11" << endl;
			else if(u==2 and z==1) cout << "101" << endl;
			else if(u==1 and z==0) cout << "1" << endl;
		}
		else{
			while(u>3 and z>0){
				if(u>2) cout << "11", u-=2;
				if(z>0) cout << "0", z--;
			}

			while(u>0 or z>0){
				if(u>0) cout << "1", u--;
				if(z>0) cout << "0", z--;
			}
			cout << endl;
		}

	}

    return 0;
}

// 1489940526523


#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,m;
    cin>>n>>m;
    if (n<=m+1 && (n+1)*2>=m){
       if (n==m+1){
          cout<<0;
          n--;
       }
       while (m>n && m>1){
          cout<<11;
          m-=2;
          if (n){
            n--;
            cout<<0;
          }
       }
       while (n-- && m--) cout<<10;
       if (m>0) cout<<1;
       cout<<endl;
    } else cout<<-1<<endl;
    return 0;
}
// 1505594763284


#include<bits/stdc++.h>

#define rep(i, a, b) for(int i=int(a); i<int(b); i++)
#define debug(x) if(1) cout << #x << " = " << x << endl;
#define debug2(x,y) cout << #x << " = " << x << " --- " << #y << " " << y << "\n";
#define INF 0x3f3f3f3f

using namespace std;

int main(){

	int z, u;

	cin>>z>>u;

	if(z>u+1 or (ceil(u/2.0)-1>z)) printf("-1\n");
	else{
		if(z>u){
			while(u>0 or z>0){
				if(z>0) printf("0"), z--;
				if(u>0) printf("1"), u--;
			}
		}
		else if(u/2==z or u/2==z+1){
			while(u>0 or z>0){
				if(u>1) printf("11"), u-=2;
				if(z>0) printf("0"), z--;
			}
			while(u>0 or z>0){
				if(u>0) printf("1"), u--;
				if(z>0) printf("0"), z--;
			}
		}
		else if(u/2<=z){
			while(u>z){
				if(z>0) printf("0"), z--;
				if(u>1) printf("11"), u-=2;
			}
			while(u>0 or z>0){
				if(z>0) printf("0"), z--;
				if(u>0) printf("1"), u--;
			}
		}

		cout << endl;
	}

    return 0;
}

// 1489968998116


#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,m;
    cin>>n>>m;
    if (n<=m+1 && (n+1)*2>=m){
       if (n==m+1){
          cout<<0;
          n--;
       }
       while (m>n){
          cout<<11;
          m-=2;
          if (n){
            n--;
            cout<<0;
          }
       }
       while (n--) cout<<10;
       cout<<endl;
    } else cout<<-1<<endl;
    return 0;
}
// 1505594226774


#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
#define file freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define done cin.tie(0);std::ios::sync_with_stdio(false);
#define forit(i, a) for ( __typeof( (a).begin() ) i = (a).begin(); i != (a).end(); i++ )
#define mp make_pair
#define pb push_back
#define CLR(a) memset(a,0,sizeof(a))
#define all(c) c.begin(), c.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define PI acos(0.0) * 2
#define popcon(a) __builtin_popcount(a)
//ll gcd (ll x,ll y){if(y==0)return x;return gcd(y,x%y);}
//ll lcm(ll a,ll b){return a/gcd(a,b) * b;}
//bool cmp(pair<int,int>x,pair<int,int>y)
//{if (x.first==y.first) return x.second<y.second;return x.first>y.first;}
//int dx[]={1, -1, 0, 0, 1, -1, 1, -1};
//int dy[]={0, 0, 1, -1, 1, -1, -1, 1};
//int dx[]={-1,1,0,0};
//int dy[]={0,0,-1,1};
int main()
{
    done
    int n,m;
    cin>>n>>m;
    string s;
    if(n==m)
    {
        while(m--)
            cout<<"10";
        return 0;
    }
    while(m>0&&n>0)
    {
        s+="10";
        m--;
        n--;
    }
    string t="",f="";
    rep(i,s.size())
    {
        if(s[i]=='1'&&m)
        {
            f+=s[i];f+='1';
            m--;
       if(!m)
        {
            t=s.substr(i+1);
            break;
        }
        }
        else if(s[i]=='0')
            f+='0';
    }
    if(m>2||n)
        cout<<-1<<endl;
    else
    {
        cout<<f<<t;
        while(m--)
            cout<<"1";
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
#define file freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define done cin.tie(0);std::ios::sync_with_stdio(false);
#define forit(i, a) for ( __typeof( (a).begin() ) i = (a).begin(); i != (a).end(); i++ )
#define mp make_pair
#define pb push_back
#define CLR(a) memset(a,0,sizeof(a))
#define all(c) c.begin(), c.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define PI acos(0.0) * 2
#define popcon(a) __builtin_popcount(a)
//ll gcd (ll x,ll y){if(y==0)return x;return gcd(y,x%y);}
//ll lcm(ll a,ll b){return a/gcd(a,b) * b;}
//bool cmp(pair<int,int>x,pair<int,int>y)
//{if (x.first==y.first) return x.second<y.second;return x.first>y.first;}
//int dx[]={1, -1, 0, 0, 1, -1, 1, -1};
//int dy[]={0, 0, 1, -1, 1, -1, -1, 1};
//int dx[]={-1,1,0,0};
//int dy[]={0,0,-1,1};
int main()
{
    done
    int n,m;
    cin>>n>>m;
    string s;
    while(m>0&&n>0)
    {
        s+="10";
        m--;
        n--;
    }
    if(n||m>s.size()/2)
    {
        cout<<-1<<endl;
        return 0;
    }
    string t="";
    rep(i,s.size())
    {
        if(s[i]=='1'&&m)
        {
            cout<<s[i]<<"1";
            m--;
       if(!m)
        {
            t=s.substr(i+1);
            break;
        }
        }
        else if(s[i]=='0')
            cout<<"0";
    }
    cout<<t<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
#define file freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define done cin.tie(0);std::ios::sync_with_stdio(false);
#define forit(i, a) for ( __typeof( (a).begin() ) i = (a).begin(); i != (a).end(); i++ )
#define mp make_pair
#define pb push_back
#define CLR(a) memset(a,0,sizeof(a))
#define all(c) c.begin(), c.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define PI acos(0.0) * 2
#define popcon(a) __builtin_popcount(a)
//ll gcd (ll x,ll y){if(y==0)return x;return gcd(y,x%y);}
//ll lcm(ll a,ll b){return a/gcd(a,b) * b;}
//bool cmp(pair<int,int>x,pair<int,int>y)
//{if (x.first==y.first) return x.second<y.second;return x.first>y.first;}
//int dx[]={1, -1, 0, 0, 1, -1, 1, -1};
//int dy[]={0, 0, 1, -1, 1, -1, -1, 1};
//int dx[]={-1,1,0,0};
//int dy[]={0,0,-1,1};
int main()
{
    done
    int n,m;
    cin>>n>>m;
    string s;
    while(m>=2&&n>=1)
    {
        s+="110";
        m-=2;
        n-=1;
    }
    if(n>1||m>2)
    {
        cout<<-1<<endl;
        return 0;
    }
    while(m)
        s+='1',m--;
    if(n)
    s+='0';
    while(1){
    int z=0,k=0;
    rep(i,s.size())
    {
        if(s[i]==s[i+1]&&s[i]=='0')
        {
            z=i;break;
        }
    }
    if(z)
    {
        rep(i,s.size())
        {
            if(s[i]==s[i+1]&&s[i]=='1')
            {
                s.insert(i,1,'0');
                s.erase(z+1,1);
                break;
            }
        }
    }
    else if(s[s.size()-1]=='0')
    {
    rep(i,s.size())
        {
            if(s[i]==s[i+1]&&s[i]=='1')
            {
                s.insert(i+1,1,'0');
               s.erase(s.size()-1,1);
                break;
            }
        }
    }
    else if(s[0]=='0')
    {
        rep(i,s.size())
        {
            if(s[i]==s[i+1]&&s[i]=='1')
            {
                s.insert(i+1,1,'0');
               s.erase(0,1);
                break;
            }
        }
    }
    else
        break;
    }
    cout<<s<<endl;
    return 0;
}


for _ in range(int(input())):
    n, m, k = map(int, input().split())
    ans, t, p = m, abs(n - m), k
    k -= ans
    if t > k:
        ans = -1
    elif not t&1:
        ans += k
        if (k)&1: ans -= 2
    else:
        ans += k-1
    print(ans)


k =int (input())
for i in range(k):
    n, m, k = map(int, input().split())
    n = abs(n)
    m = abs(m)
    if n > k or m > k:
        print('-1')
    else:
        a = (n-k) % 2+(m-k) % 2
        print(k-a)


# import sys
# sys.stdin = open("F:\\Scripts\\input","r")
# sys.stdout = open("F:\\Scripts\\output","w")

MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
t, = I()
while t:
	t -= 1
	n , m , k = I()
	mi = min(n,m)
	ma = max(n,m)
	if k < ma:
		print(-1)
	else:
		d = mi
		rem = k - d
		moves = ma - d
		# print(moves,rem)
		rem -= moves
		if rem == 1:
			print(d - 1)
		else:
			print(d + rem)


# import sys
# sys.stdin = open("F:\\Scripts\\input","r")
# sys.stdout = open("F:\\Scripts\\output","w")

MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
t, = I()
while t:
	t -= 1
	n , m , k = I()
	mi = min(n,m)
	ma = max(n,m)
	if k < ma:
		print(-1)
	else:
		d = mi
		rem = k - d
		tob = ma - d
		if rem%2 == 0 and tob%2 == 0:
			print(k)
		elif tob%2:
			print(k - 1)
		else:
			print(k - 2)


# import sys
# sys.stdin = open("F:\\Scripts\\input","r")
# sys.stdout = open("F:\\Scripts\\output","w")

MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
t, = I()
while t:
	t -= 1
	n , m , k = I()
	mi = min(n,m)
	ma = max(n,m)
	if k < ma:
		print(-1)
	else:
		d = mi
		rem = k - d
		tob = ma - d
		if rem%2 == 0 and tob%2 == 0:
			print(k)
		elif rem%2:
			print(k - 2)
		else:
			print(k - 1)


q = []
n = int(input())
for i in range(n):
    a, b, c = map(int, input().split())
    if abs(a) > c or abs(b) > c:
        q.append(-1)
    elif (abs(a - b)) % 2 == 0:
        q.append(c - 2)
    else:
        q.append(c - 1)
for i in range(n):
    print(q[i])


q = []
n = int(input())
for i in range(n):
    a, b, c = map(int, input().split())
    g = c % 2
    if abs(a) > c or abs(b) > c:
        q.append(-1)
    elif g == a % 2 and g == b % 2:
        q.append(c)
    elif g != a % 2 and g != b % 2:
        q.append(c - 2)
    else:
        q.append(c - 1)
for i in range(n):
    print(q[i])


q = []
n = int(input())
for i in range(n):
    a, b, c = map(int, input().split())
    if abs(a) > c or abs(b) > c:
        q.append(-1)
    elif (a - b) % 2 == 0:
        q.append(c - 2)
    else:
        q.append(c - 1)
for i in range(n):
    print(q[i])


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())

    if (n < m):
        n, m = m, n

    if (n > k):
        print(-1)
        continue;

    if (n % 2 == 0 and m % 2 == 0 or n % 2 != 0 and m % 2 != 0):
        if (n % 2 == 0):
            if (k % 2 == 0):
                print(k)
            else:
                print(k - 2)
        else:
            if (k % 2 != 0):
                print(k)
            else:
                print(k - 2)
    else:
        print(k - 1)


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())
    if (n < m):
        n, m = m, n
    if (n % 2 == 0 and m % 2 != 0 or n % 2 != 0 and m % 2 == 0):
        n -= 1
        k -= 1
    elif (n % 2 == 0 and k % 2 != 0 or n % 2 != 0 and k % 2 == 0):
        k -= 2
        n -= 1
        m -= 1
    if (n > k):
        print(-1)
    else:
        print(k)


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())
    if (n % 2 == 0 and m % 2 != 0):
        m -= 1
        k -= 1
    elif (n % 2 == 0 and m % 2 != 0):
        n -= 1
        k -= 1
    elif (n % 2 == 0 and k % 2 != 0 or n % 2 != 0 and k % 2 == 0):
        k -= 2
        n -= 1
        m -= 1
    if (n > k or m > k):
        print(-1)
    else:
        print(k)


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())
    if (n < m):
        n, m = m, n
    if (n % 2 == 0 and m % 2 != 0 or n % 2 != 0 and m % 2 == 0):
        m -= 1
        k -= 1
    elif (n % 2 == 0 and k % 2 != 0 or n % 2 != 0 and k % 2 == 0):
        k -= 2
        n -= 1
        m -= 1
    if (n > k):
        print(-1)
    else:
        print(k)


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if k < max(n, m):
        print(-1)
        continue
    else:
        if (n+m)%2 == 0:
            if abs(max(n, m)-k) % 2 == 1:
                print(k-2)
            else:
                print(k)
        else:
            print(k-1)


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        n, m = m, n
    if n % 2 != m % 2:
        k -= 1
        n -= 1
    elif n % 2 != k % 2:
        k -= 2
        n -= 1
        m -= 1
    print(-1 if k < n else k)


n = int(input())
for i in range(n):
    n, m, k = [int(j) for j in input().split()]
    if n < m:
        n, m = m, n
    if n & 1 != m & 1:
        k -= 1
        n -= 1
    elif n & 1 != k & 1:
        k -= 2
        n -= 1
        m -= 1
    if k < n:
        print(-1)
    else:
        print(k)


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())
    if (n < m): n, m = m, n
    if (n % 2 != m % 2):
        k -= 1
        n -= 1
    elif (n % 2 != k % 2):
        k -= 2
        n -= 1
        m -= 1
    print(-1 if k < n else k)


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        n, m = m, n
    if n % 2 != m % 2:
        k -= 1
        n -= 1
    elif n % 2 != k % 2:
        k -= 2
        n -= 1
        m -= 1
    print(-1 if k < n else k)


q = int(input())
if 1 <= q <= 10 ^ 4:
    for i in range(q):
        n, m, k = map(int, input().split())
        if n < m:
            n, m = m, n
        if n % 2 != m % 2:
            k -= 1
            n -= 1
        elif n % 2 != k % 2:
            k -= 2
            n -= 1
            m -= 1
        print(-1 if k < n else k)


Q = int(input())
src = [tuple(map(int,input().split())) for i in range(Q)]
ans = []
for x,y,k in src:
    d = max(x,y)
    if (x+y)%2:
        ans.append(-1 if d > k else k-1)
    else:
        if d > k:
            ans.append(-1)
        else:
            ans.append(k-2 if (d+k)%2 else k)

print(*ans,sep='\n')


Q = int(input())
src = [tuple(map(int,input().split())) for i in range(Q)]
ans = []
for x,y,k in src:
    d = max(x,y)
    if (x+y)%2:
        ans.append(-1 if d >= k else k-1)
    else:
        if d > k:
            ans.append(-1)
        else:
            ans.append(k-2 if (d+k)%2 else k)

print(*ans,sep='\n')


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        temp = n
        n = m
        m = temp
    if n % 2 != m % 2:
        k += 1
        n += 1
    if n % 2 != k % 2:
        n -= 1
        m -= 1
        k -= 2
    if k < n:
        print(-1)
    else:
        print(k)


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        temp = n
        n = m
        m = temp
    if k < n:
        print(-1)
        q -= 1
        continue
    if n % 2 != m % 2:
        k += 1
    elif n % 2 != k % 2:
        k -= 2
    print(k)
    q -= 1


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        temp = n
        n = m
        m = temp
    if k < n:
        print(-1)
        q -= 1
        continue
    if n % 2 != m % 2:
        k -= 1
    elif n % 2 != k % 2:
        k -= 2
    print(k)
    q -= 1


for i in range(int(input())):
	x, y, k = map(int, input().split())
	if k < max(x, y):
		print(-1)
	else:
		if abs(x - y) & 1:
			if (k & 1):
				print(k - 1)
			else:
				print(k - 1)
		else:
			if k & 1:
				print(k - 2)
			else:
				print(k)


for i in range(int(input())):
	x, y, k = map(int, input().split())
	if k < max(x, y):
		print(-1)
	else:
		if abs(x - y) & 1:
			print(k - 1)
		else:
			if max(x, y) & 1:
				if k & 1:
					print(k)
				else:
					print(k - 2)
			else:
				if k & 1:
					print(k - 2)
				else:
					print(k)


q = int(input())
for i in range(q):
	x, y, k = map(int, input().split()
	n = min(x, y)
	if n < k:
		print(-1)
	else:
		if k % 2 == 0:
			if n % 2 == 0:
				print(k)
			else:
				print(k + 1)
		else:
			if n % 2 == 1:
				print(k)
			else:
				print(k + 1)


q = int(input())
for i in range(q):
    x, y, k = map(int, input().split())
    ans = 0
    if max(x, y) > k:
        ans = -1
    else:
        if x % 2 == 0 and y % 2 == 0:
            if k % 2 == 0:
                ans = k
            else:
                ans = k - 2
        elif x % 2 == 1 and y % 2 == 1:
            if k % 2 == 0:
                ans = k - 2
            else:
                ans = k
        else:
            ans = k - 1
    print(ans)


q = int(input())
for i in range(q):
	x, y, k = map(int, input().split())
	ans = 0
	if max(x, y) > k:
		ans = -1
	else:
		if x % 2 == 0 and y % 2 == 0:
			if k % 2 == 0:
				ans = k
			else:
				ans = k - 2
		elif x % 2 == 1 and y % 2 == 1:
			if k % 2 == 0:
				ans = k - 1
			else:
				ans = k
				if x == y:
					ans -= 1
		else:
			ans = k - 1
	print(ans)


q = int(input())
for i in range(q):
	x, y, k = map(int, input().split())
	ans = 0
	if max(x, y) > k:
		ans = -1
	else:
		if x % 2 == 0 and y % 2 == 0:
			if k % 2 == 0:
				ans = k
			else:
				ans = k - 2
		elif x % 2 == 1 and y % 2 == 1:
			if k % 2 == 0:
				ans = k - 1
				if x == y:
					ans -= 1
			else:
				ans = k
		else:
			ans = k - 1
	print(ans)


n=int(input())
for j in range(n) :
    a,b,c=map(int,input().split())
    ost=min(a,b)
    ost1=max(a,b)-ost
    if ost+ost1>c :
        print(-1)
        continue
    if abs(a-b)%2!=0 :
        print(c-1)
    else :
        if c%2==0 :
            print(c)
        else :
            print(c-2)


n=int(input())
for j in range(n) :
    a,b,c=map(int,input().split())
    ost=min(a,b)
    ost1=max(a,b)-ost
    if ost+ost1>c :
        print(-1)
        continue
    if abs(a-b)%2!=0 :
        print(c-1)
    else :
        if (ost1+ost)%2==c%2 :
            print(c)
        else :
            print(c-2)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
      if k%2 == 1:
        k -= 1
      ans += k
    print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
        #print(ans)
        ans += k - (y-x)
      else:
        #print(k, ans)
        if k%2 == 0:
          ans += k
        else:
          ans += k-2
  print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
        #print(ans)
        ans += k
      else:
        print(k, ans)
        if k%2 == 0:
          ans += k
        else:
          ans += k-2
  print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += y
		k -= y
		ans += k
		if (x == y and k%2 == 1):
			ans -= 2
		elif (x+y)%2 == 1:
			ans -= 1
	print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += x
		k -= x
		if x == y:
			if k%2 == 1:
				ans -= 1
				k -= 1
		else:
			if (y-x) % 2 == 1:
				y -= 1
				k -= 1
		ans += k - (y-x)
		k -= y-x

	print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += y
		k -= y
		ans += k - (y-x)
		k -= y-x
		ans += k
		if (x == y and k%2 == 1):
			ans -= 2
		elif (x+y)%2 != k%2:
			ans -= 2
	print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
        #print(ans)
        ans += k - (y-x)
      else:
        #print(k, ans)
        ans += k - (y-x)
  print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += y
		k -= y
		ans += k
		if (x == y and k%2 == 1):
			ans -= 2
		elif (x+y)%2 != k%2:
			ans -= 1
		elif (x+y)%2 == 1:
			ans -= 1
	print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += y
		k -= y
		ans += k
		if (x == y and k%2 == 1):
			ans -= 2
		elif (x+y)%2 != k%2:
			ans -= 2
	print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += y
		k -= y
		ans += k
		if (x == y and k%2 == 1):
			ans -= 2
		elif (x+y)%2 != k%2:
			ans -= 2
		elif (x+y)%2 == 1:
			ans -= 1
	print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
      if k%2 == 1:
        k -= 1
      ans += k
    print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
        #print(ans)
        ans += k
      else:
        #print(k, ans)
        if k%2 == 0:
          ans += k
        else:
          ans += k-2
  print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += x
		k -= x
		ans += k - (y-x)
		if x == y:
			if k % 2 == 1:
				ans -= 2
	print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
      elif k%2 == 1:
        k -= 1
      #print(ans)
      ans += k
  print(ans)


n = int(input())

for i in range(n):
  x, y, k = map(lambda x: abs(int(x)), input().split(" "))
  x, y = min(x,y), max(x,y)
  minstep = y

  ans = 0
  if k < minstep:
    ans = -1
  else:
    ans += x
    k -= x
    if x == y:
      if k%2 == 1:
        ans -= 1
        k -= 1
      ans += k
    else:
      if (y-x)%2 == 1:
        y -= 1
        k -= 1
      #print(ans)
      ans += k - (y-x)
  print(ans)


n = int(input())

for i in range(n):
	x, y, k = map(lambda x: abs(int(x)), input().split(" "))
	x, y = min(x, y), max(x, y)
	minstep = y

	ans = 0
	if k < minstep:
		ans = -1
	else:
		ans += x
		k -= x
		if x == y:
			if k%2 == 1:
				ans -= 1
				k -= 1
			ans += k
		else:
			if (y-x) % 2 == 1:
				y -= 1
				k -= 1
			if (y-x)%2 == 1:
				k -= 1
			ans += k

	print(ans)


for _ in range(int(input())):
    n, m, k = map(int, input().split())
    if n > k or m > k:
        print(-1)
    elif m == n:
        if (k-m)%2 == 0:
            print(k)
        else:
            print(k-2)
    else:
        mx = max(m, n)
        mn = min(m, n)
        print(mn+k-mx)


for _ in range(int(input())):
    n, m, k = map(int, input().split())
    if max(n,m) > k:
        print(-1)
    elif m == n: # on the diagonal
        if (k-m)%2 == 0:
            print(k)
        else:
            print(k-2)
    else:
        mx = max(m, n)
        mn = min(m, n)
        if (mx-mn)%2 == 0:
            if (k-mx)%2 == 0:
                print(k)
            else:
                print(k-2)
        else:
            print(k-1)


for _ in range(int(input())):
    n, m, k = map(int, input().split())
    if max(n,m) > k:
        print(-1)
    elif m == n: # on the diagonal
        if (k-m)%2 == 0:
            print(k)
        else:
            print(k-2)
    else:
        mx = max(m, n)
        mn = min(m, n)
        print(mn+k-mx)


q = int(input())
for _ in range(q):
    n, m, k = map(int, input().split())
    if n<m:
        n, m = m, n
    if n%2!=m%2:
        n -= 1
        k -= 1
    elif n%2!=k%2:
        n -= 1
        m -= 1
        k -= 2
    if k<n:
        k = -1
    print(k)


q = int(input())

for i in range(q):
    (x, y, k) = map(int, input().split())

    if max(x, y) > k:
        print(-1)
    elif x == y and k == x + 1:
        print(k - 2)
        continue
    elif x % 2 == 1 and y % 2 == 1 and k % 2 == 0:
        print(k - 2)
        continue
    elif x % 2 == 0 and y % 2 == 0 and k % 2 == 1:
        print(k - 2)
        continue
    elif (x + y) % 2 == 0:
        print(k)
    else:
        print(k - 1)


q = int(input())

for i in range(q):
    (x, y, k) = map(int, input().split())

    if max(x, y) > k:
        print(-1)
    elif k == max(x, y) + 1:
        print(k - 2)
    elif (x + y) % 2 == 0:
        print(k)
    else:
        print(k - 1)


q = int(input())

for i in range(q):
    (x, y, k) = map(int, input().split())

    if max(x, y) > k:
        print(-1)
    elif x == y and k == x + 1:
        print(k - 2)
    elif (x + y) % 2 == 0:
        print(k)
    else:
        print(k - 1)


q = int(input())

for i in range(q):
    (x, y, k) = map(int, input().split())

    if max(x, y) > k:
        print(-1)
    elif x == y and k == x + 1:
        print(k - 2)
        continue
    elif x % 2 == 1 and y % 2 == 1 and k % 2 == 0:
        print(k - 2)
        continue
    elif (x + y) % 2 == 0:
        print(k)
    else:
        print(k - 1)


q = int(input())

for i in range(q):
    (x, y, k) = map(int, input().split())

    if max(x, y) > k:
        print(-1)
    elif x == y and k == x + 1:
        print(k - 2)
        continue
    elif x % 2 == 1 and y == 1 and k % 2 == 0:
        print(k - 2)
        continue
    elif (x + y) % 2 == 0:
        print(k)
    else:
        print(k - 1)


#yeh dil maange more
for i in range(int(input())):
    n,m,k =  map(int,input().split())
    if n<m:n,m=m,n
    if n%2!=m%2:
        k-=1
        n-=1
    elif n%2!=k%2:
        k-=2
        n-=1
        m-=1
    print(-1 if k<n else k)


# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 11:00:46 2018

@author: a.teffal
"""
#%%

#%%
def max_diagonals(x1, y1, k):
    if k < x1 or k < y1:
        #print(-1)
        return -1

    x0 = 0
    y0 = 0
    n_diag = 0

    while abs(x0 - x1) > 1 or abs(y0 - y1) > 1:

        if x0 == x1:
            x0 = x0 - 1
            y0 = y0 +1
            n_diag += 1
            continue

        if y0 == y1:
            y0 = y0 - 1
            x0 = x0 +1
            n_diag += 1
            continue

        if (x0 != x1) and (y0 != y1):
            x0 = x0 + 1
            y0 = y0 + 1
            n_diag += 1

    reste = k - n_diag

    # cas 1 : left
    if x0 == (x1-1) and (y0 == y1):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

    # cas 2 : left bottom
    if x0 == (x1-1) and (y0 == (y1 - 1)):
        if (reste % 2) == 0:
            #print(n_diag + reste - 2)
            return (n_diag + reste - 2)
        else:
            #print(n_diag + reste)
            return (n_diag + reste)

    # cas 3 : bottom
    if x0 == x1 and (y0 == (y1 - 1)):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

#%%

q = int(input())
x1 = [0]*q
y1 = [0]*q
k = [0]*q

for i in range(q):
    line = input().split(sep = ' ')
    x1[i] = int(line[0])
    y1[i] = int(line[1])
    k[i] = int(line[2])

for i in range(q):
    print(max_diagonals(x1[i], y1[i], k[i]))

#%%


# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 11:00:46 2018

@author: a.teffal
"""
#%%

#%%
def max_diagonals(x1, y1, k):
    if k < x1 or k < y1:
        #print(-1)
        return -1

    x0 = 0
    y0 = 0
    n_diag = 0

    if x1 > y1:
        if ((x1 - y1) % 2) == 0:
            x0 = x1 - 1
            y0 = y1 - 1
            n_diag = x1 - 1
        else:
            x0 = x1
            y0 = y1 - 1
            n_diag = x1

    if x1 < y1:
        if ((y1 - x1) % 2) == 0:
            y0 = y1 - 1
            x0 = x1 - 1
            n_diag = y1 - 1
        else:
            y0 = y1
            x0 = x1 - 1
            n_diag = y1

    if x1 == y1:
        x0 = x1 - 1
        y0 = y1 - 1
        n_diag = x1 - 1

    reste = k - n_diag

    # cas 1 : left
    if x0 == (x1-1) and (y0 == y1):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

    # cas 2 : left bottom
    if x0 == (x1-1) and (y0 == (y1 - 1)):
        if (reste % 2) == 0:
            #print(n_diag + reste - 2)
            return (n_diag + reste - 2)
        else:
            #print(n_diag + reste)
            return (n_diag + reste)

    # cas 3 : bottom
    if x0 == x1 and (y0 == (y1 - 1)):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

    return -1

#%%

q = int(input())
x1 = [0]*q
y1 = [0]*q
k = [0]*q

for i in range(q):
    line = input().split(sep = ' ')
    x1[i] = int(line[0])
    y1[i] = int(line[1])
    k[i] = int(line[2])

for i in range(q):
    print(max_diagonals(x1[i], y1[i], k[i]))

#%%


# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 11:00:46 2018

@author: a.teffal
"""
#%%
import numpy as np
#%%
def max_diagonals(x1, y1, k):
    if k < x1 or k < y1:
        print(-1)
        return 0

    x0 = 0
    y0 = 0
    n_diag = 0

    while abs(x0 - x1) > 1 or abs(y0 - y1) > 1:

        if x0 == x1:
            x0 = x0 - 1
            y0 = y0 +1
            n_diag += 1
            continue

        if y0 == y1:
            y0 = y0 - 1
            x0 = x0 +1
            n_diag += 1
            continue

        if (x0 != x1) and (y0 != y1):
            x0 = x0 + 1
            y0 = y0 + 1
            n_diag += 1

    reste = k - n_diag

    # cas 1 : left
    if x0 == (x1-1) and (y0 == y1):
        print(n_diag + reste - 1)
        return

    # cas 2 : left bottom
    if x0 == (x1-1) and (y0 == (y1 - 1)):
        if (reste % 2) == 0:
            print(n_diag + reste - 2)
            return 0
        else:
            print(n_diag + reste)
            return 0

    # cas 3 : bottom
    if x0 == x1 and (y0 == (y1 - 1)):
        print(n_diag + reste - 1)
        return 0

#%%

q = int(input())
x1 = np.zeros(q, int)
y1 = np.zeros(q, int)
k = np.zeros(q, int)

for i in range(q):
    line = input().split(sep = ' ')
    x1[i] = int(line[0])
    y1[i] = int(line[1])
    k[i] = int(line[2])

for i in range(q):
    max_diagonals(x1[i], y1[i], k[i])

#%%


# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 11:00:46 2018

@author: a.teffal
"""
#%%
import numpy as np
#%%
def max_diagonals(x1, y1, k):
    if k < x1 or k < y1:
        #print(-1)
        return -1

    x0 = 0
    y0 = 0
    n_diag = 0

    while abs(x0 - x1) > 1 or abs(y0 - y1) > 1:

        if x0 == x1:
            x0 = x0 - 1
            y0 = y0 +1
            n_diag += 1
            continue

        if y0 == y1:
            y0 = y0 - 1
            x0 = x0 +1
            n_diag += 1
            continue

        if (x0 != x1) and (y0 != y1):
            x0 = x0 + 1
            y0 = y0 + 1
            n_diag += 1

    reste = k - n_diag

    # cas 1 : left
    if x0 == (x1-1) and (y0 == y1):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

    # cas 2 : left bottom
    if x0 == (x1-1) and (y0 == (y1 - 1)):
        if (reste % 2) == 0:
            #print(n_diag + reste - 2)
            return (n_diag + reste - 2)
        else:
            #print(n_diag + reste)
            return (n_diag + reste)

    # cas 3 : bottom
    if x0 == x1 and (y0 == (y1 - 1)):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

#%%

q = int(input())
x1 = np.zeros(q, int)
y1 = np.zeros(q, int)
k = np.zeros(q, int)

for i in range(q):
    line = input().split(sep = ' ')
    x1[i] = int(line[0])
    y1[i] = int(line[1])
    k[i] = int(line[2])

for i in range(q):
    print(max_diagonals(x1[i], y1[i], k[i]))

#%%


# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 11:00:46 2018

@author: a.teffal
"""
#%%
import numpy as np
#%%
def max_diagonals(x1, y1, k):
    if k < x1 or k < y1:
        print(-1)
        return

    x0 = 0
    y0 = 0
    n_diag = 0

    while abs(x0 - x1) > 1 or abs(y0 - y1) > 1:

        if x0 == x1:
            x0 = x0 - 1
            y0 = y0 +1
            n_diag += 1
            continue

        if y0 == y1:
            y0 = y0 - 1
            x0 = x0 +1
            n_diag += 1
            continue

        if (x0 != x1) and (y0 != y1):
            x0 = x0 + 1
            y0 = y0 + 1
            n_diag += 1

    reste = k - n_diag

    # cas 1 : left
    if x0 == (x1-1) and (y0 == y1):
        print(n_diag + reste - 1)
        return

    # cas 2 : left bottom
    if x0 == (x1-1) and (y0 == (y1 - 1)):
        if (reste % 2) == 0:
            print(n_diag + reste - 2)
            return
        else:
            print(n_diag + reste)
            return

    # cas 3 : bottom
    if x0 == x1 and (y0 == (y1 - 1)):
        print(n_diag + reste - 1)
        return

#%%

q = int(input())
x1 = np.zeros(q, int)
y1 = np.zeros(q, int)
k = np.zeros(q, int)

for i in range(q):
    line = input().split(sep = ' ')
    x1[i] = int(line[0])
    y1[i] = int(line[1])
    k[i] = int(line[2])

for i in range(q):
    max_diagonals(x1[i], y1[i], k[i])

#%%


# -*- coding: utf-8 -*-
"""
Created on Fri Sep 14 11:00:46 2018

@author: a.teffal
"""
#%%
import numpy as np
#%%
def max_diagonals(x1, y1, k):
    if k < x1 or k < y1:
        #print(-1)
        return -1

    x0 = 0
    y0 = 0
    n_diag = 0

    while abs(x0 - x1) > 1 or abs(y0 - y1) > 1:

        if x0 == x1:
            x0 = x0 - 1
            y0 = y0 +1
            n_diag += 1
            continue

        if y0 == y1:
            y0 = y0 - 1
            x0 = x0 +1
            n_diag += 1
            continue

        if (x0 != x1) and (y0 != y1):
            x0 = x0 + 1
            y0 = y0 + 1
            n_diag += 1

    reste = k - n_diag

    # cas 1 : left
    if x0 == (x1-1) and (y0 == y1):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

    # cas 2 : left bottom
    if x0 == (x1-1) and (y0 == (y1 - 1)):
        if (reste % 2) == 0:
            #print(n_diag + reste - 2)
            return (n_diag + reste - 2)
        else:
            #print(n_diag + reste)
            return (n_diag + reste)

    # cas 3 : bottom
    if x0 == x1 and (y0 == (y1 - 1)):
        #print(n_diag + reste - 1)
        return (n_diag + reste - 1)

#%%

q = int(input())
x1 = np.zeros(q, int)
y1 = np.zeros(q, int)
k = np.zeros(q, int)

for i in range(q):
    line = input().split(sep = ' ')
    x1[i] = int(line[0])
    y1[i] = int(line[1])
    k[i] = int(line[2])

for i in range(q):
    #print(max_diagonals(x1[i], y1[i], k[i]))
    print(-1)

#%%


# cook your dish here
for i in range(int(input())):
    n,m,k = map(int,input().split())
    if(n<m):
        n,m=m,n
    if(n%2 != m%2):
        n=n-1
        k=k-1
    elif(n%2 != k%2):
        n=n-1
        m=m-1
        k=k-2
    if(k<n):
        print(-1)
    else:
        print(k)


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        n, m = m, n
    if n % 2 != m % 2:
        k -= 1
        n -= 1
    elif n % 2 != k % 2:
        k -= 2
        n -= 1
        m -= 1
    print(-1 if k < n else k)


q = int(input())

for _ in range(q):
    x, y, k = [int(x) for x in input().split()]
    dm = min(x,y)
    nm = max(x,y) - dm
    if nm + dm > k:
        print(-1)
        continue
    if nm + dm == k:
        print(dm)
        continue
    d = k - nm - dm
    if d%2 == 0:
        print(dm+d)
    else:
        if nm > 0:
            print(dm+d)
        else:
            print(dm-2 + d)


q = int(input())

for _ in range(q):
    x, y, k = [int(x) for x in input().split()]
    dm = min(x,y)
    nm = max(x,y) - dm
    if nm%2 == 0:
        dm += nm
        nm = 0
    else:
        dm += (nm-1)
        nm = 1
    if nm + dm > k:
        print(-1)
        continue
    if nm + dm == k:
        print(dm)
        continue
    d = k - nm - dm
    if d%2 == 0:
        print(dm+d)
    else:
        if nm > 0:
            print(dm+d)
        else:
            print(dm-2 + d)


for _ in range(int(input())):
    x,y,k=[*map(int,input().split())]
    ans=min(x,y)
    if max(x,y)>k:
        print(-1)
    else:
        if (x+y)%2!=0:
            print(k-1)
        else:
            if x%2!=k%2:
                print(k-2)
            else:
                print(k)


for _ in range(int(input())):
    x,y,k=[*map(int,input().split())]
    ans=min(x,y)
    if max(x,y)>k:
        print(-1)
    else:
        print(ans)


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if n < m:
        n, m = m, n
    if n % 2 != m % 2:
        k -= 1
        n -= 1
    elif n % 2 != k % 2:
        k -= 2
        n -= 1
        m -= 1
    if k < n:
        print(-1)
    else:
        print(k)


q = int(input())
for i in range(q):
	s = input().split(" ")
	n,m,k = int(s[0]),int(s[1]),int(s[2])
	x,y = min(n,m),max(n,m)
	if(k<y):
		print("-1")
	else:
		res = x
		k -= x
		y -= x
		if y == 0:
			if(k)%2 == 1:
				k -= 1
				res -= 1
			res += k
		else:
			if (k-y)%2 == 0:
				res += k-y
			else:
				res += 1
				k -= 2
				y -= 1
				res += k-y

		print(res)


q = int(input())

for i in range(q):
	s = input().split(" ")
	n,m,k = abs(int(s[0])),abs(int(s[1])),int(s[2])
	x,y = min(n,m),max(n,m)
	if(k<y):
		print("-1")
	else:
		res = x
		k -= x
		y -= x
		if y == 0:
			if(k)%2 == 1:
				k -= 1
				res -= 1
			res += k
		else:
			if (k-y)%2 == 0:
				res += k-y
			else:
				res += 1
				k -= 2
				y -= 1
				res += k-y

		print(res)


q = int(input())

for i in range(q):
	s = input().split(" ")
	n,m,k = abs(int(s[0])),abs(int(s[1])),int(s[2])
	x,y = min(n,m),max(n,m)
	if(k<y):
		print("-1")
	else:
		res = x
		k -= x
		y -= x
		if y == 0:
			if(k)%2 == 1:
				k -= 1
				res -= 1
			res += k
		else:

			if (k-y)%2 == 0:
				res += k-y%2
			else:
				res += 1
				k -= 2
				y -= 1
				res += k-y%2

		print(res)


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/22/18

"""

Q = int(input())

for qi in range(Q):
    N, M, K = map(int, input().split())

    if N < M:
        N, M = M, N

    if N % 2 != M % 2:
        K -= 1
        N -= 1
    elif N % 2 != K % 2:
        K -= 2
        N -= 1
        M -= 1

    print(-1 if K < N else K)


n = int(input())
for q in range(n):
    x, y, k = map(int, input().split())
    if max(x, y) > k:
        print(-1)
    else:
        if max(x, y) - k == 0 or k - max(x, y) > 1:
            print(k - (x + y) % 2)
        else:
            print(max(x, y) - 1 + (x + y) % 2)


n = int(input())
for q in range(n):
    x, y, k = map(int, input().split())
    if max(x, y) > k:
        print(-1)
    else:
        if 0 == (x + y) % 2:
            if k % 2 == max(x, y) % 2:
                print(k)
            else:
                print(k - 2)
        else:
            print(k - 1)


n = int(input())
for q in range(n):
    x, y, k = map(int, input().split())
    if max(x, y) > k:
        print(-1)
    else:
        if 0 == (x + y) % 2:
            if k % 2 == (x + y) % 2:
                print(k)
            else:
                print(k - 2)
        else:
            print(k - 1)


n = int(input())
for q in range(n):
    x, y, k = map(int, input().split())
    if max(x, y) > k:
        print(-1)
    else:
        if max(x, y) - k == 0 or k - max(x, y) > 1:
            print(k - (x + y) % 2)
        else:
            print(max(x, y) - 1)


for i in range(int(input())):
    num=0
    x,y,k = (map(int,input().split()))
    if k<max(x,y):print(-1);continue
    if x==y:
        if (y^k)%2==0:
            print(k)
        else:
            print(k-2)

    elif abs(x-y)%2!=0:
        print(k-1)
    else:
        if (max(x,y)^k) % 2 == 0:
            print(k)
        else:
            print(k-2)


for i in range(int(input())):
    num=0
    x,y,k = (map(int,input().split()))
    if k<max(x,y):print(-1);continue
    if x==y:
        if (y^k)%2==0:
            print(k)
        else:
            print(k-2)
    elif abs(x-y)%2!=0:
        print(k-1)
    else:
        print(k)


# Author : raj1307 - Raj Singh
# Date   : 22.04.2020

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li(): return list(mi())

def dmain():
    sys.setrecursionlimit(100000000)
    threading.stack_size(40960000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
from math import ceil,floor,log,sqrt,factorial
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *,threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(n-r))

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

def main():

    for _ in range(ii()):

        x,y,k=mi()

        mn=max(x,y)

        if k<mn:
            print(-1)
            continue

        m=k-min(x,y)-1
        print(mn-1+m)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()


q = int(input())

for i in range(q):
    n, m, k = map(int, input().split())
    if (n < m): n, m = m, n
    if (n % 2 != m % 2):
        k -= 1
        n -= 1
    elif (n % 2 != k % 2):
        k -= 2
        n -= 1
        m -= 1
    print(-1 if k < n else k)


for _ in range(int(input())):
    n, m, k = map(int, input().split())
    n, m = max(n, m), min(n, m)
    if (n & 1) != (m & 1):
        n, k = n - 1, k - 1
    elif (n & 1) != (k & 1):
        n, k = n - 1, k - 2
    print(k if k >= n else -1)


for _ in range(int(input())):
    x, y, k = map(lambda x: abs(int(x)), input().split())
    if max(x, y) > k: print(-1)
    else:
        if x == y:
            if (k - x) & 1:
                k -= 2
                print(max(-1, k))
            else:
                print(k)
        else: print(k - 1)


for _ in range(int(input())):
    x, y, k = map(lambda x: abs(int(x)), input().split())
    if max(x, y) > k: print(-1)
    else:
        if x == y: print(k)
        else: print(k - 1)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

q = int(input())
for t in range(q):
    n, m, k = map(int, input().split())
    if n > k or m > k:
        print('-1')
    else:
        print(k - (k - n)%2 - (k - m)%2)


q = int(input())
for i in range(q):
    n, m, k = map(int, input().split())
    if max(n, m) > k:
        print(-1)
    elif (n + m) % 2 == 0:
        if n % 2 != k % 2:
            print(k - 2)
        else:
            print(k)
    else:
        print(k - 1)


n=int(input())
for i in range (n):
    x,y,k=map(int,input().split())
    x=abs(x)
    y=abs(y)
    if x+y-min(x,y)>k:
        ans=-1
    else:
        if x+y-min(x,y)==k:
            if (x+y)%2==0:
                ans=k
            else:
                ans=k-1
        else:
            if (x+y)%2==0:
                if (k-(x+y-min(x,y)))%2==0:
                    ans=k
                else:
                    ans=k-2
            else:
                ans=k-1
    print(ans)


n=int(input())
for i in range (n):
    x,y,k=map(int,input().split())
    if x+y-min(x,y)>k:
        ans=-1
    else:
        if x+y-min(x,y)==k:
            if (x+y)%2==0:
                ans=k
            else:
                ans=k-1
        else:
            if (x+y)%2==0:
                if k-(x+y-min(x,y))%2==0:
                    ans=k
                else:
                    ans=k-2
            else:
                ans=k-1
    print(ans)


for _ in range(int(input())):
    n,m,k= map(int, input().split())
    n = abs(n)
    m = abs(m)
    if k < max(m,n):
        print(-1)
    else:
        if (max(n,m)-min(n,m))%2 == 0:
            if (k-min(n,m)) % 2 == 0:
                ans = k
            else:
                ans = k-2
        else:
            ans = k-1
        print(ans)


q = int(input().rstrip())
for i in range(q):
    n, m, k = map(int, input().rstrip().split(' '))
    if n<m:
        n,m = m,n
    if k<n:
        print(-1)
    else:
        print(k - (k-n)%2 - (k-m)%2)


q = int(input().rstrip())
for i in range(q):
    n, m, k = map(int, input().rstrip().split(' '))
    if n<m:
        n,m = m,n
    if k<n:
        print(-1)
        continue
    lef = (k-n-m)%2
    if lef>0 and lef%2==1:
        k-=2
    if (n-m)%2==1:
        n-=1
        k-=1
        if lef > 0 and lef % 2 == 1:
            k += 1
    print(k)


def solve():
    q = int(input())
    for i in range(0, q):
        query()

def query():
    n, m, k = map(int, input().split(' '))
    if k < max(n, m):
        print(-1)
        return
    diagonal = n+m-k
    horizontal = (n-diagonal)
    vertical = (m-diagonal)
    print(int(diagonal) + int(horizontal/2)*2 + int(vertical/2)*2)

solve()


def solve():
    q = int(input())
    for i in range(0, q):
        query()

def query():
    n, m, k = map(int, input().split(' '))
    if k < max(n, m):
        print(-1)
        return
    if k <= n+m:
        diagonal = n+m-k
        horizontal = (n-diagonal)
        vertical = (m-diagonal)
        print(int(diagonal) + int(horizontal/2)*2 + int(vertical/2)*2)
    if k > n+m:
        realk = k - int((k-(n+m+1))/2)*2
        diagonal = n+m-realk
        horizontal = (n-diagonal)
        vertical = (m-diagonal)
        print(int(diagonal) + int(horizontal/2)*2 + int(vertical/2)*2 + (k-realk))

solve()


def solve():
    q = int(input())
    for i in range(0, q):
        query()

def query():
    n, m, k = map(int, input().split(' '))
    if k < max(n, m):
        print(-1)
        return
    if (n + m) % 2 == 1:
        print(k-1)
        return
    elif (k - max(n, m)) % 2 == 0:
        print(k)
    else:
        print(k-2)

solve()


def solve():
    q = int(input())
    for i in range(0, q):
        query()

def query():
    n, m, k = map(int, input().split(' '))
    if k < max(n, m):
        print(-1)
        return
    diagonal = n+m-k
    horizontal = (n-diagonal)
    vertical = (m-diagonal)
    if k <= n+m:
        print(int(diagonal) + int(horizontal/2)*2 + int(vertical/2)*2)
    if k > n+m:
        print(k - (n+m)%2)

solve()


def solve():
    q = int(input())
    for i in range(0, q):
        query()

def query():
    n, m, k = map(int, input().split(' '))
    if k < max(n, m):
        print(-1)
        return
    diagonal = min(n, m)
    remaining = max(n, m) - diagonal
    sharktooth = int(remaining/2)*2
    remaining = remaining - sharktooth
    minimal = diagonal + remaining + sharktooth
    if k < minimal:
        print(-1)
        return
    if remaining == 1:
        print(k-1)
        return
    elif (k - minimal) % 2 == 0:
        print(k)
    else:
        print(k-2)

solve()


def solve():
    q = int(input())
    for i in range(0, q):
        query()

def query():
    n, m, k = map(int, input().split(' '))
    if k < max(n, m):
        print(-1)
        return
    diagonal = min(n, m)
    remaining = max(n, m) - diagonal
    sharktooth = int(remaining/2)*2
    remaining = remaining - sharktooth
    minimal = diagonal + remaining + sharktooth
    if k < minimal:
        print(-1)
        return
    if remaining == 1 or (k-minimal)%2 == 2:
        print(diagonal + sharktooth + k - minimal)
        return
    else:
        print(diagonal + sharktooth - 2 + k - minimal)

solve()


#include <iostream>
#include <cstdio>
#include <cstdlib>

/* C. Sereja and Contest */

using namespace std;
typedef long long ll;

#define MAXN 200005

ll n, k, i, j, tmpi, tmpj, p;
ll a[MAXN], d[MAXN], res[MAXN] = {0}, qian[MAXN];

int main(int argc, char * argv[])
{
	cin >> n >> k;
	for (i = 1; i <= n; i ++)
		cin >> a[i];
	d[0] = 0;
	d[1] = 0;
	tmpj = j = 1;
	tmpi = i = 2;
	p = 0;
	qian[1] = 0;
	for (i = 2; i <= n;)
	{
		qian[i] = qian[i - 1] + a[tmpj] * (j - 1);
		d[i] = qian[i] - (i - 1) * (n - i) * a[tmpi];
		tmpj ++;
		tmpi ++;
		if (d[i] < k)
		{
			n --;
			res[p ++] = tmpi - 1;
		}
		else
		{
			j ++;
			i ++;
		}
	}
	for (i = 0; i < p; i ++)
		cout << res[i] << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>

/* C. Sereja and Contest */

using namespace std;
typedef long long ll;

#define MAXN 200005

ll n, k, i, j, tmpi, tmpj, tmp;
double a[MAXN], d[MAXN], qian[MAXN];

int main(int argc, char * argv[])
{
	cin >> n >> k;
	for (i = 1; i <= n; i ++)
		cin >> a[i];
	d[0] = d[1] = 0;
	tmp = n;
	tmpj = j = 1;
	tmpi = i = 2;
	qian[1] = 0;
	for (i = 2; i <= n;)
	{
		qian[i] = qian[i - 1] + a[tmpj] * (j - 1);
		d[i] = qian[i] - (i - 1) * (n - i) * a[tmpi];
		tmpj ++;
		tmpi ++;
		if (d[i] < k)
		{
			n --;
			cout << tmpi - 1 << endl;
		}
		else
		{
			j ++;
			i ++;
		}
	}
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>

/* C. Sereja and Contest */

using namespace std;
typedef long long ll;

#define MAXN 200005

ll n, k, i, j, tmpi, tmpj, p, tmp;
ll a[MAXN], d[MAXN], res[MAXN] = {0}, qian[MAXN];

int main(int argc, char * argv[])
{
	cin >> n >> k;
	for (i = 1; i <= n; i ++)
		cin >> a[i];
	d[0] = 0;
	d[1] = 0;
	tmp = n;
	tmpj = j = 1;
	tmpi = i = 2;
	p = 0;
	qian[1] = 0;
	for (i = 2; i <= n;)
	{
		qian[i] = qian[i - 1] + a[tmpj] * (j - 1);
		d[i] = qian[i] - (tmpi - 1 + n - tmp) * (n - i) * a[tmpi];
		tmpj ++;
		tmpi ++;
		if (d[i] < k)
		{
			n --;
			res[p ++] = tmpi - 1;
		}
		else
		{
			j ++;
			i ++;
		}
	}
	for (i = 0; i < p; i ++)
		cout << res[i] << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>

/* C. Sereja and Contest */

using namespace std;
typedef long long ll;

#define MAXN 200005

ll n, k, i, j, tmpi, tmpj, tmp;
double a[MAXN], d[MAXN], qian[MAXN];

int main(int argc, char * argv[])
{
	cin >> n >> k;
	for (i = 1; i <= n; i ++)
		cin >> a[i];
	d[0] = d[1] = 0;
	tmp = n;
	tmpj = j = 1;
	tmpi = i = 2;
	qian[2] = qian[1] = 0;
	for (i = 2; i <= n;)
	{
		d[i] = (double)qian[i] - (double)(i - 1) * (n - i) * a[tmpi];
		tmpj ++;
		tmpi ++;
		if (d[i] < k)
		{
			n --;
			cout << tmpi - 1 << endl;
		}
		else
		{
			j ++;
			i ++;
			qian[i] = (double)qian[i - 1] + a[tmpj] * (double)(j - 1);
		}
	}
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>

/* C. Sereja and Contest */

using namespace std;
typedef long long ll;

#define MAXN 200005

ll n, k, i, j, tmpi, tmpj, tmp;
ll a[MAXN], d[MAXN], qian[MAXN];

int main(int argc, char * argv[])
{
	cin >> n >> k;
	for (i = 1; i <= n; i ++)
		scanf("%I64d", &a[i]);
	d[0] = d[1] = 0;
	tmp = n;
	tmpj = j = 1;
	tmpi = i = 2;
	qian[2] = qian[1] = 0;
	for (tmpi = 2; tmpi <= tmp; tmpi ++, tmpj ++)
	{
		d[i] = (double)qian[i] - (double)(i - 1) * (n - i) * a[tmpi];
		if (d[i] < k)
		{
			n --;
			printf("%I64d\n", tmpi);
		}
		else
		{
			j ++;
			i ++;
			qian[i] = (double)qian[i - 1] + a[tmpj + 1] * (double)(j - 1);
		}
	}
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<vector>
#include<math.h>
#include<string>
#include<algorithm>
#include<iterator>
#include<iomanip>
#include<limits.h>
using namespace std;

#define Pi 3.14159265358979323846264338327950288419716939937510582;
typedef long long int lld;
#define MOD 1000000007;
#define pb push_back
#define mp make_pair
#define pf push_front
#define ppb pop_back
lld modpow(lld a,lld n,lld temp){lld res=1;while(n>0){res=(res*res)%temp;if(n&1)res=(res*a)%temp;n/=2;}return res;}
lld gcd(lld a,lld b){if(a==0)return(b);else return(gcd(b%a,a));}

int main()
{
	lld n,k,a[200001],del[200001]={0};
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	lld dum=0;
	int i,tot=n,cur=1;
	for(i=1;i<=n;i++)
	{
		if(i==1)
		{
			cur++;
			continue;
		}
		int d=dum-(cur-1)*(tot-cur)*a[i];
		if(d<k)
		{
			cout<<i<<endl;
			tot--;
			cur--;
		}else{
			dum+=a[i]*(cur-1);
		}
		cur++;
	}
	return 0;

}


#include<iostream>
#include<stdio.h>
#include<vector>
#include<math.h>
#include<string>
#include<algorithm>
#include<iterator>
#include<iomanip>
#include<limits.h>
using namespace std;

#define Pi 3.14159265358979323846264338327950288419716939937510582;
typedef long long int lld;
#define MOD 1000000007;
#define pb push_back
#define mp make_pair
#define pf push_front
#define ppb pop_back
lld modpow(lld a,lld n,lld temp){lld res=1;while(n>0){res=(res*res)%temp;if(n&1)res=(res*a)%temp;n/=2;}return res;}
lld gcd(lld a,lld b){if(a==0)return(b);else return(gcd(b%a,a));}

int main()
{
	lld n,k,a[200001],del[200001]={0};
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	lld dum=0;
	int i,tot=n,cur=1;
	for(i=1;i<=n;i++)
	{
		if(i==1)
		{
			cur++;
			continue;
		}
		int d=dum-(cur-1)*(tot-cur)*a[i];
		if(d<k)
		{
			cout<<i<<endl;
			tot--;
			cur--;
		}else{
			dum+=a[i]*(i-1);
		}
		cur++;
	}
	return 0;

}


#include<iostream>
#include<stdio.h>
#include<vector>
#include<math.h>
#include<string>
#include<algorithm>
#include<iterator>
#include<iomanip>
#include<limits.h>
using namespace std;

#define Pi 3.14159265358979323846264338327950288419716939937510582;
typedef long long int lld;
#define MOD 1000000007;
#define pb push_back
#define mp make_pair
#define pf push_front
#define ppb pop_back
lld modpow(lld a,lld n,lld temp){lld res=1;while(n>0){res=(res*res)%temp;if(n&1)res=(res*a)%temp;n/=2;}return res;}
lld gcd(lld a,lld b){if(a==0)return(b);else return(gcd(b%a,a));}

int main()
{
	lld n,k,a[200001],del[200001]={0};
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	lld dum=0;
	int i,tot=n,cur=1;
	for(i=1;i<=n;i++)
	{
		if(i==1)
		{
			cur++;
			continue;
		}
		lld d=dum-(cur-1)*(tot-cur)*a[i];
		if(d<k)
		{
			cout<<i<<endl;
			tot--;
			cur--;
		}else{
			dum+=a[i]*(cur-1);
		}
		cur++;
	}
	return 0;

}