#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    string s, t;
    long long zc = 0, oc = 0;
    cin >> t;
    for (long long i = 0; i < t.size(); i++) {
      if (t[i] == '0')
        zc++;
      else
        oc++;
    }
    if (zc == 0 || oc == 0) {
      s = t;
      cout << s << endl;
    } else {
      long long p = t.size();
      for (long long i = 0; i < p; i++) {
        s.insert(0, "10");
      }
      cout << s << endl;
    }
  }
  return 0;
}
