#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
constexpr int mod = 1e9 + 7;
constexpr int inf = 1e9;
constexpr ll linf = 1e18;
constexpr ld eps = 1e-9;
#define fast_io() ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
#define sz(x) ((int)(x).size())
void solve() {
int n, m, k; cin >> n >> m >> k;
vector<string> vc(n);
for (auto& x : vc) cin >> x;
for (int i = 0; i < n; i++) {
string cur;
for (char ch : vc[i]) {
for (int j = 0; j < k; j++) cur += ch;
}
for (int j = 0; j < k; j++) cout << cur << '\n';
}
}
int main() {
fast_io();
freopen("cowsignal.in", "r", stdin);
freopen("cowsignal.out", "w", stdout);
int t = 1;
// cin >> t;
while (t--) solve();
return 0;
}
I3ByYWdtYSBHQ0Mgb3B0aW1pemUoIk8zIikKI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp1c2luZyBsbCA9IGxvbmcgbG9uZzsKdXNpbmcgbGQgPSBsb25nIGRvdWJsZTsKCmNvbnN0ZXhwciBpbnQgbW9kID0gMWU5ICsgNzsKY29uc3RleHByIGludCBpbmYgPSAxZTk7CmNvbnN0ZXhwciBsbCBsaW5mID0gMWUxODsKY29uc3RleHByIGxkIGVwcyA9IDFlLTk7CgojZGVmaW5lIGZhc3RfaW8oKSBpb3M6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7IGNpbi50aWUobnVsbHB0cik7IGNvdXQudGllKG51bGxwdHIpCiNkZWZpbmUgYWxsKHgpICh4KS5iZWdpbigpLCAoeCkuZW5kKCkKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBmaSBmaXJzdAojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIHN6KHgpICgoaW50KSh4KS5zaXplKCkpCgp2b2lkIHNvbHZlKCkgewogICAgaW50IG4sI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