#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, mod = 1000000007;
void solve() {
  string t;
  cin >> t;
  int n = t.size();
  int num = t[0] - '0';
  bool same = true;
  for (int i = 0; i < n - 1; i++) {
    if (t[i] != t[i + 1]) {
      same = false;
      break;
    }
  }
  if (same) {
    cout << t;
  } else {
    cout << num;
    for (int i = 1; i < n; i++) {
      if (t[i] == t[i - 1]) {
        num = t[i] - '0';
        num = num ^ 1;
        cout << num << t[i];
      } else {
        cout << t[i];
      }
    }
  }
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
