#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int flag = s[0] - '0', f = 0;
    for (int i = 0; i < s.size(); i++) {
      if ((s[i] - '0') != flag) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      cout << s << endl;
    } else {
      for (int i = 0; i < s.size(); i++) {
        cout << s[i];
        if (s[i] == s[i + 1]) {
          if (s[i] == '0') {
            cout << 1;
          } else {
            cout << 0;
          }
        }
      }
      cout << endl;
    }
  }
}
