#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void solve() {
  string s;
  cin >> s;
  long long n = s.length();
  if (n == 2) {
    cout << s << endl;
    return;
  }
  long long o = 0, e = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0')
      o++;
    else
      e++;
  }
  if (o == 0) {
    cout << s << s << endl;
    return;
  }
  if (e == 0) {
    cout << s;
    cout << s;
    cout << endl;
    return;
  }
  for (long long i = 1; i <= 2 * n; i++) {
    if (i & 1)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
