#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long power(long long a, long long b, long long modi) {
  long long res = 1;
  while (b) {
    if (b % 2) {
      res = (res * a) % modi;
    }
    b /= 2;
    a = (a * a) % modi;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    string str;
    cin >> str;
    long long c1 = 0, c2 = 0;
    for (long long i = 0; i < str.length(); i++) {
      if (str[i] == '1')
        c1++;
      else
        c2++;
    }
    if (c1 == 0 || c2 == 0)
      cout << str << '\n';
    else {
      for (long long i = 0; i < 2 * str.length(); i++) {
        if (i % 2)
          cout << 0;
        else
          cout << 1;
      }
      cout << '\n';
    }
  }
  return 0;
}
