#include <bits/stdc++.h>
using namespace std;
int n, m, t, k, br;
int niz[1000005];

int main() {
    cin >> t;

    while(t--){
        cin >> n >> m;

            if(n != m)
                cout << -1 <<'\n';
            else{
                k = n;
                br = n;
                while(br--){
                    for(int i = k; i <= n; i++)
                        niz[i] = 1;
                    k--;
                    for(int i = 1; i <= n; i++)
                        cout << niz[i];
                    cout <<endl;
                }
            }
        }

    return 0;}