#include <bits/stdc++.h>
using namespace std;
const long long int inf = 0x3f3f3f3f3f3f3f3fll;
vector<int> adj[200005];
vector<int> ve;
vector<int> parent;
int main() {
  int tt;
  cin >> tt;
  for (int ttt = 1; ttt <= tt; ttt++) {
    string s;
    cin >> s;
    int n = s.size();
    int cnt1 = 0, cnt2 = 0;
    for (int i = 0; i < n; i++)
      if (s[i] == '0')
        cnt1++;
      else
        cnt2++;
    if (cnt1 == n || cnt2 == n)
      cout << s << endl;
    else {
      for (int i = 0; i < n; i++) cout << "10";
    }
    cout << endl;
  }
  return 0;
}
