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