#include <bits/stdc++.h>
using namespace std;
int t, len;
string s;
bool check() {
  for (int i = 1; i < len; i++)
    if (s[i] != s[0]) return 0;
  return 1;
}
int main() {
  cin >> t;
  while (t--) {
    cin >> s;
    len = s.length();
    if (check())
      cout << s << endl;
    else {
      cout << s[0];
      for (int i = 1; i < len; i++) {
        if (s[i] == s[i - 1]) cout << 1 - s[i] + '0';
        cout << s[i];
      }
      cout << endl;
    }
  }
}
