#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.size();
    char ch = s[0];
    bool flag = true;
    for (int i = 1; i < n; i++) {
      if (s[i] != ch) {
        flag = false;
        break;
      }
    }
    if (flag == true) {
      cout << s << endl;
      continue;
    }
    string ans = "";
    ans += s[0];
    for (int i = 1; i < n; i++) {
      if (s[i] != s[i - 1]) {
        ans += s[i];
      } else {
        if (s[i] == '1') ans += '0';
        if (s[i] == '0') ans += '1';
        ans += s[i];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
