#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
void solve() {
  string s;
  cin >> s;
  long long f1 = 0, f2 = 0;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '0') f1 = 1;
    if (s[i] == '1') f2 = 1;
  }
  if (f1 && f2) {
    for (long long i = 0; i < s.length() * 2 - 1; i++) {
      if (i % 2 == 0)
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  } else
    cout << s << endl;
  return;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
