#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    vector<char> v;
    cin >> s;
    bool only1 = 1, only0 = 1;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '1') only0 = 0;
      if (s[i] == '0') only1 = 0;
    }
    if (only0 || only1)
      cout << s << endl;
    else {
      v.push_back(s[0]);
      for (int i = 1; i < s.length(); i++) {
        if (s[i] == s[i - 1]) {
          if (s[i] == '0')
            v.push_back('1');
          else
            v.push_back('0');
        }
        v.push_back(s[i]);
      }
      for (int i = 0; i < v.size(); i++) cout << v[i];
      cout << endl;
    }
  }
  return 0;
}
