#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(!cin.tie(0));
  long long t;
  cin >> t;
  while (t--) {
    string a;
    cin >> a;
    bool l = true;
    string s;
    long long c = 0, u = 0;
    for (long long i = 0; i <= a.size() - 1; i++) {
      if (a[i] == '0') {
        c++;
      } else {
        u++;
      }
    }
    if (c == 0 || u == 0) {
      cout << a << endl;
    } else {
      s += a[0];
      for (long long i = 1; i <= a.size() - 1; i++) {
        if (s[s.size() - 1] == a[i]) {
          if (a[i] == '1')
            s += '0';
          else
            s += '1';
        }
        s += a[i];
      }
      cout << s << endl;
    }
  }
}
