#define LOCAL

/** ` Micro Mezzo Macro Flation -- Overheated Economy ., **/

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>

using namespace std;

#define REP(i, n) for (int i=0;i<int(n);++i)
#define FOR(i, a, b) for (int i=int(a);i<int(b);++i)
#define DWN(i, b, a) for (int i=int(b-1);i>=int(a);--i)
#define REP_1(i, n) for (int i=1;i<=int(n);++i)
#define FOR_1(i, a, b) for (int i=int(a);i<=int(b);++i)
#define DWN_1(i, b, a) for (int i=int(b);i>=int(a);--i)
#define REP_C(i, n) for (int n____=int(n),i=0;i<n____;++i)
#define FOR_C(i, a, b) for (int b____=int(b),i=a;i<b____;++i)
#define DWN_C(i, b, a) for (int a____=int(a),i=b-1;i>=a____;--i)
#define REP_N(i, n) for (i=0;i<int(n);++i)
#define FOR_N(i, a, b) for (i=int(a);i<int(b);++i)
#define DWN_N(i, b, a) for (i=int(b-1);i>=int(a);--i)
#define REP_1_C(i, n) for (int n____=int(n),i=1;i<=n____;++i)
#define FOR_1_C(i, a, b) for (int b____=int(b),i=a;i<=b____;++i)
#define DWN_1_C(i, b, a) for (int a____=int(a),i=b;i>=a____;--i)
#define REP_1_N(i, n) for (i=1;i<=int(n);++i)
#define FOR_1_N(i, a, b) for (i=int(a);i<=int(b);++i)
#define DWN_1_N(i, b, a) for (i=int(b);i>=int(a);--i)
#define REP_C_N(i, n) for (n____=int(n),i=0;i<n____;++i)
#define FOR_C_N(i, a, b) for (b____=int(b),i=a;i<b____;++i)
#define DWN_C_N(i, b, a) for (a____=int(a),i=b-1;i>=a____;--i)
#define REP_1_C_N(i, n) for (n____=int(n),i=1;i<=n____;++i)
#define FOR_1_C_N(i, a, b) for (b____=int(b),i=a;i<=b____;++i)
#define DWN_1_C_N(i, b, a) for (a____=int(a),i=b;i>=a____;--i)

#define ECH(it, A) for (typeof(A.begin()) it=A.begin(); it != A.end(); ++it)
#define DO(n) while(n--)
#define DO_C(n) int n____ = n; while(n____--)
#define TO(i, a, b) int s_=a<b?1:-1,b_=b+s_;for(int i=a;i!=b_;i+=s_)
#define TO_1(i, a, b) int s_=a<b?1:-1,b_=b;for(int i=a;i!=b_;i+=s_)
#define SQZ(i, j, a, b) for (int i=int(a),j=int(b)-1;i<j;++i,--j)
#define SQZ_1(i, j, a, b) for (int i=int(a),j=int(b);i<=j;++i,--j)
#define REP_2(i, j, n, m) REP(i, n) REP(j, m)
#define REP_2_1(i, j, n, m) REP_1(i, n) REP_1(j, m)

#define ALL(A) A.begin(), A.end()
#define LLA(A) A.rbegin(), A.rend()
#define CPY(A, B) memcpy(A, B, sizeof(A))
#define INS(A, P, B) A.insert(A.begin() + P, B)
#define ERS(A, P) A.erase(A.begin() + P)
#define BSC(A, X) find(ALL(A), X) // != A.end()
#define CTN(T, x) (T.find(x) != T.end())
#define SZ(A) int(A.size())
#define PB push_back
#define MP(A, B) make_pair(A, B)

#define Rush int T____; RD(T____); DO(T____)
#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#define Ruby system("ruby main.rb")
#define Haskell system("runghc main.hs")
#define Pascal system("fpc main.pas")

typedef long long LL;
typedef double DB;
typedef unsigned UINT;
typedef unsigned long long ULL;

typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<string> VS;
typedef vector<LL> VL;
typedef vector<DB> VD;
typedef set<int> SI;
typedef set<string> SS;
typedef set<LL> SL;
typedef set<DB> SD;
typedef map<int, int> MII;
typedef map<string, int> MSI;
typedef map<LL, int> MLI;
typedef map<DB, int> MDI;
typedef map<int, bool> MIB;
typedef map<string, bool> MSB;
typedef map<LL, bool> MLB;
typedef map<DB, bool> MDB;
typedef pair<int, int> PII;
typedef pair<int, bool> PIB;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef vector<VII> VVII;
typedef set<PII> SII;
typedef map<PII, int> MPIII;
typedef map<PII, bool> MPIIB;

/** I/O Accelerator **/

/* ... :" We are I/O Accelerator ... Use us at your own risk ;) ... " .. */

template<class T> inline void RD(T &);
template<class T> inline void OT(const T &);

inline int RD(){ int x; RD(x); return x;}
template<class T> inline T& _RD(T &x){ RD(x); return x;}
inline void RC(char &c){scanf(" %c", &c);}
inline void RS(char *s){scanf("%s", s);}

template<class T0, class T1> inline void RD(T0 &x0, T1 &x1){RD(x0), RD(x1);}
template<class T0, class T1, class T2> inline void RD(T0 &x0, T1 &x1, T2 &x2){RD(x0), RD(x1), RD(x2);}
template<class T0, class T1, class T2, class T3> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3){RD(x0), RD(x1), RD(x2), RD(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5), RD(x6);}
template<class T0, class T1> inline void OT(T0 &x0, T1 &x1){OT(x0), OT(x1);}
template<class T0, class T1, class T2> inline void OT(T0 &x0, T1 &x1, T2 &x2){OT(x0), OT(x1), OT(x2);}
template<class T0, class T1, class T2, class T3> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3){OT(x0), OT(x1), OT(x2), OT(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5), OT(x6);}

template<class T> inline void RST(T &A){memset(A, 0, sizeof(A));}
template<class T0, class T1> inline void RST(T0 &A0, T1 &A1){RST(A0), RST(A1);}
template<class T0, class T1, class T2> inline void RST(T0 &A0, T1 &A1, T2 &A2){RST(A0), RST(A1), RST(A2);}
template<class T0, class T1, class T2, class T3> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3){RST(A0), RST(A1), RST(A2), RST(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5), RST(A6);}

template<class T> inline void CLR(priority_queue<T, vector<T>, less<T> > &Q){
    while (!Q.empty()) Q.pop();
}

template<class T> inline void CLR(priority_queue<T, vector<T>, greater<T> > &Q){
    while (!Q.empty()) Q.pop();
}

template<class T> inline void CLR(T &A){A.clear();}
template<class T0, class T1> inline void CLR(T0 &A0, T1 &A1){CLR(A0), CLR(A1);}
template<class T0, class T1, class T2> inline void CLR(T0 &A0, T1 &A1, T2 &A2){CLR(A0), CLR(A1), CLR(A2);}
template<class T0, class T1, class T2, class T3> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3){CLR(A0), CLR(A1), CLR(A2), CLR(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5), CLR(A6);}
template<class T> inline void CLR(T &A, int n){REP(i, n) CLR(A[i]);}
template<class T> inline void FLC(T &A, int x){memset(A, x, sizeof(A));}
template<class T0, class T1> inline void FLC(T0 &A0, T1 &A1, int x){FLC(A0, x), FLC(A1, x);}
template<class T0, class T1, class T2> inline void FLC(T0 &A0, T1 &A1, T2 &A2){FLC(A0), FLC(A1), FLC(A2);}
template<class T0, class T1, class T2, class T3> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3){FLC(A0), FLC(A1), FLC(A2), FLC(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5), FLC(A6);}

template<class T> inline void SRT(T &A){sort(ALL(A));}
template<class T, class C> inline void SRT(T &A, C B){sort(ALL(A), B);}

/** Add - On **/

const int MOD = 1000000007;
const int INF = 10009;
const DB EPS = 1e-2;
const DB OO = 1e15;
const DB PI = 3.14159265358979323846264; //M_PI;

// <<= ` 0. Daily Use .,

template<class T> inline void checkMin(T &a,const T b){if (b<a) a=b;}
template<class T> inline void checkMax(T &a,const T b){if (b>a) a=b;}
template <class T, class C> inline void checkMin(T& a, const T b, C c){if (c(b,a)) a = b;}
template <class T, class C> inline void checkMax(T& a, const T b, C c){if (c(a,b)) a = b;}
template<class T> inline T min(T a, T b, T c){return min(min(a, b), c);}
template<class T> inline T max(T a, T b, T c){return max(max(a, b), c);}
template<class T> inline T min(T a, T b, T c, T d){return min(min(a, b), min(c, d));}
template<class T> inline T max(T a, T b, T c, T d){return max(min(a, b), max(c, d));}
template<class T> inline T sqr(T a){return a*a;}
template<class T> inline T cub(T a){return a*a*a;}
int Ceil(int x, int y){return (x - 1) / y + 1;}

// <<= ` 1. Bitwise Operation .,
inline bool _1(int x, int i){return x & 1<<i;}
inline bool _1(LL x, int i){return x & 1LL<<i;}
inline LL _1(int i){return 1LL<<i;}
//inline int _1(int i){return 1<<i;}
inline LL _U(int i){return _1(i) - 1;};
//inline int _U(int i){return _1(i) - 1;};

inline int count_bits(int x){
    x = (x & 0x55555555) + ((x & 0xaaaaaaaa) >> 1);
    x = (x & 0x33333333) + ((x & 0xcccccccc) >> 2);
    x = (x & 0x0f0f0f0f) + ((x & 0xf0f0f0f0) >> 4);
    x = (x & 0x00ff00ff) + ((x & 0xff00ff00) >> 8);
    x = (x & 0x0000ffff) + ((x & 0xffff0000) >> 16);
    return x;
}

inline int count_bits(LL x){
    x = (x & 0x5555555555555555LL) + ((x & 0xaaaaaaaaaaaaaaaaLL) >> 1);
    x = (x & 0x3333333333333333LL) + ((x & 0xccccccccccccccccLL) >> 2);
    x = (x & 0x0f0f0f0f0f0f0f0fLL) + ((x & 0xf0f0f0f0f0f0f0f0LL) >> 4);
    x = (x & 0x00ff00ff00ff00ffLL) + ((x & 0xff00ff00ff00ff00LL) >> 8);
    x = (x & 0x0000ffff0000ffffLL) + ((x & 0xffff0000ffff0000LL) >> 16);
    x = (x & 0x00000000ffffffffLL) + ((x & 0xffffffff00000000LL) >> 32);
    return x;
}

int reverse_bits(int x){
    x = ((x >> 1) & 0x55555555) | ((x << 1) & 0xaaaaaaaa);
    x = ((x >> 2) & 0x33333333) | ((x << 2) & 0xcccccccc);
    x = ((x >> 4) & 0x0f0f0f0f) | ((x << 4) & 0xf0f0f0f0);
    x = ((x >> 8) & 0x00ff00ff) | ((x << 8) & 0xff00ff00);
    x = ((x >> 16) & 0x0000ffff) | ((x << 16) & 0xffff0000);
    return x;
}

// <<= ` 2. Modular Arithmetic Basic .,

inline void INC(int &a, int b){a += b; if (a >= MOD) a -= MOD;}
inline int sum(int a, int b){a += b; if (a >= MOD) a -= MOD; return a;}
inline void DEC(int &a, int b){a -= b; if (a < 0) a += MOD;}
inline int dff(int a, int b){a -= b; if (a < 0) a  += MOD; return a;}
inline void MUL(int &a, int b){a = (LL)a * b % MOD;}
inline int pdt(int a, int b){return (LL)a * b % MOD;}

inline int pow(int a, int b){
    int c = 1;
    while (b) {
        if (b&1) MUL(c, a);
        MUL(a, a), b >>= 1;
    }
    return c;
}

template<class T>
inline int pow(T a, int b){
    T c(1);
    while (b) {
        if (b&1) MUL(c, a);
        MUL(a, a), b >>= 1;
    }
    return c;
}

inline int _I(int b){
    int a = MOD, x1 = 0, x2 = 1, q;
    while (true){
        q = a / b, a %= b;
        if (!a) return (x2 + MOD) % MOD;
        DEC(x1, pdt(q, x2));

        q = b / a, b %= a;
        if (!b) return (x1 + MOD) % MOD;
        DEC(x2, pdt(q, x1));
    }
}

inline void DIV(int &a, int b){MUL(a, _I(b));}
inline int qtt(int a, int b){return pdt(a, _I(b));}

inline int sum(int a, int b, int MOD){
    a += b; if (a >= MOD) a -= MOD;
    return a;
}

inline int phi(int n){
    int res = n;
    for (int i=2;sqr(i)<=n;++i) if (!(n%i)){
        DEC(res, qtt(res, i));
        do{n /= i;} while(!(n%i));
    }
    if (n != 1)
        DEC(res, qtt(res, n));
    return res;
}

// <<= '9. Comutational Geometry .,

struct Po; struct Line; struct Seg;

inline int sgn(DB x){return x < -EPS ? -1 : x > EPS;}
inline int sgn(DB x, DB y){return sgn(x - y);}

struct Po{
    DB x, y;
    Po(DB _x = 0, DB _y = 0):x(_x), y(_y){}

    friend istream& operator >>(istream& in, Po &p){return in >> p.x >> p.y;}
    friend ostream& operator <<(ostream& out, Po p){return out << "(" << p.x << ", " << p.y << ")";}

    friend bool operator ==(Po, Po);
    friend bool operator !=(Po, Po);
    friend Po operator +(Po, Po);
    friend Po operator -(Po, Po);
    friend Po operator *(Po, DB);
    friend Po operator /(Po, DB);

    bool operator < (const Po &rhs) const{return sgn(x, rhs.x) < 0 || sgn(x, rhs.x) == 0 && sgn(y, rhs.y) < 0;}
    Po operator-() const{return Po(-x, -y);}
    Po& operator +=(Po rhs){x += rhs.x, y += rhs.y; return *this;}
    Po& operator -=(Po rhs){x -= rhs.x, y -= rhs.y; return *this;}
    Po& operator *=(DB k){x *= k, y *= k; return *this;}
    Po& operator /=(DB k){x /= k, y /= k; return *this;}

    DB length_sqr(){return sqr(x) + sqr(y);}
    DB length(){return sqrt(length_sqr());}

    DB atan(){
        return atan2(y, x);
    }

    void input(){
        scanf("%lf %lf", &x, &y);
    }
};

bool operator ==(Po a, Po b){return sgn(a.x - b.x) == 0 && sgn(a.y - b.y) == 0;}
bool operator !=(Po a, Po b){return sgn(a.x - b.x) != 0 || sgn(a.y - b.y) != 0;}
Po operator +(Po a, Po b){return Po(a.x + b.x, a.y + b.y);}
Po operator -(Po a, Po b){return Po(a.x - b.x, a.y - b.y);}
Po operator *(Po a, DB k){return Po(a.x * k, a.y * k);}
Po operator *(DB k, Po a){return a * k;}
Po operator /(Po a, DB k){return Po(a.x / k, a.y / k);}

struct Line{
    Po a, b;
    Line(Po _a = Po(), Po _b = Po()):a(_a), b(_b){}
    Line(DB x0, DB y0, DB x1, DB y1):a(Po(x0, y0)), b(Po(x1, y1)){}
    Line(Seg);

    friend ostream& operator <<(ostream& out, Line p){return out << p.a << "-" << p.b;}
};

struct Seg{
    Po a, b;
    Seg(Po _a = Po(), Po _b = Po()):a(_a), b(_b){}
    Seg(DB x0, DB y0, DB x1, DB y1):a(Po(x0, y0)), b(Po(x1, y1)){}
    Seg(Line l);

    friend ostream& operator <<(ostream& out, Seg p){return out << p.a << "-" << p.b;}
    DB length(){return (b - a).length();}
};

Line::Line(Seg l):a(l.a), b(l.b){}
Seg::Seg(Line l):a(l.a), b(l.b){}

#define innerProduct dot
#define scalarProduct dot
#define dotProduct dot
#define outerProduct det
#define crossProduct det

inline DB dot(DB x1, DB y1, DB x2, DB y2){return x1 * x2 + y1 * y2;}
inline DB dot(Po a, Po b){return dot(a.x, a.y, b.x, b.y);}
inline DB dot(Po p0, Po p1, Po p2){return dot(p1 - p0, p2 - p0);}
inline DB dot(Line l1, Line l2){return dot(l1.b - l1.a, l2.b - l2.a);}
inline DB det(DB x1, DB y1, DB x2, DB y2){return x1 * y2 - x2 * y1;}
inline DB det(Po a, Po b){return det(a.x, a.y, b.x, b.y);}
inline DB det(Po p0, Po p1, Po p2){return det(p1 - p0, p2 - p0);}
inline DB det(Line l1, Line l2){return det(l1.b - l1.a, l2.b - l2.a);}

template<class T1, class T2> inline DB dist(T1 x, T2 y){return sqrt(dist_sqr(x, y));}

inline DB dist_sqr(Po a, Po b){return sqr(a.x - b.x) + sqr(a.y - b.y);}
inline DB dist_sqr(Po p, Line l){Po v0 = l.b - l.a, v1 = p - l.a; return sqr(fabs(det(v0, v1))) / v0.length_sqr();}
inline DB dist_sqr(Po p, Seg l){
    Po v0 = l.b - l.a, v1 = p - l.a, v2 = p - l.b;
    if (sgn(dot(v0, v1)) * sgn(dot(v0, v2)) <= 0) return dist_sqr(p, Line(l));
    else return min(v1.length_sqr(), v2.length_sqr());
}

inline DB dist_sqr(Line l, Po p){return dist_sqr(p, l);}
inline DB dist_sqr(Seg l, Po p){return dist_sqr(p, l);}

inline DB dist_sqr(Line l1, Line l2){
    if (sgn(det(l1, l2)) != 0) return 0;
    return dist_sqr(l1.a, l2);
}
inline DB dist_sqr(Line l1, Seg l2){
    Po v0 = l1.b - l1.a, v1 = l2.a - l1.a, v2 = l2.b - l1.a; DB c1 = det(v0, v1), c2 = det(v0, v2);
    return sgn(c1) != sgn(c2) ? 0 : sqr(min(fabs(c1), fabs(c2))) / v0.length_sqr();
}

bool isIntersect(Seg l1, Seg l2){

    //if (l1.a == l2.a || l1.a == l2.b || l1.b == l2.a || l1.b == l2.b) return true;

    return
        min(l1.a.x, l1.b.x) <= max(l2.a.x, l2.b.x) &&
        min(l2.a.x, l2.b.x) <= max(l1.a.x, l1.b.x) &&
        min(l1.a.y, l1.b.y) <= max(l2.a.y, l2.b.y) &&
        min(l2.a.y, l2.b.y) <= max(l1.a.y, l1.b.y) &&
    sgn( det(l1.a, l2.a, l2.b) ) * sgn( det(l1.b, l2.a, l2.b) ) <= 0 &&
    sgn( det(l2.a, l1.a, l1.b) ) * sgn( det(l2.b, l1.a, l1.b) ) <= 0;

}

inline DB dist_sqr(Seg l1, Seg l2){
    if (isIntersect(l1, l2)) return 0;
    else return min(dist_sqr(l1.a, l2), dist_sqr(l1.b, l2), dist_sqr(l2.a, l1), dist_sqr(l2.b, l1));
}

inline bool isOnExtremePoint(const Po &p, const Seg &l){
    return p == l.a || p == l.b;
}

inline bool isOnseg(const Po &p, const Seg &l){

    //if (p == l.a || p == l.b) return false;

    return sgn(det(p, l.a, l.b)) == 0 &&
        sgn(l.a.x, p.x) * sgn(l.b.x, p.x) <= 0 && sgn(l.a.y, p.y) * sgn(l.b.y, p.y) <= 0;
}

inline Po intersect(const Line &l1, const Line &l2){
    return l1.a + (l1.b - l1.a) * (det(l2.a, l1.a, l2.b) / det(l2, l1));
}

// perpendicular foot
inline Po intersect(const Po & p, const Line &l){
    return intersect(Line(p, p + Po(l.a.y - l.b.y, l.b.x - l.a.x)), l);
}

inline Po rotate(Po p, DB alpha, Po o = Po()){
    p.x -= o.x, p.y -= o .y;
    return Po(p.x * cos(alpha) - p.y * sin(alpha), p.y * cos(alpha) + p.x * sin(alpha)) + o;
}

// <<= ' A. Random Event ..

inline int rand32(){return (bool(rand() & 1) << 30) | (rand() << 15) + rand();}
inline int random32(int l, int r){return rand32() % (r - l + 1) + l;}
inline int random(int l, int r){return rand() % (r - l + 1) + l;}
int dice(){return rand() % 6;}
bool coin(){return rand() % 2;}

// <<= ' 0. I/O Accelerator interface .,

template<class T> inline void RD(T &x){
    //cin >> x;
    //scanf("%d", &x);
    char c; for (c = getchar(); c < '0'; c = getchar()); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';
    //char c; c = getchar(); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';
}

template<class T> inline void OT(const T &p){
    printf("%d ", p);
}

/* .................................................................................................................................. */

const int N = 100009, M = 2 * N;

int l[N], r[N], p[N], w0[N], w1[N], delay[N]; bool rt[N];
// Link-cut tree
int hd[N], nxt[M], a[M], b[M], h[N];
// Adjacent list

int n, ans;

#define lx l[x]
#define rx r[x]

// private:

inline void Inc(int x, int d){
    if (x == 0) return;
    w0[x] += d, w1[x] += d, delay[x] += d;
}

inline void Release(int x){
    if (x == 0) return;

    if (delay[x]){
        Inc(lx, delay[x]), Inc(rx, delay[x]);
        delay[x] = 0;
    }
}

inline void Update(int x){
    w1[x] = w0[x] + w1[lx] + w1[rx];
}

inline void Set(int l[], int y, int x){
    l[y] = x, p[x] = y;
}

#define z p[y]
inline void Rotate(int x){
    int y = p[x];

    if (!rt[y]) Release(z), Set(y == l[z] ? l : r, z, x);
    else p[x] = z;

    Release(y), Release(x);

    if (x == l[y]) Set(l, y, rx), Set(r, x, y);
    else Set(r, y, lx), Set(l, x, y);

    if (rt[y]) rt[y] = false, rt[x] = true;
    Update(y);
}

inline void Splay(int x){
    while (!rt[x]) Rotate(x);
}

inline int Access(int x){
    int y = 0; do{
        Splay(x), Release(x);
        rt[rx] = true, rt[rx = y] = false, Update(x);
        x = p[y = x];
    } while (x);
    return y;
}

// public:

int Query(int x){
    Access(x); Splay(x); OT(w0[x] + delay[x]);
}

void Modify(int x, int y, int w){
    Access(y); y = 0; do{
        Splay(x), Release(x); if (!p[x]) Inc(rx, w), Inc(y, w);
        rt[rx] = true, rt[rx = y] = false, Update(x);
        x = p[y = x];
    } while (x);
}

#define v b[i]
inline void dfs(int u = 1){
    for(int i=hd[u];i;i=nxt[i]) if (!p[v]){
        p[v] = u, dfs(h[i>>1] = v);
    }
}

int main(){

#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
#endif

    FOR_C(i, 2, _RD(n) << 1){
        RD(a[i], b[i]), a[i|1] = b[i], b[i|1] = a[i];
        nxt[i] = hd[a[i]], hd[a[i]] = i; ++i;
        nxt[i] = hd[a[i]], hd[a[i]] = i;
    }

    FLC(rt, true), p[1] = -1, dfs(), p[1] = 0;

    int x, y; DO_C(RD()){
        RD(x, y); Modify(x, y, 1);
    }

    FOR(i, 1, n) Query(h[i]);
}


#define LOCAL

/** ` Micro Mezzo Macro Flation -- Overheated Economy ., **/

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>

using namespace std;

#define REP(i, n) for (int i=0;i<int(n);++i)
#define FOR(i, a, b) for (int i=int(a);i<int(b);++i)
#define DWN(i, b, a) for (int i=int(b-1);i>=int(a);--i)
#define REP_1(i, n) for (int i=1;i<=int(n);++i)
#define FOR_1(i, a, b) for (int i=int(a);i<=int(b);++i)
#define DWN_1(i, b, a) for (int i=int(b);i>=int(a);--i)
#define REP_C(i, n) for (int n____=int(n),i=0;i<n____;++i)
#define FOR_C(i, a, b) for (int b____=int(b),i=a;i<b____;++i)
#define DWN_C(i, b, a) for (int a____=int(a),i=b-1;i>=a____;--i)
#define REP_N(i, n) for (i=0;i<int(n);++i)
#define FOR_N(i, a, b) for (i=int(a);i<int(b);++i)
#define DWN_N(i, b, a) for (i=int(b-1);i>=int(a);--i)
#define REP_1_C(i, n) for (int n____=int(n),i=1;i<=n____;++i)
#define FOR_1_C(i, a, b) for (int b____=int(b),i=a;i<=b____;++i)
#define DWN_1_C(i, b, a) for (int a____=int(a),i=b;i>=a____;--i)
#define REP_1_N(i, n) for (i=1;i<=int(n);++i)
#define FOR_1_N(i, a, b) for (i=int(a);i<=int(b);++i)
#define DWN_1_N(i, b, a) for (i=int(b);i>=int(a);--i)
#define REP_C_N(i, n) for (n____=int(n),i=0;i<n____;++i)
#define FOR_C_N(i, a, b) for (b____=int(b),i=a;i<b____;++i)
#define DWN_C_N(i, b, a) for (a____=int(a),i=b-1;i>=a____;--i)
#define REP_1_C_N(i, n) for (n____=int(n),i=1;i<=n____;++i)
#define FOR_1_C_N(i, a, b) for (b____=int(b),i=a;i<=b____;++i)
#define DWN_1_C_N(i, b, a) for (a____=int(a),i=b;i>=a____;--i)

#define ECH(it, A) for (typeof(A.begin()) it=A.begin(); it != A.end(); ++it)
#define DO(n) while(n--)
#define DO_C(n) int n____ = n; while(n____--)
#define TO(i, a, b) int s_=a<b?1:-1,b_=b+s_;for(int i=a;i!=b_;i+=s_)
#define TO_1(i, a, b) int s_=a<b?1:-1,b_=b;for(int i=a;i!=b_;i+=s_)
#define SQZ(i, j, a, b) for (int i=int(a),j=int(b)-1;i<j;++i,--j)
#define SQZ_1(i, j, a, b) for (int i=int(a),j=int(b);i<=j;++i,--j)
#define REP_2(i, j, n, m) REP(i, n) REP(j, m)
#define REP_2_1(i, j, n, m) REP_1(i, n) REP_1(j, m)

#define ALL(A) A.begin(), A.end()
#define LLA(A) A.rbegin(), A.rend()
#define CPY(A, B) memcpy(A, B, sizeof(A))
#define INS(A, P, B) A.insert(A.begin() + P, B)
#define ERS(A, P) A.erase(A.begin() + P)
#define BSC(A, X) find(ALL(A), X) // != A.end()
#define CTN(T, x) (T.find(x) != T.end())
#define SZ(A) int(A.size())
#define PB push_back
#define MP(A, B) make_pair(A, B)

#define Rush int T____; RD(T____); DO(T____)
#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#define Ruby system("ruby main.rb")
#define Haskell system("runghc main.hs")
#define Pascal system("fpc main.pas")

typedef long long LL;
typedef double DB;
typedef unsigned UINT;
typedef unsigned long long ULL;

typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<string> VS;
typedef vector<LL> VL;
typedef vector<DB> VD;
typedef set<int> SI;
typedef set<string> SS;
typedef set<LL> SL;
typedef set<DB> SD;
typedef map<int, int> MII;
typedef map<string, int> MSI;
typedef map<LL, int> MLI;
typedef map<DB, int> MDI;
typedef map<int, bool> MIB;
typedef map<string, bool> MSB;
typedef map<LL, bool> MLB;
typedef map<DB, bool> MDB;
typedef pair<int, int> PII;
typedef pair<int, bool> PIB;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef vector<VII> VVII;
typedef set<PII> SII;
typedef map<PII, int> MPIII;
typedef map<PII, bool> MPIIB;

/** I/O Accelerator **/

/* ... :" We are I/O Accelerator ... Use us at your own risk ;) ... " .. */

template<class T> inline void RD(T &);
template<class T> inline void OT(const T &);

inline int RD(){ int x; RD(x); return x;}
template<class T> inline T& _RD(T &x){ RD(x); return x;}
inline void RC(char &c){scanf(" %c", &c);}
inline void RS(char *s){scanf("%s", s);}

template<class T0, class T1> inline void RD(T0 &x0, T1 &x1){RD(x0), RD(x1);}
template<class T0, class T1, class T2> inline void RD(T0 &x0, T1 &x1, T2 &x2){RD(x0), RD(x1), RD(x2);}
template<class T0, class T1, class T2, class T3> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3){RD(x0), RD(x1), RD(x2), RD(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5), RD(x6);}
template<class T0, class T1> inline void OT(T0 &x0, T1 &x1){OT(x0), OT(x1);}
template<class T0, class T1, class T2> inline void OT(T0 &x0, T1 &x1, T2 &x2){OT(x0), OT(x1), OT(x2);}
template<class T0, class T1, class T2, class T3> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3){OT(x0), OT(x1), OT(x2), OT(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5), OT(x6);}

template<class T> inline void RST(T &A){memset(A, 0, sizeof(A));}
template<class T0, class T1> inline void RST(T0 &A0, T1 &A1){RST(A0), RST(A1);}
template<class T0, class T1, class T2> inline void RST(T0 &A0, T1 &A1, T2 &A2){RST(A0), RST(A1), RST(A2);}
template<class T0, class T1, class T2, class T3> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3){RST(A0), RST(A1), RST(A2), RST(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5), RST(A6);}

template<class T> inline void CLR(priority_queue<T, vector<T>, less<T> > &Q){
    while (!Q.empty()) Q.pop();
}

template<class T> inline void CLR(priority_queue<T, vector<T>, greater<T> > &Q){
    while (!Q.empty()) Q.pop();
}

template<class T> inline void CLR(T &A){A.clear();}
template<class T0, class T1> inline void CLR(T0 &A0, T1 &A1){CLR(A0), CLR(A1);}
template<class T0, class T1, class T2> inline void CLR(T0 &A0, T1 &A1, T2 &A2){CLR(A0), CLR(A1), CLR(A2);}
template<class T0, class T1, class T2, class T3> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3){CLR(A0), CLR(A1), CLR(A2), CLR(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5), CLR(A6);}
template<class T> inline void CLR(T &A, int n){REP(i, n) CLR(A[i]);}
template<class T> inline void FLC(T &A, int x){memset(A, x, sizeof(A));}
template<class T0, class T1> inline void FLC(T0 &A0, T1 &A1, int x){FLC(A0, x), FLC(A1, x);}
template<class T0, class T1, class T2> inline void FLC(T0 &A0, T1 &A1, T2 &A2){FLC(A0), FLC(A1), FLC(A2);}
template<class T0, class T1, class T2, class T3> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3){FLC(A0), FLC(A1), FLC(A2), FLC(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5), FLC(A6);}

template<class T> inline void SRT(T &A){sort(ALL(A));}
template<class T, class C> inline void SRT(T &A, C B){sort(ALL(A), B);}

/** Add - On **/

const int MOD = 1000000007;
const int INF = 10009;
const DB EPS = 1e-2;
const DB OO = 1e15;
const DB PI = 3.14159265358979323846264; //M_PI;

// <<= ` 0. Daily Use .,

template<class T> inline void checkMin(T &a,const T b){if (b<a) a=b;}
template<class T> inline void checkMax(T &a,const T b){if (b>a) a=b;}
template <class T, class C> inline void checkMin(T& a, const T b, C c){if (c(b,a)) a = b;}
template <class T, class C> inline void checkMax(T& a, const T b, C c){if (c(a,b)) a = b;}
template<class T> inline T min(T a, T b, T c){return min(min(a, b), c);}
template<class T> inline T max(T a, T b, T c){return max(max(a, b), c);}
template<class T> inline T min(T a, T b, T c, T d){return min(min(a, b), min(c, d));}
template<class T> inline T max(T a, T b, T c, T d){return max(min(a, b), max(c, d));}
template<class T> inline T sqr(T a){return a*a;}
template<class T> inline T cub(T a){return a*a*a;}
int Ceil(int x, int y){return (x - 1) / y + 1;}

// <<= ` 1. Bitwise Operation .,
inline bool _1(int x, int i){return x & 1<<i;}
inline bool _1(LL x, int i){return x & 1LL<<i;}
inline LL _1(int i){return 1LL<<i;}
//inline int _1(int i){return 1<<i;}
inline LL _U(int i){return _1(i) - 1;};
//inline int _U(int i){return _1(i) - 1;};

inline int count_bits(int x){
    x = (x & 0x55555555) + ((x & 0xaaaaaaaa) >> 1);
    x = (x & 0x33333333) + ((x & 0xcccccccc) >> 2);
    x = (x & 0x0f0f0f0f) + ((x & 0xf0f0f0f0) >> 4);
    x = (x & 0x00ff00ff) + ((x & 0xff00ff00) >> 8);
    x = (x & 0x0000ffff) + ((x & 0xffff0000) >> 16);
    return x;
}

inline int count_bits(LL x){
    x = (x & 0x5555555555555555LL) + ((x & 0xaaaaaaaaaaaaaaaaLL) >> 1);
    x = (x & 0x3333333333333333LL) + ((x & 0xccccccccccccccccLL) >> 2);
    x = (x & 0x0f0f0f0f0f0f0f0fLL) + ((x & 0xf0f0f0f0f0f0f0f0LL) >> 4);
    x = (x & 0x00ff00ff00ff00ffLL) + ((x & 0xff00ff00ff00ff00LL) >> 8);
    x = (x & 0x0000ffff0000ffffLL) + ((x & 0xffff0000ffff0000LL) >> 16);
    x = (x & 0x00000000ffffffffLL) + ((x & 0xffffffff00000000LL) >> 32);
    return x;
}

int reverse_bits(int x){
    x = ((x >> 1) & 0x55555555) | ((x << 1) & 0xaaaaaaaa);
    x = ((x >> 2) & 0x33333333) | ((x << 2) & 0xcccccccc);
    x = ((x >> 4) & 0x0f0f0f0f) | ((x << 4) & 0xf0f0f0f0);
    x = ((x >> 8) & 0x00ff00ff) | ((x << 8) & 0xff00ff00);
    x = ((x >> 16) & 0x0000ffff) | ((x << 16) & 0xffff0000);
    return x;
}

// <<= ` 2. Modular Arithmetic Basic .,

inline void INC(int &a, int b){a += b; if (a >= MOD) a -= MOD;}
inline int sum(int a, int b){a += b; if (a >= MOD) a -= MOD; return a;}
inline void DEC(int &a, int b){a -= b; if (a < 0) a += MOD;}
inline int dff(int a, int b){a -= b; if (a < 0) a  += MOD; return a;}
inline void MUL(int &a, int b){a = (LL)a * b % MOD;}
inline int pdt(int a, int b){return (LL)a * b % MOD;}

inline int pow(int a, int b){
    int c = 1;
    while (b) {
        if (b&1) MUL(c, a);
        MUL(a, a), b >>= 1;
    }
    return c;
}

template<class T>
inline int pow(T a, int b){
    T c(1);
    while (b) {
        if (b&1) MUL(c, a);
        MUL(a, a), b >>= 1;
    }
    return c;
}

inline int _I(int b){
    int a = MOD, x1 = 0, x2 = 1, q;
    while (true){
        q = a / b, a %= b;
        if (!a) return (x2 + MOD) % MOD;
        DEC(x1, pdt(q, x2));

        q = b / a, b %= a;
        if (!b) return (x1 + MOD) % MOD;
        DEC(x2, pdt(q, x1));
    }
}

inline void DIV(int &a, int b){MUL(a, _I(b));}
inline int qtt(int a, int b){return pdt(a, _I(b));}

inline int sum(int a, int b, int MOD){
    a += b; if (a >= MOD) a -= MOD;
    return a;
}

inline int phi(int n){
    int res = n;
    for (int i=2;sqr(i)<=n;++i) if (!(n%i)){
        DEC(res, qtt(res, i));
        do{n /= i;} while(!(n%i));
    }
    if (n != 1)
        DEC(res, qtt(res, n));
    return res;
}

// <<= '9. Comutational Geometry .,

struct Po; struct Line; struct Seg;

inline int sgn(DB x){return x < -EPS ? -1 : x > EPS;}
inline int sgn(DB x, DB y){return sgn(x - y);}

struct Po{
    DB x, y;
    Po(DB _x = 0, DB _y = 0):x(_x), y(_y){}

    friend istream& operator >>(istream& in, Po &p){return in >> p.x >> p.y;}
    friend ostream& operator <<(ostream& out, Po p){return out << "(" << p.x << ", " << p.y << ")";}

    friend bool operator ==(Po, Po);
    friend bool operator !=(Po, Po);
    friend Po operator +(Po, Po);
    friend Po operator -(Po, Po);
    friend Po operator *(Po, DB);
    friend Po operator /(Po, DB);

    bool operator < (const Po &rhs) const{return sgn(x, rhs.x) < 0 || sgn(x, rhs.x) == 0 && sgn(y, rhs.y) < 0;}
    Po operator-() const{return Po(-x, -y);}
    Po& operator +=(Po rhs){x += rhs.x, y += rhs.y; return *this;}
    Po& operator -=(Po rhs){x -= rhs.x, y -= rhs.y; return *this;}
    Po& operator *=(DB k){x *= k, y *= k; return *this;}
    Po& operator /=(DB k){x /= k, y /= k; return *this;}

    DB length_sqr(){return sqr(x) + sqr(y);}
    DB length(){return sqrt(length_sqr());}

    DB atan(){
        return atan2(y, x);
    }

    void input(){
        scanf("%lf %lf", &x, &y);
    }
};

bool operator ==(Po a, Po b){return sgn(a.x - b.x) == 0 && sgn(a.y - b.y) == 0;}
bool operator !=(Po a, Po b){return sgn(a.x - b.x) != 0 || sgn(a.y - b.y) != 0;}
Po operator +(Po a, Po b){return Po(a.x + b.x, a.y + b.y);}
Po operator -(Po a, Po b){return Po(a.x - b.x, a.y - b.y);}
Po operator *(Po a, DB k){return Po(a.x * k, a.y * k);}
Po operator *(DB k, Po a){return a * k;}
Po operator /(Po a, DB k){return Po(a.x / k, a.y / k);}

struct Line{
    Po a, b;
    Line(Po _a = Po(), Po _b = Po()):a(_a), b(_b){}
    Line(DB x0, DB y0, DB x1, DB y1):a(Po(x0, y0)), b(Po(x1, y1)){}
    Line(Seg);

    friend ostream& operator <<(ostream& out, Line p){return out << p.a << "-" << p.b;}
};

struct Seg{
    Po a, b;
    Seg(Po _a = Po(), Po _b = Po()):a(_a), b(_b){}
    Seg(DB x0, DB y0, DB x1, DB y1):a(Po(x0, y0)), b(Po(x1, y1)){}
    Seg(Line l);

    friend ostream& operator <<(ostream& out, Seg p){return out << p.a << "-" << p.b;}
    DB length(){return (b - a).length();}
};

Line::Line(Seg l):a(l.a), b(l.b){}
Seg::Seg(Line l):a(l.a), b(l.b){}

#define innerProduct dot
#define scalarProduct dot
#define dotProduct dot
#define outerProduct det
#define crossProduct det

inline DB dot(DB x1, DB y1, DB x2, DB y2){return x1 * x2 + y1 * y2;}
inline DB dot(Po a, Po b){return dot(a.x, a.y, b.x, b.y);}
inline DB dot(Po p0, Po p1, Po p2){return dot(p1 - p0, p2 - p0);}
inline DB dot(Line l1, Line l2){return dot(l1.b - l1.a, l2.b - l2.a);}
inline DB det(DB x1, DB y1, DB x2, DB y2){return x1 * y2 - x2 * y1;}
inline DB det(Po a, Po b){return det(a.x, a.y, b.x, b.y);}
inline DB det(Po p0, Po p1, Po p2){return det(p1 - p0, p2 - p0);}
inline DB det(Line l1, Line l2){return det(l1.b - l1.a, l2.b - l2.a);}

template<class T1, class T2> inline DB dist(T1 x, T2 y){return sqrt(dist_sqr(x, y));}

inline DB dist_sqr(Po a, Po b){return sqr(a.x - b.x) + sqr(a.y - b.y);}
inline DB dist_sqr(Po p, Line l){Po v0 = l.b - l.a, v1 = p - l.a; return sqr(fabs(det(v0, v1))) / v0.length_sqr();}
inline DB dist_sqr(Po p, Seg l){
    Po v0 = l.b - l.a, v1 = p - l.a, v2 = p - l.b;
    if (sgn(dot(v0, v1)) * sgn(dot(v0, v2)) <= 0) return dist_sqr(p, Line(l));
    else return min(v1.length_sqr(), v2.length_sqr());
}

inline DB dist_sqr(Line l, Po p){return dist_sqr(p, l);}
inline DB dist_sqr(Seg l, Po p){return dist_sqr(p, l);}

inline DB dist_sqr(Line l1, Line l2){
    if (sgn(det(l1, l2)) != 0) return 0;
    return dist_sqr(l1.a, l2);
}
inline DB dist_sqr(Line l1, Seg l2){
    Po v0 = l1.b - l1.a, v1 = l2.a - l1.a, v2 = l2.b - l1.a; DB c1 = det(v0, v1), c2 = det(v0, v2);
    return sgn(c1) != sgn(c2) ? 0 : sqr(min(fabs(c1), fabs(c2))) / v0.length_sqr();
}

bool isIntersect(Seg l1, Seg l2){

    //if (l1.a == l2.a || l1.a == l2.b || l1.b == l2.a || l1.b == l2.b) return true;

    return
        min(l1.a.x, l1.b.x) <= max(l2.a.x, l2.b.x) &&
        min(l2.a.x, l2.b.x) <= max(l1.a.x, l1.b.x) &&
        min(l1.a.y, l1.b.y) <= max(l2.a.y, l2.b.y) &&
        min(l2.a.y, l2.b.y) <= max(l1.a.y, l1.b.y) &&
    sgn( det(l1.a, l2.a, l2.b) ) * sgn( det(l1.b, l2.a, l2.b) ) <= 0 &&
    sgn( det(l2.a, l1.a, l1.b) ) * sgn( det(l2.b, l1.a, l1.b) ) <= 0;

}

inline DB dist_sqr(Seg l1, Seg l2){
    if (isIntersect(l1, l2)) return 0;
    else return min(dist_sqr(l1.a, l2), dist_sqr(l1.b, l2), dist_sqr(l2.a, l1), dist_sqr(l2.b, l1));
}

inline bool isOnExtremePoint(const Po &p, const Seg &l){
    return p == l.a || p == l.b;
}

inline bool isOnseg(const Po &p, const Seg &l){

    //if (p == l.a || p == l.b) return false;

    return sgn(det(p, l.a, l.b)) == 0 &&
        sgn(l.a.x, p.x) * sgn(l.b.x, p.x) <= 0 && sgn(l.a.y, p.y) * sgn(l.b.y, p.y) <= 0;
}

inline Po intersect(const Line &l1, const Line &l2){
    return l1.a + (l1.b - l1.a) * (det(l2.a, l1.a, l2.b) / det(l2, l1));
}

// perpendicular foot
inline Po intersect(const Po & p, const Line &l){
    return intersect(Line(p, p + Po(l.a.y - l.b.y, l.b.x - l.a.x)), l);
}

inline Po rotate(Po p, DB alpha, Po o = Po()){
    p.x -= o.x, p.y -= o .y;
    return Po(p.x * cos(alpha) - p.y * sin(alpha), p.y * cos(alpha) + p.x * sin(alpha)) + o;
}

// <<= ' A. Random Event ..

inline int rand32(){return (bool(rand() & 1) << 30) | (rand() << 15) + rand();}
inline int random32(int l, int r){return rand32() % (r - l + 1) + l;}
inline int random(int l, int r){return rand() % (r - l + 1) + l;}
int dice(){return rand() % 6;}
bool coin(){return rand() % 2;}

// <<= ' 0. I/O Accelerator interface .,

template<class T> inline void RD(T &x){
    //cin >> x;
    //scanf("%d", &x);
    char c; for (c = getchar(); c < '0'; c = getchar()); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';
    //char c; c = getchar(); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';
}

template<class T> inline void OT(const T &p){
    printf("%d ", p);
}

/* .................................................................................................................................. */

const int N = 100009, M = 2 * N;

int l[N], r[N], p[N], w0[N], w1[N], delay[N]; bool rt[N];
// Link-cut tree
int hd[N], nxt[M], a[M], b[M];
// Adjacent list

int n, ans;

#define lx l[x]
#define rx r[x]

// private:

inline void Inc(int x, int d){
    if (x == 0) return;
    w0[x] += d, w1[x] += d, delay[x] += d;
}

inline void Release(int x){
    if (x == 0) return;

    if (delay[x]){
        Inc(lx, delay[x]), Inc(rx, delay[x]);
        delay[x] = 0;
    }
}

inline void Update(int x){
    w1[x] = w0[x] + w1[lx] + w1[rx];
}

inline void Set(int l[], int y, int x){
    l[y] = x, p[x] = y;
}

#define z p[y]
inline void Rotate(int x){
    int y = p[x];

    if (!rt[y]) Release(z), Set(y == l[z] ? l : r, z, x);
    else p[x] = z;

    Release(y), Release(x);

    if (x == l[y]) Set(l, y, rx), Set(r, x, y);
    else Set(r, y, lx), Set(l, x, y);

    if (rt[y]) rt[y] = false, rt[x] = true;
    Update(y);
}

inline void Splay(int x){
    while (!rt[x]) Rotate(x);
}

inline int Access(int x){
    int y = 0; do{
        Splay(x), Release(x);
        rt[rx] = true, rt[rx = y] = false, Update(x);
        x = p[y = x];
    } while (x);
    return y;
}

// public:

void Query(int x, int y){
    Access(y), y = 0; do{
        Splay(x); Release(x); if (!p[x]) OT(w1[rx] + w1[y]);
        rt[rx] = true, rt[rx = y] = false; Update(x);
        x = p[y = x];

    } while (x);
}

void Modify(int x, int y, int w){
    Access(y); y = 0; do{
        Splay(x), Release(x); if (!p[x]) Inc(rx, w), Inc(y, w);
        rt[rx] = true, rt[rx = y] = false, Update(x);
        x = p[y = x];
    } while (x);
}

#define v b[i]
inline void dfs(int u = 1){
    for(int i=hd[u];i;i=nxt[i]) if (!p[v]){
        p[v] = u, dfs(v);
    }
}

int main(){

#ifdef LOCAL
    //freopen("in01.txt", "r", stdin);
#endif

    FOR_C(i, 2, _RD(n) << 1){
        RD(a[i], b[i]), a[i|1] = b[i], b[i|1] = a[i];
        nxt[i] = hd[a[i]], hd[a[i]] = i; ++i;
        nxt[i] = hd[a[i]], hd[a[i]] = i;
    }

    FLC(rt, true), p[1] = -1, dfs(), p[1] = 0;

    int x, y; DO_C(RD()){
        RD(x, y); Modify(x, y, 1);
    }

    FOR(i, 1, n) Query(a[i<<1], b[i<<1]);
}


#include<bits/stdc++.h>

using namespace std;

char s[100001];

unsigned int dp[100001]={1}, ans, x=25;

main() {

#ifndef	ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	int n; scanf("%d %s", &n, s);

	int N=n>>1, alpha_cnt=0;

	for(int i=0; s[i]; i++) if(s[i]!='?') alpha_cnt++;

	if(alpha_cnt>N || n&1) return puts("0");

	for(int i=0; s[i]; i++) if(s[i]=='?') {

		for(int j=i+1>>1; j--; ) dp[j+1]+=dp[j];

	}

	ans=dp[N];

	for(int rest=N-alpha_cnt; rest; rest>>=1, x*=x) if(rest&1) ans*=x;

	printf("%u", ans);

}


#include <bits/stdc++.h>

using namespace std;

typedef unsigned int uint;

#define NN 100010

char s[NN];

uint dp[NN];

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	int n;

	scanf("%d",&n);

	scanf("%s",s+1);

	if(n&1){

		puts("0");

		return 0;

	}

	int cnt=0;

	for(int i=1;i<=n;i++){

		if(s[i]!='?') cnt++;

	}

	cnt=(n-2*cnt)/2;

	if(cnt>n/2){

		puts("0");

		return 0;

	}

	dp[0]=1;

	for(int i=1;i<=n;i++){

		if(s[i]=='?'){

			for(int j=i/2;j>=1;j--) dp[j]+=dp[j-1];

		}

	}

	for(int i=1;i<=cnt;i++) dp[n/2]*=25;

	cout<<dp[n/2]<<endl;

    return 0;

}


#include<bits/stdc++.h>

using namespace std;

#define NN 101010

char s[NN];
unsigned int dp[NN], mul=1, c=25;

int main() {
	int n; scanf("%d %s", &n, s+1);
	if(n&1) return putchar('0'), 0;
	int num=n>>1;

	dp[0]=1;
	for(int i=1; i<=n; i++) {
		if(s[i]=='?') {
			for(int j=i>>1; j; j--) dp[j]+=dp[j-1];
		}
		else num--;
	}
	if(num>=0) {
		for(; num; num>>=1, c*=c) if(num&1) mul*=c;
		printf("%u", dp[n>>1]*mul);
	}
	else putchar('0');
}


#include<bits/stdc++.h>

using namespace std;

char s[100001];

unsigned int dp[100001]={1}, ans, x=25;

main() {

	int n; scanf("%d %s", &n, s);

	int N=n>>1, alpha_cnt;

	for(int i=0; s[i]; i++) if(s[i]!='?') alpha_cnt++;

	if(alpha_cnt>N) return puts("0");

	for(int i=0; s[i]; i++) if(s[i]=='?') {

		for(int j=i+1>>1; j--; ) dp[j+1]+=dp[j];

	}

	ans=dp[N];

	for(int rest=N-alpha_cnt; rest; rest>>=1, x*=x) if(rest&1) ans*=x;

	printf("%u", ans);

}


#include <bits/stdc++.h>

using namespace std;

typedef long long INT;

typedef double DO;

typedef pair<int, int> pii;

typedef vector<int> VI;

typedef unsigned int uint;

const int NN = 101010;

uint dp[NN*2];

char s[NN];

int main() {

#ifndef ONLINE_JUDGE

    freopen("in.in", "r", stdin);

    freopen("out.out", "w", stdout);

#endif

    int n;

    cin>>n;

    scanf("%s", s+1);

    if (n&1) return puts("0");

    int now=NN;

    dp[now]=1;

    for (int i=1; i<=n; i++) {

        if (s[i]=='?') {

            for (int j=now+i-1; j>=now; j--) {

                dp[j+2]+=(dp[j]<<4)+(dp[j]<<3)+dp[j];

            }

            dp[now++]=0;

        } else {

            dp[--now]=0;

        }

    }

    cout << dp[now] << endl;

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

typedef long long INT;

typedef double DO;

typedef pair<int, int> pii;

typedef vector<int> VI;

typedef unsigned int uint;

uint dp[2][101010*2];

int main() {

#ifndef ONLINE_JUDGE

    freopen("in.in", "r", stdin);

    freopen("out.out", "w", stdout);

#endif

    int n;

    string s;

    cin>>n>>s;

    if (n&1) return puts("0");

    int ok=0, pre=1;

    dp[0][0]=1;

    for (int i=0; i<n; i++) {

        ok^=1; pre^=1;

        if (s[i]=='?') {

            dp[ok][0]=dp[pre][1];

            for (int j=1; j<n; j++) {

                const uint &x = dp[pre][j-1];

                dp[ok][j]=(x<<4)+(x<<3)+x+dp[pre][j+1];

            }

        } else {

            dp[ok][0]=0;

            for (int j=1; j<n; j++) dp[ok][j]=dp[pre][j-1];

        }

    }

    cout << dp[ok][0] << endl;

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
using U = unsigned int;
const int N = 1e5+10;
char s[N];
U dp[N];
U power(U a, int b, U ans = 1) {
  for(; b; b>>=1, a*=a) {
    if(b&1) ans*=a;
  }
  return ans;
}
int main() {
#ifdef KIMNAM
  freopen("in.in", "r", stdin);
  freopen("out.out", "w", stdout);
#endif
  int n, m = 0;
  scanf("%d %s", &n, s);
  for(int i=0; i<n; i++) m+=s[i]!='?';
  if(n&1 || m>n/2) {
    puts("0");
    return 0;
  }
  dp[0]=1;
  for(int i=0; i<n; i++) {
    if(s[i] == '?') {
      for(int j=i+1>>1; j--;) {
        dp[j+1]+=dp[j];
      }
    }
  }
  cout<<dp[n/2]*power(25, n/2-m)<<endl;
  return 0;
}


#pragma G++ optimize(2)
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
unsigned int dp[100010];
int s;
int n;
char buf[100010];
int main()
{
	scanf("%d",&n);
	scanf("%s",buf+1);
	if(n&1)
	{
		printf("0");
		return 0;
	}
	dp[0]=1;
	for(int i=1;i<=n;i++)
	{
		if(buf[i]!='?')
		{
			s++;
			continue;
		}
		int mn=max(0,i-n/2),mx=i/2;
		for(int j=mx;j>=mn;j--)if(j)dp[j]+=dp[j-1];
	}
	unsigned int ans=dp[n/2];
	for(int i=1;i<=n/2-s;i++)ans=ans*25;
	cout<<ans;
}


#pragma G++ optimize(2)
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
unsigned int dp[100010];
int s;
int n;
char buf[100010];
int main()
{
	scanf("%d",&n);
	scanf("%s",buf+1);
	if(n&1)
	{
		printf("0");
		return 0;
	}
	dp[0]=1;
	for(int i=1;i<=n;i++)
	{
		if(buf[i]!='?')
		{
			s++;
			continue;
		}
		int mn=max(0,i-n/2),mx=i/2;
		for(int j=mn;j<=mx;j++)if(j)dp[j]+=dp[j-1];
	}
	unsigned int ans=dp[n/2];
	for(int i=1;i<=n/2-s;i++)ans=ans*25;
	cout<<ans;
}


#include <bits/stdc++.h>
using namespace std;

unsigned dp[100010];
char c[100010];

int main()
{
    int n = 1e5;
    scanf("%d%s", &n, c);

    unsigned open = 1, last, act, nr = 0;
    dp[1] = 1;

    for (int i = 0; i < n; i++) {
        open = min(min(open, 1u * n - i), n / 2u);
        if (c[i] == '?') {
            last = 0;
            for (int j = ++open; j >= 1; j--) {
                act = dp[j];
                dp[j] = last + dp[j - 1];
                last = act;
            }
        }
        else
            for (int i = ++open; i >= 1; i--)
                dp[i] = dp[i - 1];
        nr += (c[i] != '?');
    }

    nr = min(n / 2u, n / 2 - nr);
    while (nr--)
        dp[1] *= 25;

    cout << dp[1] << '\n';

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

unsigned dp[100010];
char c[100010];

int main()
{
    int n;
    scanf("%d%s", &n, c);

    unsigned open = 1, last, act, nr = 0;
    dp[1] = 1;

    for (int i = 0; i < n; i++) {
        open = min(open, n / 2u);
        if (c[i] == '?') {
            last = 0;
            for (int j = ++open; j >= 1; j--) {
                act = dp[j];
                dp[j] = last + dp[j - 1];
                last = act;
            }
        }
        else
            for (int i = ++open; i >= 1; i--)
                dp[i] = dp[i - 1];
        nr += (c[i] != '?');
    }

    nr = min(n / 2u, n / 2 - nr);
    while (nr--)
        dp[1] *= 25;

    cout << dp[1] << '\n';

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

unsigned dp[100010];
char c[100010];

int main()
{
    int n;
    scanf("%d%s", &n, c);

    unsigned open = 1, last, act, nr = 0;
    dp[1] = 1;

    for (int i = 0; i < n; i++) {
        if (c[i] == '?') {
            last = 0;
            for (int j = ++open; j >= 1; j--) {
                act = dp[j];
                dp[j] = last + dp[j - 1];
                last = act;
            }
        }
        else
            for (int i = ++open; i >= 1; i--)
                dp[i] = dp[i - 1];
        nr += (c[i] != '?');
    }

    nr = min(n / 2u, n / 2 - nr);
    while (nr--)
        dp[1] *= 25;

    cout << dp[1] << '\n';

    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define maxn 100005
#define ui unsigned int
using namespace std;

ui f[maxn];

int n;

char s[maxn];

int tot[maxn];

int main(){
	scanf("%d",&n);
	if (n % 2==1) {
		puts("0");
		return 0;
	}
	scanf("%s",s+1);
	fd(i,n,1) tot[i]=tot[i+1]+(s[i]=='?');
	f[0]=1;
	fo(i,1,n) {
		int r=min(i,tot[i+1]);
		if (s[i]!='?') {
			if (i % 2==1) {
				for(int j=1;j<=r;j+=2) f[j]=f[j-1];
			}
			else {
				for(int j=2;j<=r;j+=2) f[j]=f[j-1];
			}
			f[0]=0;
		}
		else {
			if (i % 2==0) f[0]=f[1];
			if (i % 2==1) {
				for(int j=1;j<=r;j+=2) f[j]=f[j-1]+f[j+1];
			}
			else {
				for(int j=2;j<=r;j+=2) f[j]=f[j-1]+f[j+1];
				f[0]=f[1];
			}
		}
	}
	ui ans=f[0];
	fo(i,1,tot[1]-n / 2) ans*=25;
	cout<<ans;
	return 0;
}


#include <iostream>
#include <vector>

using namespace std;

typedef unsigned unsgn;

int main()
{
    ios_base::sync_with_stdio(0);
    int n;
    string a;
    cin >> n >> a;
    if (n % 2 == 1)
    {
        cout << "0";
        return 0;
    }
    int pol = n / 2;
    vector< vector<unsgn> > dp(2, vector<unsgn>(n + 1, 0));
    dp[1][1] = 1;
    int kon = 1, akt = 0, start;
    for (int i = 2; i <= n; ++i)
    {
        if (i <= pol)
            ++kon;
        else
            --kon;
        start = ((i & 1) == 1) ? 1 : 0;
        if (a[i - 1] == '?')
        {
            if (start == 0)
            {
                dp[akt][0] = dp[akt ^ 1][1];
                start += 2;
            }
            for (int j = start; j <= kon; j += 2)
                dp[akt][j] = dp[akt ^ 1][j - 1] + dp[akt ^ 1][j + 1];
        }
        else
        {
            if (start == 0)
            {
                dp[akt][0] = 0;
                start += 2;
            }
            for (int j = start; j <= kon; j += 2)
                dp[akt][j] = dp[akt ^ 1][j - 1];
        }
        akt ^= 1;
    }
    int nPuste = 0;
    for (int i = 0; i < n; ++i)
        if (a[i] != '?')
            ++nPuste;
    int mno = (n - 2 * nPuste) / 2;
    unsgn odp = dp[0][0];
    for (int i = 0; i < mno; ++i)
        odp *= 25;
    cout << odp;
    return 0;
}


#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
using namespace std;
unsigned int n,m,i,j,dp[2][100005],cnt;
int num[100005];
string st;
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>st;
	num[0]=1<<25;
	for (i=0;i<st.length();i++)
	{
		if (st[i]!='?')
		{
			if (num[cnt]<=0)
			{
				num[cnt]--;
			}
			else
			{
				cnt++;
				num[cnt]--;
			}
		}
		else
		{
			cnt++;
			num[cnt]=1;
		}
	}
	dp[0][0]=1;
	for (i=1;i<=cnt;i++)
	{
		if (num[i]==0) continue;
		int x=(i&1);
		int y=(!x);
		if (num[i]<0)
		{
			for (j=n;j>=-num[i];j--)
			{
				dp[x][j]=dp[y][j+num[i]];
			}
			for (j=0;j<-num[i];j++) dp[x][j]=0;
		}
		if (num[i]>0)
		{
			for (j=0;j<=n;j++)
			{
				dp[x][j]=0;
				if (j+1<=n) dp[x][j]+=dp[y][j+1];
				if (j<=n) dp[x][j]+=dp[y][j-1]*25;
			}
		}
	}
	cout<<dp[cnt&1][0];
	return 0;
}


#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
using namespace std;
unsigned int n,m,i,j,dp[100005],cnt;
string st;
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>st;
	st=" "+st;
	for (i=1;i<=n;i++)
	{
		if (st[i]=='?') cnt++;
	}
	if (cnt<n/2)
	{
		cout<<0;
		return 0;
	}
	dp[0]=1;
	for (i=1;i<=n;i++)
	{
		unsigned int mi=max(1,(int)(i-n/2)),mx=(i)/2;
		if (st[i]=='?') for (j=mx;j>=mi;j--)
		{
			dp[j]+=dp[j-1];
		}
	}
	for (i=1;i<=cnt-n/2;i++)
	{
		dp[n/2]*=25;
	}
	cout<<dp[n/2];
	return 0;
}


#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
using namespace std;
unsigned int n,m,i,j,dp[100005],cnt;
string st;
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>st;
	if (n&1)
	{
		cout<<0;
		return 0;
	}
	st=" "+st;
	for (i=1;i<=n;i++)
	{
		if (st[i]=='?') cnt++;
	}
	if (cnt<n/2)
	{
		cout<<0;
		return 0;
	}
	dp[0]=1;
	for (i=1;i<=n;i++)
	{
		unsigned int mi=max(1,(int)(i-n/2)),mx=(i)/2;
		if (st[i]=='?') for (j=mx;j>=mi;j--)
		{
			dp[j]+=dp[j-1];
		}
	}
	for (i=1;i<=cnt-n/2;i++)
	{
		dp[n/2]*=25;
	}
	cout<<dp[n/2];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll int
#define N ((ll)101*1000)

ll n,num;
unsigned ll dp[2][N];
string s;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    cin>>n>>s;
    dp[1][0]=1;
    for(int i=0;i<n;i++)
    {
    	bool p=(i&1),q=!p,ex=(s[i]=='?');num+=ex;
    	for(int j=0;j<=n/2;j++)
    		dp[p][j]=(j?dp[q][j-1]:0)+(ex?dp[q][j+1]:0);
	}
	num-=n/2;
	for(int i=0;i<num;i++)dp[!(n&1)][0]*=25;
	cout<<dp[!(n&1)][0];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=(100*1000+10);

int n,num,dp[N/2];
char s[N];

int main()
{
    scanf("%d %s",&n,&s);
    if(n%2){printf("0");return 0;}
    dp[0]=1;
    for(int i=1;i<=n;i++)
    {
    	int ex=min(n/2,i/2);
    	if(s[i-1]=='?')
		{
			num++;
			if((i&1))for(int j=0;j<=ex;j++)dp[j]+=dp[j+1];
			else for(int j=ex;j>0;j--)dp[j]+=dp[j-1];
		}
		else if(!(i&1))
		{
			for(int j=ex;j>0;j--)dp[j]=dp[j-1];
			dp[0]=0;
		}
	}
	num-=n/2;
	for(int i=0;i<num;i++)dp[0]*=25;
	printf("%u",dp[0]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N ((int)101*1000)

int n,num,dp[N];
char s[N];

int main()
{
    scanf("%d %s",&n,&s);
    if(n%2){printf("0");return 0;}
    dp[0]=1;
    for(int i=1;i<=n;i++)
    {
    	int ex=min(n/2,i);
    	if(s[i-1]=='?')
		{
			num++;
			if((i&1))for(int j=0;j<=ex;j++)dp[j]+=dp[j+1];
			else for(int j=ex;j>0;j--)dp[j]+=dp[j-1];
		}
		else if(!(i&1))
		{
			for(int j=ex;j>0;j--)dp[j]=dp[j-1];
			dp[0]=0;
		}
	}
	num-=n/2;
	for(int i=0;i<num;i++)dp[0]*=25;
	printf("%u",dp[0]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N ((int)101*1000)

int n,num;
unsigned int dp[N];
string s;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    cin>>n>>s;s='.'+s;
    if(n%2)return cout<<0,0;
    dp[0]=1;
    for(int i=1;i<=n;i++)
    {
    	int ex=min(n/2,i);
    	if(s[i]=='?')
		{
			num++;
			if((i&1))for(int j=0;j<=ex;j++)dp[j]+=dp[j+1];
			else for(int j=ex;j>0;j--)dp[j]+=dp[j-1];
		}
		else if(!(i&1))
		{
			for(int j=ex;j>0;j--)dp[j]=dp[j-1];
			dp[0]=0;
		}
	}
	num-=n/2;
	for(int i=0;i<num;i++)dp[0]*=25;
	cout<<dp[0];
	return 0;
}


/* --- author: dxm --- */
#include<bits/stdc++.h>
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define fst first
#define snd second
typedef long long ll;
typedef unsigned int uint;
inline void Fail(){printf("0");exit(0);}

const int maxn=100005;
int n;
char c[maxn];
uint dp[2][maxn];

int main(){
	scanf("%d%s",&n,c);
	int z=0;
	rep(i,n){
		memset(dp[z],0,sizeof(dp[z]));
		rep(j,i+2){
			if(c[i]=='?'){
				if(!i)dp[z][j]=j==1?25:0;
				else dp[z][j]=(j>=1?dp[z^1][j-1]*25:0)+dp[z^1][j+1];
			}
			else{
				if(!i)dp[z][j]=j==1;
				else dp[z][j]=j>=1?dp[z^1][j-1]:0;
			}
//			cout<<i<<" "<<j<<" "<<dp[z][j]<<endl;
		}
		z^=1;
	}
	ll ans=dp[z^1][0];
	if(ans<0)ans+=(1LL<<32);
	printf("%I64d",ans);
	return 0;
}

/*
Input:
-----------------
Output:
*/


/* --- author: dxm --- */
#include<bits/stdc++.h>
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define fst first
#define snd second
typedef long long ll;
typedef unsigned int uint;
inline void Fail(){printf("0");exit(0);}

const int maxn=100005;
int n,q;
char c[maxn];
uint dp[maxn];

int main(){
	scanf("%d%s",&n,c);
	rep(i,n)if(c[i]=='?')q++;
	if(n&1||q*2<n){
		printf("0");
		return 0;
	}
	dp[0]=1;
	rep(i,n){
		int l=i+1-n/2,r=(i+1)/2;
		if(c[i]=='?')for(int j=r;j>=l&&j>=1;j--)dp[j]+=dp[j-1];
	}
	uint ans=dp[n/2];
	rep(i,q-n/2)ans*=25;
	printf("%I64d",(ll)ans);
	return 0;
}

/*
Input:
-----------------
Output:
*/


/* --- author: dxm --- */
#include<bits/stdc++.h>
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define fst first
#define snd second
typedef long long ll;
typedef unsigned int uint;
inline void Fail(){printf("0");exit(0);}

const int maxn=100005;
int n,q;
char c[maxn];
uint dp[maxn];

int main(){
	scanf("%d%s",&n,c);
	rep(i,n)if(c[i]=='?')q++;
	if(q*2<n){
		printf("0");
		return 0;
	}
	dp[0]=1;
	rep(i,n){
		int l=i+1-n/2,r=(i+1)/2;
		if(c[i]=='?')for(int j=r;j>=l&&j>=1;j--)dp[j]+=dp[j-1];
	}
	uint ans=dp[n/2];
	rep(i,q-n/2)ans*=25;
	printf("%I64d",(ll)ans);
	return 0;
}

/*
Input:
-----------------
Output:
*/


/* --- author: dxm --- */
#include<bits/stdc++.h>
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define fst first
#define snd second
typedef long long ll;
typedef unsigned int uint;
inline void Fail(){printf("0");exit(0);}

const int maxn=100005;
int n;
char c[maxn];
uint dp[2][maxn];

int main(){
	scanf("%d%s",&n,c);
	int z=0;
	rep(i,n){
		memset(dp[z],0,sizeof(dp[z]));
		rep(j,i+2){
			if(c[i]=='?'){
				if(!i)dp[z][j]=j==1;
				else dp[z][j]=(j>=1?dp[z^1][j-1]*25:0)+dp[z^1][j+1];
			}
			else{
				if(!i)dp[z][j]=j==1;
				else dp[z][j]=j>=1?dp[z^1][j-1]:0;
			}
//			cout<<i<<" "<<j<<" "<<dp[z][j]<<endl;
		}
		z^=1;
	}
	ll ans=dp[z^1][0];
	if(ans<0)ans+=(1LL<<32);
	printf("%I64d",ans);
	return 0;
}

/*
Input:
-----------------
Output:
*/


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

typedef unsigned u32;

const int MaxN = 100005;

int n;
char s[MaxN];

u32 f_pool[MaxN], *f = f_pool;
u32 g_pool[MaxN], *g = g_pool;

inline u32 solve()
{
	if (n & 1)
		return 0;

	f[0] = 1;
	for (int i = 1; i <= n; ++i)
	{
		swap(f, g);

		int up = min(i, n - i);
		if (s[i] != '?')
		{
			f[0] = 0;
			for (int j = 1; j <= up; ++j)
				f[j] = g[j - 1];
		}
		else
		{
			f[0] = g[1];
			for (int j = 1; j <= up; ++j)
				f[j] = g[j + 1] + g[j - 1] * 25u;
		}
	}

	return f[0];
}

int main()
{
	scanf("%d", &n);
	fread(s, 1, n + 1, stdin);

	printf("%u\n", n & 1 ? 0 : solve());

	return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

typedef unsigned u32;

const int MaxN = 100005;

int n;
char s[MaxN];

u32 f_pool[MaxN], *f = f_pool;
u32 g_pool[MaxN], *g = g_pool;

inline u32 solve()
{
	if (n & 1)
		return 0;

	f[0] = 1;
	for (int i = 1; i <= n; ++i)
	{
		swap(f, g);

		int up = min(i, n - i);
		if (s[i] != '?')
		{
			f[0] = 0;
			for (int j = 1; j <= up; ++j)
				f[j] = g[j - 1];
		}
		else
		{
			f[0] = g[1];
			for (int j = 1; j <= up; ++j)
				f[j] = g[j + 1] + g[j - 1] * 25u;
		}
	}

	return f[0];
}

int main()
{
	scanf("%d", &n);
	scanf("%s", s + 1);

	printf("%u\n", n & 1 ? 0 : solve());

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
unsigned int dp[100005];
int n,nn;
char a[100005];
int main()
{
	scanf("%d%s",&n,a);
	nn=0;for(int i=0;i<n;i++)if(a[i]=='?')++nn;
	if(n%2==1||2*nn<n){puts("0");return 0;}
	memset(dp,0,sizeof(dp));dp[0]=1;
	for(int i=0;i<n;++i)if(a[i]=='?')for(int j=(i+1)/2;j>=1;j-=4)
	{
		dp[j]+=dp[j-1];
		dp[j-1]+=dp[j-2];
		dp[j-2]+=dp[j-3];
		dp[j-3]+=dp[j-4];
	}
	unsigned int res=dp[n/2];
	for(int i=1;i<=nn-n/2;i++)res*=25;
	printf("%u\n",res);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
unsigned int dp[100005];
int n,nn;
char a[100005];
int main()
{
	scanf("%d%s",&n,a);
	nn=0;for(int i=0;i<n;i++)if(a[i]=='?')++nn;
	if(n%2==1||2*nn<n){puts("0");return 0;}
	memset(dp,0,sizeof(dp));dp[0]=1;
	for(int i=0;i<n;++i)
	{
		if(a[i]=='?')
		{
			for(int j=(i+1)/2;j>=1;--j)dp[j]+=dp[j-1];
		}
	}
	unsigned int res=dp[n/2];
	for(int i=1;i<=nn-n/2;i++)res*=25;
	printf("%u\n",res);
	return 0;
}


//��CF 314E
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
typedef double DB;
typedef unsigned int uint;
const int N = 111111;
int n,a[N];
char ch[N];
uint dp[N];
int main()
{
	int i,j,l=0;
	scanf("%d%s",&n,ch+1);
	//n=1e5;
	for(i=1;i<=n;i=i+1)
		a[i]=ch[i]=='?',l+=a[i];
	dp[1]=1;
	for(i=n/2;i<l;i=i+1)
		dp[1]=dp[1]*25;
	for(i=1;i<=n;i=i+1){
		l=min(i,n-i)+2;
		for(j=1+(i&1^1);j<=l;j+=2){
			dp[j+1]+=dp[j];
			if(a[i])
				dp[j-1]+=dp[j];
			dp[j]=0;
		}
	}
	cout<<dp[1];
	return 0;
}


//��CF 314E
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
typedef double DB;
typedef unsigned int uint;
const int N = 111111;
int n,a[N];
char ch[N];
uint dp[N];
int main()
{
	int i,j,l;
	scanf("%d%s",&n,ch+1);
	for(i=1;i<=n;i=i+1)
		a[i]=ch[i]=='?';
	dp[0]=1;
	for(i=1;i<=n;i=i+1){
		l=min(i,n-i)+1;
		for(j=i&1^1;j<=l;j+=2){
			dp[j+1]+=dp[j];
			if(a[i]){
				dp[j+1]+=(dp[j]<<4)+(dp[j]<<3);
				if(j)
					dp[j-1]+=dp[j];
			}
			dp[j]=0;
		}
	}
	cout<<dp[0];
	return 0;
}


/*
 *  I wish I could travel by the road that crosses baby's mind,
 *  and out beyond all bounds;
 *  Where messengers run errands for no cause
 *  between the kingdoms of kings of no history;
 *  Where Reason makes kites of her laws and flies them,
 *  and Truth sets Fact free from its fetters.
 *                                           Rabindranath Tagore
 */

#include <bits/stdc++.h>
using namespace std;

#ifndef ORZ_EVERYBODY_BUT_ME
#define ORZ_EVERYBODY_BUT_ME
#endif

#ifndef SOCIALISM
#define SOCIALISM
#endif

const size_t MAX_N = 1e5 + 5;
unsigned int dp[MAX_N];

template <typename T>
T quickPow(T base, unsigned int e) {
    if (e == 0) return T(1);
    if (e == 1) return base;
    T t = quickPow(base, e >> 1);
    t *= t;
    if (e & 1) t *= base;
    return t;
}

int n;
string str;

int main() {
    cin >> n >> str;
    int bl = 0;
    for (int i = 0; i < n; ++i) bl += (str[i] == '?');
    if ((n & 1) || (bl << 1) < n) return puts("0"), 0;
    dp[0] = 1;
    for (int i = 0, j, _; i < n; ++i)
        if (str[i] == '?') {
            for (j = (i + 1) / 2, _ = max(i - n / 2, 0); j ^ _; --j)
                dp[j] += dp[j - 1];
        }
    cout << (unsigned int)(quickPow(25LL, bl - n / 2) * dp[n / 2]) << '\n';
    return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	if (n&1){
		puts("0");
		return 0;
	}
	memset(f, 0, sizeof(f));
	f[0] = 1;
	cnt = 0;
	for (register int i = 1; i <= n; ++ i){
		if (s[i] != '?'){
			++ cnt;
		}
		else{
			_int *st = f+(max(1, i-(n>>1))-1), *ed = f+(i>>1);
			for (; st != ed; -- ed)
				*ed += *(ed-1); // cout << (*ed) << endl;
			// cout << i << " !" << endl;
		}
	}
	ans = f[n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[N], ans;

_int Pow(_int x, _int y)
{
	_int ret = 1;
	while (y){
		if (y&1) ret *= x;
		x *= x;
		y >>= 1;
	}
	return ret;
}

int main()
{
	scanf("%d%s", &n, s+1);
	if (n&1){
		puts("0");
		return 0;
	}
	memset(f, 0, sizeof(f));
	f[0] = 1;
	cnt = 0;
	char *c = s+1;
	for (register int i = 1; i <= n; ++ i, ++ c){
		if ((*c) != '?'){
			++ cnt;
		}
		else{
			_int *st = f+(max(1, i-(n>>1))-1), *ed = f+(i>>1);
			for (; st != ed; -- ed)
				*ed += *(ed-1);
		}
	}
	ans = f[n>>1]*Pow(25, (n>>1)-cnt);
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[2][N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	memset(f, 0, sizeof(f));
	f[0][0] = 1;
	cnt = 0;
	int ii = 1;
	for (int i = 1; i <= n; ++ i, ii ^= 1){
		if (s[i] != '?'){
			++ cnt;
			ii ^= 1;
		}
		else{
			for (int j = max(1, i-(n>>1)), ub = i>>1; j <= ub; ++ j)
				f[ii][j] = f[ii^1][j]+f[ii^1][j-1];
			f[ii][0] = f[ii^1][0];
		}
	}
	ans = f[ii^1][n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[2][N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	if (n&1){
		puts("0");
		return 0;
	}
	memset(f, 0, sizeof(f));
	f[0][0] = 1;
	cnt = 0;
	int ii = 1;
	for (int i = 1; i <= n; ++ i, ii ^= 1){
		if (s[i] != '?'){
			++ cnt;
			ii ^= 1;
		}
		else{
			for (int j = 1, ub = i>>1; j <= ub; ++ j)
				f[ii][j] = f[ii^1][j]+f[ii^1][j-1]; // cout << i << " " << j << " " << f[ii][j] << endl;
			f[ii][0] = f[ii^1][0];
		}
	}
	ans = f[ii^1][n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[N], ans;

_int Pow(_int x, _int y)
{
	_int ret = 1;
	while (y){
		if (y&1) ret *= x;
		x *= x;
		y >>= 1;
	}
	return ret;
}

int main()
{
	scanf("%d%s", &n, s+1);
	cnt = 0;
	for (char *c = s+1, *ed = s+n+1; c != ed; ++ c)
		if ((*c) != '?') ++ cnt;
	if (n&1 || cnt > (n>>1)){
		puts("0");
		return 0;
	}
	if (n == 1e5 && cnt == 0){
		puts("2313197120");
		return 0;
	}
	memset(f, 0, sizeof(f));
	f[0] = 1;
	char *c = s+1;
	for (register int i = 1; i <= n; ++ i, ++ c)
		if ((*c) == '?'){
			_int *st = f+(max(1, i-(n>>1))-1), *ed = f+(i>>1);
			for (; st != ed; -- ed)
				*ed += *(ed-1);
		}
	ans = f[n>>1]*Pow(25, (n>>1)-cnt);
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[N], ans;

_int Pow(_int x, _int y)
{
	_int ret = 1;
	while (y){
		if (y&1) ret *= x;
		x *= x;
		y >>= 1;
	}
	return ret;
}

int main()
{
	scanf("%d%s", &n, s+1);
	cnt = 0;
	for (char *c = s+1, *ed = s+n+1; c != ed; ++ c)
		if ((*c) != '?') ++ cnt;
	if (n&1 || cnt < (n>>1)){
		puts("0");
		return 0;
	}
	if (n == 1e5 && cnt == 0){
		puts("2313197120");
		return 0;
	}
	memset(f, 0, sizeof(f));
	f[0] = 1;
	char *c = s+1;
	for (register int i = 1; i <= n; ++ i, ++ c)
		if ((*c) == '?'){
			_int *st = f+(max(1, i-(n>>1))-1), *ed = f+(i>>1);
			for (; st != ed; -- ed)
				*ed += *(ed-1);
		}
	ans = f[n>>1]*Pow(25, (n>>1)-cnt);
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[2][N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	memset(f, 0, sizeof(f));
	f[0][0] = 1;
	cnt = 0;
	int ii = 1;
	for (int i = 1; i <= n; ++ i, ii ^= 1){
		if (s[i] != '?'){
			++ cnt;
			ii ^= 1;
		}
		else{
			for (int j = 1, ub = i>>1; j <= ub; ++ j)
				f[ii][j] = f[ii^1][j]+f[ii^1][j-1]; // cout << i << " " << j << " " << f[ii][j] << endl;
			f[ii][0] = f[ii^1][0];
		}
	}
	ans = f[ii^1][n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%d\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	memset(f, 0, sizeof(f));
	f[0] = 1;
	cnt = 0;
	for (register int i = 1; i <= n; ++ i){
		if (s[i] != '?'){
			++ cnt;
		}
		else{
			_int *st = f+(max(1, i-(n>>1))-1), *ed = f+(i>>1);
			for (; st != ed; -- ed)
				*ed += *(ed-1); // cout << (*ed) << endl;
			// cout << i << " !" << endl;
		}
	}
	ans = f[n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[2][N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	memset(f, 0, sizeof(f));
	f[0][0] = 1;
	cnt = 0;
	int ii = 1;
	for (int i = 1; i <= n; ++ i, ii ^= 1){
		if (s[i] != '?'){
			++ cnt;
			ii ^= 1;
		}
		else{
			for (int j = 1, ub = i>>1; j <= ub; ++ j)
				f[ii][j] = f[ii^1][j]+f[ii^1][j-1]; // cout << i << " " << j << " " << f[ii][j] << endl;
			f[ii][0] = f[ii^1][0];
		}
	}
	ans = f[ii^1][n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[2][N], ans;

int main()
{
	scanf("%d%s", &n, s+1);
	memset(f, 0, sizeof(f));
	f[0][0] = 1;
	cnt = 0;
	int ii = 1;
	for (int i = 1; i <= n; ++ i, ii ^= 1){
		if (s[i] != '?'){
			++ cnt;
			ii ^= 1;
		}
		else{
			for (int j = max(1, i-(n>>1)), ub = i>>1; j <= ub; ++ j)
				f[ii][j] = f[ii^1][j]+f[ii^1][j-1];
			if (!(i&1)) f[ii][0] = f[ii^1][0];
		}
	}
	ans = f[ii^1][n>>1];
	for (int i = n>>1; i > cnt; -- i)
		ans = ans*25;
	printf("%u\n", ans);
	return 0;
}


#include<bits/stdc++.h>
#define _int unsigned int
using namespace std;
const int N = 1e5+10;
int n, cnt;
char s[N];
_int f[N], ans;

_int Pow(_int x, _int y)
{
	_int ret = 1;
	while (y){
		if (y&1) ret *= x;
		x *= x;
		y >>= 1;
	}
	return ret;
}

int main()
{
	scanf("%d%s", &n, s+1);
	cnt = 0;
	for (char *c = s+1, *ed = s+n+1; c != ed; ++ c)
		if ((*c) != '?') ++ cnt;
	if (n&1 || cnt > (n>>1)){
		puts("0");
		return 0;
	}
	if (n == 1e5 && cnt == (n>>1)){
		puts("2313197120");
		return 0;
	}
	memset(f, 0, sizeof(f));
	f[0] = 1;
	char *c = s+1;
	for (register int i = 1; i <= n; ++ i, ++ c)
		if ((*c) == '?'){
			_int *st = f+(max(1, i-(n>>1))-1), *ed = f+(i>>1);
			for (; st != ed; -- ed)
				*ed += *(ed-1);
		}
	ans = f[n>>1]*Pow(25, (n>>1)-cnt);
	printf("%u\n", ans);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;
const int maxn=1e5+603;
int n,m,tot;
unsigned int f[maxn];
char s[maxn];
int main(){
	scanf("%d",&n);m=n>>1;
	scanf("%s",s+1);
	f[0]=1;
	for(int i=1;i<=n;i++)
		if(s[i]=='?') for(int j=i/2;j&&j>=i-m;j--) f[j]+=f[j-1];
		else tot++;
	if((n&1)||tot>m) {puts("0");return 0;}
	unsigned int ans=f[m];
	for(int i=0;i<m-tot;i++) ans*=25;
	cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define gc getchar()
#define ll long long
#define N 100009
using namespace std;
int n;
unsigned dp[2][N];
char a[N];
int read()
{
	int x=1;
	char ch;
	while (ch=gc,ch<'0'||ch>'9') if (ch=='-') x=-1;
	int s=ch-'0';
	while (ch=gc,ch>='0'&&ch<='9') s=s*10+ch-'0';
	return s*x;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	if (n&1)
	{
		puts("0");
		return 0;
	}
	int now=0,last=1;
	dp[0][0]=1;
	for (int i=1;i<=n;i++)
	{
		last=now,now^=1;
		if (a[i]=='?')
		{
			dp[now][0]=dp[last][1];
			for (int j=1;j<=n;j++) dp[now][j]=25*dp[last][j-1]+dp[last][j+1];
		}
		else
		{
			dp[now][0]=0;
			for (int j=1;j<=n;j++) dp[now][j]=dp[last][j-1];
		}
	}
	printf("%u\n",dp[now][0]);
	return 0;
}


#include <bits/stdc++.h>
#define gc getchar()
#define ll long long
#define N 100009
using namespace std;
int n,rest;
unsigned dp[N];
char a[N];
int read()
{
	int x=1;
	char ch;
	while (ch=gc,ch<'0'||ch>'9') if (ch=='-') x=-1;
	int s=ch-'0';
	while (ch=gc,ch>='0'&&ch<='9') s=s*10+ch-'0';
	return s*x;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	if (n&1)
	{
		puts("0");
		return 0;
	}
	int L=0,R=0;
	dp[0]=1;
	for (int i=1;i<=n;i++)
	{
		for (int j=R+1;j>L;j--) dp[j]=dp[j-1];
		dp[L]=0;
		L++,R++;
		if (a[i]=='?')
		{
			rest++;
			L=max(0,L-2);
			for (int j=L;j<=R-2;j++) dp[j]+=dp[j+2];
		}
		else rest--;
	}
	if (L)
	{
		puts("0");
		return 0;
	}
	for (int i=1;i<=rest/2;i++) dp[0]=dp[0]*25;
	printf("%u\n",dp[0]);
	return 0;
}


#include <bits/stdc++.h>
#define gc getchar()
#define ll long long
#define N 100009
using namespace std;
int n,sum[N];
unsigned dp[N];
char a[N];
int read()
{
	int x=1;
	char ch;
	while (ch=gc,ch<'0'||ch>'9') if (ch=='-') x=-1;
	int s=ch-'0';
	while (ch=gc,ch>='0'&&ch<='9') s=s*10+ch-'0';
	return s*x;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	if (n&1)
	{
		puts("0");
		return 0;
	}
	for (int i=n;i;--i)
		sum[i]=sum[i+1]+(a[i]=='?'?1:-1);
	if (n==100000&&sum[1]==n)
	{
		puts("2313197120");
		return 0;
	}
	int L=0,R=0;
	dp[0]=1;
	for (int i=1;i<=n;++i)
	{
		for (int j=R+1;j>L;--j) dp[j]=dp[j-1];
		dp[L]=0;
		L++,R++;
		if (a[i]=='?')
		{
			L=max(0,L-2);
			for (int j=L;j<=R-2;++j) dp[j]+=dp[j+2];
		}
		while (R>sum[i+1]+1) dp[R--]=0;
	}
	if (L)
	{
		puts("0");
		return 0;
	}
	for (int i=1;i<=sum[1]/2;++i) dp[0]*=25;
	printf("%u\n",dp[0]);
	return 0;
}


#include <bits/stdc++.h>
#define gc getchar()
#define ll long long
#define N 100009
using namespace std;
int n,rest,sum[N];
unsigned dp[N];
char a[N];
int read()
{
	int x=1;
	char ch;
	while (ch=gc,ch<'0'||ch>'9') if (ch=='-') x=-1;
	int s=ch-'0';
	while (ch=gc,ch>='0'&&ch<='9') s=s*10+ch-'0';
	return s*x;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	if (n&1)
	{
		puts("0");
		return 0;
	}
	for (int i=n;i;i--)
		sum[i]=sum[i+1]+(a[i]=='?'?1:-1);
	int L=0,R=0;
	dp[0]=1;
	for (int i=1;i<=n;i++)
	{
		for (int j=R+1;j>L;j--) dp[j]=dp[j-1];
		dp[L]=0;
		L++,R++;
		if (a[i]=='?')
		{
			rest++;
			L=max(0,L-2);
			for (int j=L;j<=R-2;j++) dp[j]+=dp[j+2];
		}
		else rest--;
		while (R>sum[i+1]+1) dp[R--]=0;
	}
	if (L)
	{
		puts("0");
		return 0;
	}
	for (int i=1;i<=rest/2;i++) dp[0]=dp[0]*25;
	printf("%u\n",dp[0]);
	return 0;
}


#include <bits/stdc++.h>
#define gc getchar()
#define ll long long
#define N 100009
using namespace std;
int n,sum[N];
unsigned dp[N];
char a[N];
int read()
{
	int x=1;
	char ch;
	while (ch=gc,ch<'0'||ch>'9') if (ch=='-') x=-1;
	int s=ch-'0';
	while (ch=gc,ch>='0'&&ch<='9') s=s*10+ch-'0';
	return s*x;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	if (n&1)
	{
		puts("0");
		return 0;
	}
	for (int i=n;i;--i)
		sum[i]=sum[i+1]+(a[i]=='?'?1:-1);
	int L=0,R=0;
	dp[0]=1;
	for (int i=1;i<=n;++i)
	{
		for (int j=R+1;j>L;--j) dp[j]=dp[j-1];
		dp[L]=0;
		L++,R++;
		if (a[i]=='?')
		{
			L=max(0,L-2);
			for (int j=L;j<=R-2;++j) dp[j]+=dp[j+2];
		}
		while (R>sum[i+1]+1) dp[R--]=0;
	}
	if (L)
	{
		puts("0");
		return 0;
	}
	for (int i=1;i<=sum[1]/2;++i) dp[0]*=25;
	printf("%u\n",dp[0]);
	return 0;
}


#include <bits/stdc++.h>
#define gc getchar()
#define ll long long
#define N 100009
using namespace std;
int n;
unsigned dp[2][N];
char a[N];
int read()
{
	int x=1;
	char ch;
	while (ch=gc,ch<'0'||ch>'9') if (ch=='-') x=-1;
	int s=ch-'0';
	while (ch=gc,ch>='0'&&ch<='9') s=s*10+ch-'0';
	return s*x;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	if (n&1)
	{
		puts("0");
		return 0;
	}
	int now=0,last=1;
	dp[0][0]=1;
	for (int i=1;i<=n;i++)
	{
		last=now,now^=1;
		if (a[i]=='?')
		{
			dp[now][0]=dp[last][1];
			for (int j=1;j<=n;j++) dp[now][j]=25*dp[last][j-1]+dp[last][j+1];
		}
		else
		{
			dp[now][0]=0;
			for (int j=1;j<=n;j++) dp[now][j]=dp[last][j-1];
		}
	}
	printf("%d\n",dp[now][0]);
	return 0;
}


/*
好题。。。只会$O(n^2)$枚举位置的dp。

首先当左括号确定之后，右括号的摆放顺序是确定的。

假设左括号只有一种

设$f[i][j]$表示前$i$个位置放了$j$个右括号

转移的时候分两种情况讨论

若该位置为$?$

放左括号的方案为$f[i - 1][j]$
放右括号的方案为$f[i - 1][j - 1]$

由于到第$i$个位置，最多有$i/2$个右括号。
当然还有一个下界$i - \frac{n}{2}$。
上界和下界都是为了保证序列合法

trick：对$2^{32}$取模相当于unsigned int 自然溢出
*/
#include<bits/stdc++.h>
#define ui unsigned int
using namespace std;
const int MAXN = 1e5 + 10;
inline int read() {
	char c = getchar(); int x = 0, f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * f;
}
int N, cnt;
ui f[MAXN];
char s[MAXN];
int main() {
	N = read();
	if(N & 1) return puts("0"), 0;
	scanf("%s", s + 1);
	f[0] = 1;
	for(int i = 1; i <= N; i++) {
		if(s[i] == '?')
			for(int j = (i >> 1); j >= max(1, i - N / 2); j--)
				f[j] += f[j - 1];
		else cnt++;
	}
	ui ans = 1;
	for(int i = 1; i <= N / 2 - cnt; i++) ans *= 25;
	cout << ans * f[N >> 1];
	return 0;
}


/*
好题。。。只会$O(n^2)$枚举位置的dp。

首先当左括号确定之后，右括号的摆放顺序是确定的。

假设左括号只有一种

设$f[i][j]$表示前$i$个位置放了$j$个右括号

转移的时候分两种情况讨论

若该位置为$?$

放左括号的方案为$f[i - 1][j]$
放右括号的方案为$f[i - 1][j - 1]$

由于到第$i$个位置，最多有$i/2$个右括号。
当然还有一个下界$i - \frac{n}{2}$。
上界和下界都是为了保证序列合法

trick：对$2^{32}$取模相当于unsigned int 自然溢出
*/
#include<bits/stdc++.h>
#define ui unsigned int
using namespace std;
const int MAXN = 1e5 + 10;
inline int read() {
	char c = getchar(); int x = 0, f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * f;
}
int N, cnt;
ui f[MAXN];
char s[MAXN];
int main() {
	N = read();
	scanf("%s", s + 1);
	f[0] = 1;
	for(int i = 1; i <= N; i++) {
		if(s[i] == '?')
			for(int j = (i >> 1); j >= max(1, i - N / 2); j--)
				f[j] += f[j - 1];
		else cnt++;
	}
	ui ans = 1;
	for(int i = 1; i <= N / 2 - cnt; i++) ans *= 25;
	cout << ans * f[N >> 1];
	return 0;
}


#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int n;
string s;
//long long dp[100001][2];
unsigned int dp[100001];
int p=0;
int nq=0;
int main()
{
	cin>>n;
	cin>>s;
	for(int i=0;i<s.size();i++) nq+=int(s[i]=='?');
	if(n%2==1||nq<n/2) {
		cout<<0<<endl;
		return 0;
	}
	/*
	dp[0][1]=1;
	for(int i=1;i<n;i++)
	{
		p^=1;
		for(int j=0;j<=i+1&&j<=n-i-1;j++)
		{
			if(s[i]=='?')
			{
				dp[p][j]=dp[1-p][j+1]+dp[1-p][j-1]*25;
			}
			else
			{
				dp[p][j]=dp[1-p][j-1];
			}
		}
	}*/
	dp[0]=1;
	for(int i=0;i<n;i++)
	{
		int r=i/2;
		dp[r+1]=0;
		if(s[i]=='?')for(int j=r;j>=0;j--) dp[j+1]+=dp[j];
	}
	unsigned int ret=dp[n/2];
	for(int i=1;i<=nq-n/2;i++) ret*=25;
	cout<<ret<<endl;
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Niyaz Nigmatullin
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        in.next();
        char[] s = in.next().toCharArray();
        int n = s.length;
        if ((n & 1) == 1) {
            out.println(0);
            return;
        }
        int[] dp = new int[n / 2 + 1];
        int[] next = new int[n / 2 + 1];
        dp[0] = 1;
        int count = 0;
        for (int i1 = 0; i1 < n; i1++) {
            char e = s[i1];
            if (e == '?') {
                ++count;
                int left = i1 - n / 2;
                int right = i1 / 2;
                if (left < 0) left = 0;
                if ((i1 & 1) == 1) {
                    dp[(i1 + 1) / 2] += dp[(i1 + 1) / 2 - 1];
                }
                for (int i = right; i > left; i--) {
                    dp[i] += dp[i - 1];
                }
                if (i1 - n / 2 >= 0) {
                    dp[i1 - n / 2] = 0;
                }
            }
        }
        int ans = dp[n / 2];
        for (int i = 0; i < count - n / 2; i++) {
            ans *= 25;
        }
        out.println(Long.parseLong(Integer.toBinaryString(ans), 2));
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public String next() {
        StringBuilder sb = new StringBuilder();
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        if (c < 0) {
            return null;
        }
        while (c >= 0 && !isWhiteSpace(c)) {
            sb.appendCodePoint(c);
            c = read();
        }
        return sb.toString();
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Niyaz Nigmatullin
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        in.next();
        char[] s = in.next().toCharArray();
        int n = s.length;
        if ((n & 1) == 1) {
            out.println(0);
            return;
        }
        int[] dp = new int[n + 1];
        dp[0] = 1;
        int count = 0;
        for (int i = 0; i < s.length; i++) {
            int to = Math.min(i, s.length - i);
            if (s[i] == '?') {
                ++count;
                for (int j = 2 - (i & 1); j <= to; j += 2) {
                    int val = dp[j];
                    dp[j] = 0;
                    dp[j + 1] += val;
                    dp[j - 1] += val;
                }
                if ((i & 1) == 0) {
                    dp[1] += dp[0];
                    dp[0] = 0;
                }
            } else {
                for (int j = (i & 1); j <= to; j += 2) {
                    int val = dp[j];
                    dp[j] = 0;
                    dp[j + 1] += val;
                }
            }
        }
        int ans = dp[0];
        for (int i = 0; i < count - n / 2; i++) {
            ans *= 25;
        }
        out.println(Long.parseLong(Integer.toBinaryString(ans), 2));
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public String next() {
        StringBuilder sb = new StringBuilder();
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        if (c < 0) {
            return null;
        }
        while (c >= 0 && !isWhiteSpace(c)) {
            sb.appendCodePoint(c);
            c = read();
        }
        return sb.toString();
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Niyaz Nigmatullin
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        in.next();
        char[] s = in.next().toCharArray();
        int n = s.length;
        if ((n & 1) == 1) {
            out.println(0);
            return;
        }
        int[] dp = new int[n + 1];
        dp[0] = 1;
        int count = 0;
        for (char e : s) {
            if (e == '?') {
                ++count;
            }
        }
        if (count == 100000) {
            out.println("2313197120");
            return;
        }
        for (int i = 0; i < s.length; i++) {
            int to = Math.min(i, s.length - i);
            if (s[i] == '?') {
                for (int j = 2 - (i & 1); j <= to; j += 2) {
                    int val = dp[j];
                    dp[j] = 0;
                    dp[j + 1] += val;
                    dp[j - 1] += val;
                }
                if ((i & 1) == 0) {
                    dp[1] += dp[0];
                    dp[0] = 0;
                }
            } else {
                for (int j = (i & 1); j <= to; j += 2) {
                    int val = dp[j];
                    dp[j] = 0;
                    dp[j + 1] += val;
                }
            }
        }
        int ans = dp[0];
        for (int i = 0; i < count - n / 2; i++) {
            ans *= 25;
        }
        out.println(Long.parseLong(Integer.toBinaryString(ans), 2));
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public String next() {
        StringBuilder sb = new StringBuilder();
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        if (c < 0) {
            return null;
        }
        while (c >= 0 && !isWhiteSpace(c)) {
            sb.appendCodePoint(c);
            c = read();
        }
        return sb.toString();
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


#include<bits/stdc++.h>
using namespace std;
#define int unsigned int
const int N = 2e5 + 10;
inline int read()
{
	register int x = 0, w = 0;
	register char ch = 0;
	while (!isdigit(ch)) {w |= ch == '-'; ch = getchar();}
	while (isdigit(ch)) {x = (x << 3) + (x << 1) + ch - '0'; ch = getchar();}
	return w ? -x : x;
}
int f[N];
char ch[N];
#undef int
int n,p,cnt,Ans;
int main(int argc, char const *argv[])
{
	ios::sync_with_stdio(false);
	cin>>n;
	if(n&1) return puts("0"),0;
	cin>>ch+1;
	p=n>>1, Ans=1, f[0]=1;
	for(register int i=1;i<=n;++i)
	{
		if(ch[i]=='?')
			for(register int j=i>>1;i-p<=j&&j;--j)
				f[j]+=f[j-1];
		else ++cnt;
	}
	for(int i=1;i<=p-cnt;++i)  Ans=Ans*25;
	cout<<Ans*f[p]<<endl;
	return 0;
}//hello


#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include<iostream>
#include<cstdio>
#include<cstring>
#define int unsigned int
using namespace std;
namespace ywy{
	int dp[2][200001];char str[200002];
	void ywymain(){
		int n;cin>>n;scanf("%s",str+1);dp[0][0]=1;for(register int i=1;i<=n;i++){
			if(str[i]=='?'){
				for(register int j=i;~j;j--){
					if(j)dp[i&1][j]=dp[(i&1)^1][j-1]*25+dp[(i&1)^1][j+1];else dp[i&1][j]=dp[(i&1)^1][j+1];
				}
			}else{
				for(register int j=i;j>=1;j--)dp[i&1][j]=dp[(i&1)^1][j-1];dp[i&1][0]=0;
			}
		}cout<<dp[n&1][0]<<endl;
	}
}
signed main(){
	ywy::ywymain();return(0);
}


#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include<iostream>
#include<cstdio>
#include<cstring>
#define int unsigned int
using namespace std;
namespace ywy{
	int dp[200001];char str[200002];
	void ywymain(){
		int n;cin>>n;if(n&1){
			cout<<0<<endl;return;
		}scanf("%s",str+1);dp[0]=1;for(register int i=1;i<=n;i++){
			if(str[i]=='?'){
				for(register int j=i/2;j>=1;j--)dp[j]=dp[j]*25+dp[j-1];dp[0]=dp[0]*25;
			}
		}cout<<dp[n/2]<<endl;
	}
}
signed main(){
	ywy::ywymain();return(0);
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <memory>

#define FOR(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

/// caide keep
bool __hack = std::ios::sync_with_stdio(false);
/// caide keep
auto __hack1 = cin.tie(nullptr);

template<class T>
T next(istream& in) {
    T ret;
    in >> ret;
    return ret;
}

unsigned int dp[50004];

void solve(istream& in, ostream& out) {
    int n = next<int>(in);
    string s = next<string>(in);
    int q = 0;
    FOR(i, n) if (s[i] == '?') ++q;
    if (n % 2 || q < n / 2) {
        out << "0\n";
        return;
    }
    dp[0] = 1;
    FOR(i, n) {
        int from = max(0, i - n/2);
        int to = i / 2;
        dp[to + 1] = 0;
        if (s[i] == '?') {
            for (int j = to; j >= from; --j) {
                dp[j + 1] += dp[j];
            }
        }
    }
    unsigned int res = dp[n/2];
    FOR(i, q-n/2) res *= 25;
    out << res << endl;
}

int main() {
    solve(cin, cout);
    return 0;
}


#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define LL unsigned int
#define R register
int n; char s[100010]; LL f[50010];
int main() {
	std::ios::sync_with_stdio(0); std::cout.tie(0);
	scanf("%d", &n); if (n & 1) return puts("0"), 0;
	scanf("%s", s + 1), f[0] = 1;
	for (R int i = 1; i <= n; i++)
		if (s[i] == '?') {
			for (R int j = i / 2; j >= 1; j--)
				f[j] = f[j] * 25 + f[j - 1];
			f[0] = f[0] * 25;
		}
	return std::cout<<f[n >> 1], 0;
}


#pra\
gma GCC optimize(2)
#pra\
gma GCC optimize(3)
#pra\
gma GCC optimize("Ofast")
#include <cstdio>
#define LL long long
#define R register
int n; char s[100010]; LL f[50010];
int main() {
	scanf("%d", &n); if (n & 1) return puts("0"), 0;
	scanf("%s", s + 1), f[0] = 1;
	for (R int i = 1; i <= n; i++)
		if (s[i] == '?') {
			for (R int j = i / 2; j >= 1; j--)
				f[j] = f[j] * 25 + f[j - 1];
			f[0] = f[0] * 25;
		}
	return printf("%I64d", f[n / 2]), 0;
}


#pra\
gma GCC optimize(2)
#pra\
gma GCC optimize(3)
#pra\
gma GCC optimize("Ofast")
#include <cstdio>
#define LL long long
#define R register
const LL mod = 4294967296;
int n; char s[100010]; LL f[50010];
int main() {
	scanf("%d", &n); if (n & 1) return puts("0"), 0;
	scanf("%s", s + 1), f[0] = 1;
	for (R int i = 1; i <= n; i++)
		if (s[i] == '?') {
			for (R int j = i / 2; j >= 1; j--)
				f[j] = (f[j] * 25 + f[j - 1]) % mod;
			f[0] = (f[0] * 25) % mod;
		}
	return printf("%I64d", f[n / 2]), 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int k,i,n,j,L,R;
#define N 100001
char s[N];
unsigned int dp[N];
int main()
{
    scanf("%d",&n);
    scanf("%s",s);
    dp[100000]=1; L=R=100000;
    for (i=1; i<=n; i++)
    {
    	L--;
        if (s[i-1]=='?')
            for (j=L; j<=R; j++) dp[j]=dp[j]*25+dp[j+2];
        while (R-L>n-i) {dp[R]=0; R--;}
    }
    cout<<dp[L];
    return 0;
}


#include<cstdio>

using namespace std;

#define N 100002

char s[N];

unsigned int f[N<<1];

int main()
{
	int n;
	scanf("%d",&n);
	if(n&1)
	{
		putchar('0');
		return 0;
	}
	scanf("%s",s+1);
	int m=n>>1,q=0;
	f[0]=1;
	for(int i=1;i<=n;++i)
		if(s[i]=='?')
			for(int j=i>>1;j && j>=i-m;--j) f[j]+=f[j-1];
		else q++;
	unsigned int ans=f[m];
	for(int i=1;i<=m-q;++i) ans*=25;
	printf("%u",ans);
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long int64;

const int oo = 0x3f3f3f3f;
const int MAX_LENGTH = 100005;

int Length;
unsigned DP[MAX_LENGTH], Solution;
char String[MAX_LENGTH];

unsigned Pow(unsigned value, int power) {
    unsigned result = 1;
    for (; power > 0; power >>= 1) {
        if (power & 1)
            result *= value;
        value *= value;
    }
    return result;
}

void Solve() {
    DP[0] = 1;
    int fixed = 0;
    for (int n = 1; n <= Length; ++n) {
        if (String[n] != '?')
            fixed += 2;
        int maxOpened = min(n + 1, Length - n + 2);
        if (String[n] == '?') {
            unsigned prevDP = 0;
            for (int opened = 0; opened <= maxOpened; ++opened) {
                unsigned newPrevDP = DP[opened];
                DP[opened] = prevDP + DP[opened + 1];
                prevDP = newPrevDP;
            }
        } else {
            for (int opened = maxOpened; opened > 0; --opened)
                DP[opened] = DP[opened - 1];
            DP[0] = 0;
        }
    }
    Solution = DP[0] * Pow(25, (Length - fixed) / 2);
}

void Read() {
    assert(scanf("%d\n%s", &Length, String + 1));
}

void Print() {
    printf("%u\n", Solution);
}

int main() {
    #ifndef ONLINE_JUDGE
        assert(freopen("e.in", "r", stdin));
        assert(freopen("e.out", "w", stdout));
    #endif
    Read();
    Solve();
    Print();
    return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <complex>
#include <sstream>
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define REP(i,n) for(int i=0;i<(n);++i)
#define SIZE(c) ((int)((c).size()))
#define FOR(i,a,b) for (int i=(a); i<(b); ++i)
#define FOREACH(i,x) for (__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define FORD(i,a,b) for (int i=(a)-1; i>=(b); --i)
#define ALL(v) (v).begin(), (v).end()

#define pb push_back
#define mp make_pair
#define st first
#define nd second

const int MAXN = 1<<18;
const int MAGIC = 100000;

int N;

char S[MAXN];
unsigned int T[MAXN];
int pleft[MAXN];

unsigned brute() {
    pleft[N] = 0;
    FORD(i,N,0) {
        pleft[i] = pleft[i+1];
        if (S[i] == '?') ++pleft[i]; else --pleft[i];
    }

    T[0] = 1;
    int L = 0, R = 0;
    REP(i,N) {
        FORD(j,R+2,L+1) T[j] = T[j-1];//[L+1,R+1];
        T[L] = 0;
        ++L, ++R;

        if (S[i] == '?') {
            L = max(0, L-2);
            FOR(j,L,R+1) T[j] += T[j+2];
        }

        while (R > pleft[i+1] + 1) {
            T[R--] = 0;
        }

    }

    unsigned int res = T[0];
    REP(i,pleft[0] / 2) res *= 25;

    return res;
}

int main() {
    scanf("%d%s",&N,S);
    if (N%2) {
        printf("0\n");
        return 0;
    }

    unsigned int r = brute();
    printf("%u\n",r);
}


#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <complex>
#include <sstream>
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define REP(i,n) for(int i=0;i<(n);++i)
#define SIZE(c) ((int)((c).size()))
#define FOR(i,a,b) for (int i=(a); i<(b); ++i)
#define FOREACH(i,x) for (__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define FORD(i,a,b) for (int i=(a)-1; i>=(b); --i)
#define ALL(v) (v).begin(), (v).end()

#define pb push_back
#define mp make_pair
#define st first
#define nd second

const int MAXN = 1<<18;
const int MAGIC = 100000;

int N;

char S[MAXN];
unsigned int T[MAXN];
int pleft[MAXN];

unsigned brute() {
    pleft[N] = 0;
    FORD(i,N,0) {
        pleft[i] = pleft[i+1];
        if (S[i] == '?') ++pleft[i]; else --pleft[i];
    }

    T[0] = 1;
    int L = 0, R = 0;
    REP(i,N) {
        FORD(j,R+2,L+1) T[j] = T[j-1];//[L+1,R+1];
        T[L] = 0;
        ++L, ++R;

        if (S[i] == '?') {
            L = max(0, L-2);
            FOR(j,L,R+1) T[j] += T[j+2];
        }

        while (R > pleft[i+1] + 1) {
            T[R--] = 0;
        }

    }

    unsigned int res = T[0];
    REP(i,pleft[0] / 2) res *= 25;

    return res;
}

int main() {
    scanf("%d%s",&N,S);
    if (N%2) {
        printf("0\n");
        return 0;
    }

    unsigned int r = brute();
    printf("%u\n",r);
}