#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  for (int tc = 1; tc <= t; tc++) {
    string str;
    cin >> str;
    int n = str.size();
    bool a = 0, b = 0;
    for (int i = 0; i < n; i++) {
      if (str[i] == '0')
        a = true;
      else
        b = true;
    }
    if (a and b)
      for (int i = 0; i < n; i++) cout << "01";
    else
      cout << str;
    cout << '\n';
  }
}
