#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<char> > data(h, vector<char>(w));
  for (int i = 0; i < (h); i++)
    for (int j = 0; j < (w); j++) cin >> data[i][j];
  cout << data[0][0] << endl;
}
