#include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; int grundy[100]; int mex(vector v){ int mx = *max_element(v.begin(), v.end()); vector used(mx+2); for(int x: v) used[x] = true; for(int i = 0; i <= mx+1; i++){ if(!used[i]) return i; } assert(false); } int popcount(int n){ int ans = 0; for(int i = 0; i < 20; i++){ if(n&(1< base2(int x){ vector ans(MAX_BIT); for(int i = 0; i < MAX_BIT; i++){ if(x&(1< ans = vx; ans[i] = 0; for(int k = j; k < i; k++){ ans[k] = 1; } return ans; }; for(int i = 0; i < MAX_BIT; i++){ for(int j = 0; j <= i; j++){ if(ok(i, j) && vy == convert(i, j)) return true; } } return false; } void test(){ grundy[0] = 0; for(int i = 1; i < 100; i++){ vector v; for(int j = 0; j < i; j++){ if(ok(i, j)) v.push_back(grundy[j]); } grundy[i] = mex(v); } for(int i = 0; i < 100; i++) cout << i << ':' << grundy[i] << endl; } int mod3(vector v){ int cur = 1; int ans = 0; for(int x: v){ ans += cur*x; ans %= 3; cur *= 2; cur %= 3; } return ans; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; // test(); int h, w; cin >> h >> w; vector b(h); for(int i = 0; i < h; i++) cin >> b[i]; int xo = 0; for(int j = 0; j < w; j++){ vector v; for(int i = 0; i < h; i++) { if(b[i][j] == 'o') v.push_back(1); else v.push_back(0); } xo ^= mod3(v); } if(xo == 0) cout << "Second" << endl; else cout << "First" << endl; }