#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x7f7f7f7f;
void solve() {
  string s;
  cin >> s;
  bool ck = true;
  for (int i = 1; i < (int)s.size(); i++)
    if (s[i - 1] != s[i]) ck = false;
  if (ck)
    cout << s << "\n";
  else {
    cout << s[0];
    for (int i = 1; i < (int)s.size(); i++) {
      if (s[i - 1] == s[i] && s[i] == '1') {
        cout << "01";
      } else if (s[i - 1] == s[i] && s[i] == '0') {
        cout << "10";
      } else
        cout << s[i];
    }
    cout << "\n";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
