//from https://yukicoder.me/users/24897/ai_code/29 #include #include using namespace std; using namespace atcoder; #ifdef _MSC_VER #include #endif using ll = long long; using ld = long double; using ull = unsigned long long; using P = pair; #define endl "\n" #define rep1(i,n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i,a,b) for (ll i = (ll)(a); i < (ll)(b); i++) #define OVERLOAD_REP(_1,_2,_3,name,...) name #define rep(...) OVERLOAD_REP(__VA_ARGS__, rep2, rep1)(__VA_ARGS__) #define rrep(i,n) for (ll i = (ll)(n) - 1; i >= 0; i--) #define all(s) (s).begin(), (s).end() #define fi first #define se second constexpr int MINT_MOD = 998244353; const ll mod = MINT_MOD; const ll inf = 4000000000000000000ll; const ld eps = ld(0.00000000001); static const long double pi = 3.141592653589793; constexpr ll MAX = 2000010; templatevoid vcin(vector &n){for(int i=0;i>n[i];} templatevoid vcin(vector &n,vector &m){for(int i=0;i>n[i]>>m[i];} templatevoid vcout(vector &n){for(int i=0;ivoid vcin(vector> &n){for(int i=0;i>n[i][j];}}} templatevoid vcout(vector> &n){for(int i=0;ivoid print(pair a){cout<auto min(const T& a){ return *min_element(all(a)); } templateauto max(const T& a){ return *max_element(all(a)); } templatebool chmax(T &a,const U b) { if (abool chmin(T &a,const U b) { if (b void ifmin(T t,T u){if(t>u){cout<<-1< void ifmax(T t,T u){if(t>u){cout<<-1< using V = vector; template using VV = V>; template using VVV = V>>; template auto mvec(T val, ll n) { return V(n, val); } template auto mvec(T val, ll n, Args... args) { return V(n, mvec(val, args...)); } vector divisor(ll x){ vector ans; for(ll i = 1; i * i <= x; i++){ if(x % i == 0) {ans.push_back(i); if(i*i!=x){ ans.push_back(x / i);}}}sort(all(ans)); return ans; } ll pop(ll x){return __builtin_popcountll(x);} ll poplong(ll x){ll y=-1;while(x){x/=2;y++;}return y;} P hyou(P a){ll x=gcd(abs(a.fi),abs(a.se));a.fi/=x;a.se/=x;if(a.se<0){a.fi*=-1;a.se*=-1;}return a;} P Pplus(P a,P b){ return hyou({a.fi*b.se+b.fi*a.se,a.se*b.se});} P Ptimes(P a,ll b){ return hyou({a.fi*b,a.se});} P Ptimes(P a,P b){ return hyou({a.fi*b.fi,a.se*b.se});} P Pminus(P a,P b){ return hyou({a.fi*b.se-b.fi*a.se,a.se*b.se});} P Pgyaku(P a){ return hyou({a.se,a.fi});} void cincout(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<< fixed << setprecision(15); } int main(){ cincout(); ll n,k; cin>>n>>k; string s=""; rep(i,k){ s+='9'; } rep(i,n){ string ss; cin>>ss; rep(j,k){ chmin(s[j],ss[j]); } } cout<