#include <bits/stdc++.h>
using namespace std;
double startTime;
double getCurrentTime() {
  return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int power(long long int x, unsigned long long int y,
                    long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    string t, s = "";
    cin >> t;
    long long int ln = t.size();
    long long int f1 = 0, f2 = 0;
    for (long long int i = 0; i < ln; i++) {
      if (t[i] == '0')
        f1 = 1;
      else
        f2 = 1;
    }
    if (f1 && f2) {
      long long int c = 0;
      for (long long int i = 0; i < 2 * ln; i++) {
        if (!c) {
          s += '1';
          c = 1;
        } else {
          s += '0';
          c = 0;
        }
      }
      cout << s << endl;
      continue;
    } else {
      cout << t << endl;
    }
  }
  return 0;
}
