#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.length();
    long long i;
    long long ones, zero;
    ones = 0;
    zero = 0;
    for (long long i = 0; i < n; i++) {
      if (s[i] == '1')
        ones++;
      else
        zero++;
    }
    if (ones == n)
      cout << s << endl;
    else if (zero == n)
      cout << s << endl;
    else {
      for (long long i = 0; i < n - 1; i++) {
        if (s[i] == '1' and s[i + 1] == '1')
          cout << "10";
        else if (s[i] == '0' and s[i + 1] == '0')
          cout << "01";
        else
          cout << s[i];
      }
      cout << s[n - 1] << endl;
    }
  }
}
