#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s, ans;
    cin >> s;
    int n = 0, m = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        n++;
      else
        m++;
    }
    if (n == 0 || m == 0)
      cout << s << endl;
    else {
      for (int i = 0; i < s.size(); i++) {
        if (s[i] == s[i + 1]) {
          if (s[i] == '0') {
            ans += '0';
            ans += '1';
          } else {
            ans += '1';
            ans += '0';
          }
        } else
          ans += s[i];
      }
      cout << ans << endl;
    }
  }
}
