#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long tc;
  cin >> tc;
  while (tc--) {
    string s;
    cin >> s;
    long long h = 0;
    long long n = s.size();
    for (long long i = 0; i < n - 1; i++) {
      if (s[i] != s[i + 1]) h++;
    }
    if (h == 0)
      for (long long i = 0; i < 2 * n; i++) cout << s[0];
    else
      for (long long i = 0; i < n; i++) cout << "01";
    cout << endl;
  }
}
