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