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

using namespace std;

void bracket() {
    string s;
    cin >> s;
    
    if (s == "()") {
        cout << "NO\n";
        return;
    }
    
    int n = s.length();
    string p1 = "";
    string p2 = "";
    
    for (int i = 0; i < n; ++i) {
        p1 += "()";
    }
    
    for (int i = 0; i < n; ++i) {
        p2 += "(";
    }
    for (int i = 0; i < n; ++i) {
        p2 += ")";
    }
    
    cout << "YES\n";
    if (p1.find(s) == string::npos) {
        cout << p1 << "\n";
    } else {
        cout << p2 << "\n";
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t;
    cin >> t;
    while (t--) {
        bracket();
    }
    
    return 0;
}