#include <bits/stdc++.h>
using namespace std;
void printArray(long long arr[], long long size) {
  for (int i = 0; i < size; i++) cout << arr[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    string a;
    set<char> s;
    cin >> a;
    for (long long i = 0; i < a.size(); i++) {
      s.insert(a[i]);
    }
    if (s.size() == 1) {
      for (long long i = 0; i < 2 * a.size(); i++) cout << *s.begin();
      cout << endl;
    } else {
      string p = "01";
      for (long long i = 0; i < a.size(); i++) cout << p;
      cout << endl;
    }
  }
  return 0;
}
