#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  for (long long tt = 0; tt < t; tt++) {
    string s;
    cin >> s;
    int flag = 1;
    int c1 = 0, c2 = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        c1++;
      else
        c2++;
    }
    for (int i = 0; i < s.size() - 1; i++) {
      if (s[i] != s[i + 1]) flag = 0;
    }
    if (flag == 1)
      cout << s << "\n";
    else {
      char arr[200];
      if (s[0] == '0') {
        for (int i = 0; i < (c1 + c2); i++) cout << "01";
        cout << "\n";
      } else if (s[0] == '1') {
        for (int i = 0; i < (c1 + c2); i++) cout << "10";
        cout << "\n";
      }
    }
  }
  return 0;
}
