#include <bits/stdc++.h>
using namespace std;
int t, n;
int main() {
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    char c = s[0], flg = 1;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] != c) flg = 0;
    }
    if (flg) {
      cout << s << "\n";
    } else {
      for (int i = 0; i < s.length(); i++) {
        cout << "01";
      }
      cout << "\n";
    }
  }
}
