#include <bits/stdc++.h>
using namespace std;
inline void get_arr(vector<int> &arr, int n) {
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    arr.push_back(a);
  }
}
inline void print_arr(vector<int> &arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "\n";
  ;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.size();
    string ans = "10";
    if (*min_element(s.begin(), s.end()) == '1' ||
        *max_element(s.begin(), s.end()) == '0') {
      cout << s << "\n";
      ;
      continue;
    } else {
      for (int i = 0; i < (n); ++i) cout << ans;
    }
    cout << "\n";
  }
  return (0);
}
