#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define len(a) int((a).size())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>
std::vector<int> prefix_function(const T &str) {
int n = str.size();
std::vector<int> p(n);
for (int i = 1, j = 0; i < n; i++) {
while (j > 0 && str[i] != str[j]) {
j = p[j - 1];
}
if (str[i] == str[j]) {
j++;
}
p[i] = j;
}
return p;
}
int period(const string &s) {
int p = len(s) - prefix_function(s).back();
return len(s) % p == 0 ? p : len(s);
}
void update(string &A, string &B, ll g) {
vector<int> m(g);
for (auto &x : m) {
x = rng() % 2;
}
for (int i = 0; i < len(A); i++) {
A[i] ^= m[i % g];
}
for (int i = 0; i < len(B); i++) {
B[i] ^= m[i % g];
}
}
void solve(int /* test_num */) {
ll a, b, c;
cin >> a >> b >> c;
string A(a, '0'), B(b, '0'), C(c, '0');
ll gab = gcd(a, b), gbc = gcd(b, c), gca = gcd(c, a);
if(c==a*b/gab||a==b*c/gbc||b==a*c/gca) ;
else
{
cout<<"NO\n";
return;
}
for (int it = 0; it < 40; it++) {
if (period(A) == a && period(B) == b && period(C) == c) {
cout << "Yes\n" << A << '\n' << B << '\n' << C << '\n';
return;
}
update(A, B, gab);
update(B, C, gbc);
update(C, A, gca);
}
cout << "NO\n";
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int tests;
cin >> tests;
for (int test_num = 1; test_num <= tests; test_num++) {
solve(test_num);
}
}