#include <bits/stdc++.h>
using namespace std;
typedef pair<long long int, long long int> ii;
typedef vector<long long int> vi;
typedef vector<vector<long long int>> vvi;
typedef vector<pair<long long int, long long int>> vii;
const long long int mod = 1e9 + 7;
const long long int pinf = 9223372036854775807;
const long long int ninf = -9223372036854775807;
const long double pi = 3.141592653589793;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    char str[101];
    scanf("%s", str);
    int count0 = 0, count1 = 0;
    for (long long int i = (0); i < (strlen(str)); ++i) {
      if (str[i] == '0')
        count0++;
      else
        count1++;
    }
    if (count0 == 0 || count1 == 0)
      printf("%s", str);
    else {
      for (long long int i = (0); i < (strlen(str) * 2); ++i) {
        if (i % 2 == 0)
          printf("1");
        else
          printf("0");
      }
    }
    printf("\n");
  }
  return 0;
}
