#include <bits/stdc++.h>
using namespace std;
long long i, j, k, n, mi, ma, x, y, c, t, a, b, f = 0;
string str, ans;
int main() {
  cin >> t;
  while (t--) {
    cin >> str;
    n = str.length();
    f = 0;
    ans = "";
    for (i = 1; i < n; i++) {
      if (str[i] != str[i - 1]) f = 1;
    }
    if (f == 0)
      cout << str << endl;
    else {
      i = 0;
      for (i = 0; i < 2 * n; i++) {
        if (i % 2 == 0)
          ans += '1';
        else
          ans += '0';
      }
      cout << ans << endl;
    }
  }
  return 0;
}
