#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  long long l = s.length();
  long long zero = 0, one = 0;
  for (long long i = 0; i < l; i++) {
    if (s[i] == '1') {
      one++;
    } else {
      zero++;
    }
  }
  if (one == l || zero == l) {
    cout << s << endl;
  } else {
    string ans = "";
    ans += s[0];
    char curr = s[0];
    for (long long i = 1; i < l; i++) {
      if (s[i] == curr) {
        if (curr == '1') {
          ans += "01";
          curr = '1';
        } else {
          ans += "10";
          curr = '0';
        }
      } else {
        ans += s[i];
        curr = s[i];
      }
    }
    cout << ans << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
