#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int test;
  cin >> test;
  for (long long(ti) = 0; (ti) < (test); (ti)++) {
    string t;
    cin >> t;
    bool ok = true;
    char c = t[0];
    for (long long(i) = 0; (i) < (t.length()); (i)++) {
      if (t[i] != c) ok = false;
    }
    if (ok) {
      for (long long(i) = 0; (i) < (t.length()); (i)++) cout << c;
    } else {
      for (long long(i) = 0; (i) < (t.length() * 2); (i)++) {
        if (i % 2)
          cout << '0';
        else
          cout << '1';
      }
    }
    cout << endl;
  }
}
