#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long tc;
  cin >> tc;
  while (tc--) {
    long long onec = 0;
    long long zcou = 0;
    string s;
    cin >> s;
    string formed = "";
    formed += s[0];
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] == '1')
        onec++;
      else
        zcou++;
    }
    if (onec == s.size() || zcou == s.size()) {
      cout << s << endl;
      continue;
    } else {
      for (long long i = 1; i < s.size(); i++) {
        if (s[i] == s[i - 1]) {
          if (s[i] == '1')
            formed += '0';
          else
            formed += '1';
          formed += s[i];
        } else {
          formed += s[i];
        }
      }
    }
    for (auto i : formed) cout << i;
    cout << endl;
  }
}
int32_t main() {
  solve();
  return 0;
}
