#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream &operator>>(istream &is, vector<T> &arr);
template <typename T>
ostream &operator<<(ostream &os, vector<T> &arr);
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &p);
template <typename T>
istream &operator>>(istream &is, vector<T> &arr) {
  typename vector<T>::iterator a;
  for (a = arr.begin(); a != arr.end(); a++) {
    is >> *a;
  }
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &arr) {
  typename vector<T>::iterator a;
  for (a = arr.begin(); a != arr.end(); a++) {
    os << *a << " ";
  }
  os << endl;
  return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &p) {
  os << p.first << " " << p.second << '\n';
  return os;
}
long long INF = 1e18 + 5;
long long MOD = 1e9 + 7;
long long mul(long long a, long long b, long long md = MOD) {
  return (a % md * b % md) % md;
}
long long add(long long a, long long b, long long md = MOD) {
  return (a % md + b % md) % md;
}
bool valid(int i, int j, int n, int m) {
  return i >= 0 && i < n && j >= 0 && j < m;
}
vector<pair<int, int>> dirs = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
long long binPow(long long x, long long y) {
  int ans = 1;
  while (y > 0) {
    if (y % 2 == 1) ans = mul(ans, x);
    x = mul(x, x);
    y /= 2;
  }
  return ans;
}
vector<set<int>> G(100005);
vector<int> a(100005);
vector<vector<int>> clusters;
vector<bool> vis(100005);
void DFS(int n, int p) {
  vis[n] = true;
  for (int v : G[n]) {
    if (!vis[v]) {
      DFS(v, n);
    }
  }
  if (clusters.empty() || clusters.back().back() * a[n] < 0) {
    clusters.push_back({a[n]});
  } else
    clusters.back().push_back(a[n]);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    if (s.length() <= 2)
      cout << s << endl;
    else {
      int o = 0, e = 0;
      for (char c : s) {
        if (c == '1')
          o++;
        else
          e++;
      }
      if (!o || !e)
        cout << s << endl;
      else {
        for (int i = 0; i < 2 * s.length(); i++) {
          cout << i % 2;
        }
        cout << '\n';
      }
    }
  }
}
