#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
int power(int a, int b) {
  long long c = 1;
  for (int i = 0; i < b; i++) c = c * a;
  return (c);
}
void reverseStr(string& string) {
  int n = string.length();
  for (int i = 0; i < n / 2; i++) swap(string[i], string[n - i - 1]);
}
int palindrom(string a, int m) {
  long long k = 1;
  for (long long i = 0; i < m / 2; i++) {
    cout << a[i] << " " << a[m - 1 - i];
    if (a[i] == a[m - 1 - i]) {
    } else {
      k = 0;
      break;
    }
  }
  if (k != 0)
    return (1);
  else
    return (0);
}
int main() {
  long long t;
  cin >> t;
  for (long long h = 0; h < t; h++) {
    string a;
    cin >> a;
    long long n = a.length();
    long long p = 0, f = 0;
    for (long long i = 0; i < n; i++) {
      if (a[i] == '0')
        p++;
      else
        f++;
    }
    if (p == n || f == n)
      cout << a << "\n";
    else {
      if (a[0] == '0') {
        for (long long i = 0; i < n; i++) cout << "01";
      } else {
        for (long long i = 0; i < n; i++) cout << "10";
      }
      cout << "\n";
    }
  }
}
