#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int c1 = 0;
    long long int c0 = 0;
    for (long long int i = 0; i < s.length(); ++i) {
      if (s[i] == '0') {
        c0++;
      } else {
        c1++;
      }
    }
    if (c1 == 0 || c0 == 0) {
      cout << s << endl;
    } else {
      for (long long int i = 0; i < s.size(); ++i) {
        cout << '0' << '1';
      }
      cout << endl;
    }
  }
  return 0;
}
