#include <bits/stdc++.h>
using namespace std;
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(9);
  int t, c0, c1;
  string s;
  cin >> t;
  while (t--) {
    cin >> s;
    c0 = 0, c1 = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        c0++;
      else
        c1++;
    }
    if (c0 == 0 || c1 == 0) {
      cout << s << "\n";
    } else {
      for (int i = 0; i < s.size(); i++) {
        cout << s[i];
        if (i < s.size() - 1 && s[i + 1] == s[i]) {
          if (s[i] == '0')
            cout << "1";
          else
            cout << "0";
        }
      }
      cout << "\n";
    }
  }
  return 0;
}
