#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    string s;
    vector<char> v;
    cin >> s;
    if (s.size() == 2) {
      cout << s << endl;
    } else {
      long long cnt1 = 0, cnt0 = 0;
      for (long long i = 0; i < s.size(); i++) {
        if (s[i] == '1') {
          cnt1++;
        } else {
          cnt0++;
        }
      }
      if (cnt1 == s.size() || cnt0 == s.size()) {
        cout << s << endl;
      } else {
        long long j = 0;
        for (long long i = 0; i < s.size(); i++) {
          if (s[i] == s[i + 1]) {
            if (s[i] == '1') {
              v.push_back(s[i]);
              v.push_back('0');
            } else {
              v.push_back(s[i]);
              v.push_back('1');
            }
          } else {
            v.push_back(s[i]);
          }
        }
      }
      for (long long i = 0; i < v.size(); i++) {
        cout << v[i];
      }
      cout << endl;
    }
  }
}
