#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    string s;
    cin >> s;
    int l, i, z = 0, o = 0;
    l = s.length();
    for (i = 0; i < l; i++) {
      if (s[i] == '0')
        z++;
      else
        o++;
    }
    if (z == 0 || o == 0) {
      cout << s << endl;
    } else {
      char x = s[0];
      for (i = 1; i <= 2 * l; i++) {
        cout << x;
        if (x == '0')
          x = '1';
        else
          x = '0';
      }
      cout << endl;
    }
  }
  return 0;
}
