#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll modpow(ll x, ll n) {
  if (n == 0) return 1 % 1000000007;
  ll u = modpow(x, n / 2);
  u = (u * u) % 1000000007;
  if (n % 2 == 1) u = (u * x) % 1000000007;
  return u;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string second;
    cin >> second;
    int first = 0;
    for (int i = 0; i < second.size() - 1; i++) {
      if (second[i] != second[i + 1]) first = 1;
    }
    if (first == 0)
      cout << second << endl;
    else {
      for (int i = 0; i < second.size(); i++) {
        cout << "10";
      }
      cout << endl;
    }
  }
  return 0;
}
