#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int n = s.length();
    long long int a[n];
    long long int z = 0, o = 0;
    for (long long int i = 0; i < n; i++) {
      a[i] = s[i] - 48;
      if (a[i] == 0)
        z = 1;
      else
        o = 1;
    }
    if (z == 0 || o == 0) {
      for (long long int i = 0; i < n; i++) cout << a[i];
    } else if (a[0] == 0) {
      for (long long int i = 0; i < (2 * n); i++) {
        if (i % 2 == 0)
          cout << 0;
        else
          cout << 1;
      }
    } else {
      for (long long int i = 0; i < (2 * n); i++) {
        if (i % 2 == 0)
          cout << 1;
        else
          cout << 0;
      }
    }
    cout << endl;
  }
}
