#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    string str;
    cin >> str;
    int count = 0;
    int n = str.length();
    for (int i = 0; i < n; i++) {
      if (str[i] == '0') count++;
    }
    if (count == n || count == 0) {
      cout << str << endl;
      continue;
    }
    for (int i = 0; i < n; i++) cout << "01";
    cout << endl;
  }
  return 0;
}
