#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long ans;
  long long T;
  scanf("%lld", &T);
  while (T--) {
    string s;
    cin >> s;
    long long ss = s.size();
    long long a = 0;
    for (long long i = 0; i < s.size(); ++i) {
      if (s[i] == '0') ++a;
    }
    if (a == 0 || a == ss)
      cout << s;
    else {
      for (long long i = 1; i <= ss; ++i) {
        printf("01");
      }
    }
    cout << endl;
  }
}
