#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
long long power_mod(long long x, long long y) {
  x %= 1000000007;
  long long res = 1;
  while (y) {
    if (y & 1) {
      res = (res * x) % 1000000007;
    }
    y /= 2;
    x = (x * x) % 1000000007;
  }
  return res;
}
void solve() {
  string s;
  cin >> s;
  int n = s.length(), one = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      one++;
    }
  }
  if (one == 0 || one == n) {
    cout << s << "\n";
    return;
  }
  int c = 0;
  for (int i = 0; i < 2 * n; i++) {
    if (c ^ 1) {
      cout << 1;
      c = 1;
    } else {
      cout << 0;
      c = 0;
    }
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int tc = 1;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
