rt.
#include <bits/stdc++.h>
#define int long long
using namespace std;
int T;
int toBinary(int n) {
int binary = 0;
int number, i = 1;
while (n) {
number = n % 2;
n /= 2;
binary += number * i;
i *= 10;
}
return binary;
}
signed main() {
for (cin >> T; T--; ) {
int n;
cin >> n;
bitset<9> b(toBinary(n));
cout << b;
cout << endl;
if (b[0]) cout << 'r';
else cout << '-';
if (b[1]) cout << 'w';
else cout << '-';
if (b[2]) cout << 'x';
else cout << '-';
if (b[3]) cout << 'r';
else cout << '-';
if (b[4]) cout << 'w';
else cout << '-';
if (b[5]) cout << 'x';
else cout << '-';
if (b[6]) cout << 'r';
else cout << '-';
if (b[7]) cout << 'w';
else cout << '-';
if (b[8]) cout << 'x';
else cout << '-';
putchar('\n');
}
return 0;
}