#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    ll n = s.size();
    ll cnt = 0, cnt1 = 0;
    int fl = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0')
        cnt++;
      else
        cnt1++;
      if (cnt1 && cnt) {
        fl = 1;
        break;
      }
    }
    if (!fl) {
      cout << s << endl;
      continue;
    }
    for (int i = 0; i < n; i++) {
      cout << s[i];
      if (s[i + 1] == s[i] && i < n) {
        if (s[i] == '0')
          cout << '1';
        else
          cout << "0";
      }
    }
    cout << endl;
  }
}
