#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
void solve() {
  string s;
  cin >> s;
  int c1 = 0, c2 = 0;
  for (auto c : s) c1 += c == '0', c2 += c == '1';
  if (!(c1 > 0 && c2 > 0))
    cout << s << endl;
  else {
    for (int i = 0; i < s.size(); i++) {
      if (i)
        if (s[i - 1] == s[i]) cout << (char)('1' + '0' - s[i]);
      cout << s[i];
    }
  }
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t-- > 0) solve();
}
