#include<iostream>
#include<vector>
#include <string>

int main()
{
	int t;
	std::cin >> t;

	std::vector<std::pair<int, int>> fgh(t);

	for (int i = 0; i < t; i++)
	{
		std::pair<int, int> p;
		std::cin >> p.first >> p.second;
		fgh[i] = p;
	}

	for (int i = 0; i < t; i++)
	{
		if (fgh[i].first != fgh[i].second)
		{
			std::cout << -1 << "\n";
			continue;
		}

		for (int j = 0; j < fgh[i].first; j++)
		{
			std::string s(fgh[i].second - j - 1, '0');
			std::string s2(j + 1, '1');

			std::cout << s + s2 + "\n";
		}
	}
}