#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=1e4+,M=2e4+;
typedef long long ll;
inline int read(){
char c=getchar();int x=,f=;
while(c<''||c>''){if(c=='-')f=-;c=getchar();}
while(c>=''&&c<=''){x=x*+c-'';c=getchar();}
return x*f;
}
int n,m,u,v;
struct edge{
int v,ne;
}e[M];
int h[N],cnt=;
inline void ins(int u,int v){
cnt++;
e[cnt].v=v;e[cnt].ne=h[u];h[u]=cnt;
}
int f[N];
int dp(int u){
if(f[u]) return f[u];
f[u]=;
for(int i=h[u];i;i=e[i].ne){
int v=e[i].v;
f[u]=max(f[u],dp(v)+);
}
return f[u];
}
int vis[N],flag=;
void dfs(int u){
if(flag) return;
vis[u]=;
for(int i=h[u];i;i=e[i].ne){
int v=e[i].v;
if(vis[v]){flag=;return;}
dfs(v);
}
vis[u]=;
}
int main(){
freopen("Reward.in","r",stdin);
freopen("Reward.out","w",stdout);
n=read();m=read();
for(int i=;i<=m;i++){u=read();v=read();ins(u,v);} for(int i=;i<=n;i++){
//memset(vis,0,sizeof(vis));
dfs(i);
if(flag){puts("Poor Xed");return ;}
} ll ans=;
for(int i=;i<=n;i++) ans+=dp(i);
printf("%lld",ans);
}
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
const int N=1e5+;
const ll MOD=;
inline int read(){
char c=getchar();int x=,f=;
while(c<''||c>''){if(c=='-')f=-;c=getchar();}
while(c>=''&&c<=''){x=x*+c-'';c=getchar();}
return x*f;
}
char s[];
int a[],t[],mp[];
int f[][];
void tobit(){
for(int i=;i<=;i++){
int t=a[i];
for(int j=;t;t>>=,j++)
if(t&) f[i][j]=;
}
}
int fm[];
void sol(){
int g=;
for(int j=;j<=;j++){
int t1=,t2=;
for(int i=;i<=;i++) t1+=f[i][j],t2+=(f[i][j]^);
t1+=g;t2+=g;
if((t1&)==f[][j]) fm[j]=,g=t1/;
else fm[j]=,g=t2/;
}
}
char st[];int top=;
void print(){
ll m=;
for(int j=;j<=;j++) m+=(<<j)*fm[j];
//printf("m %d\n",m);
if(m==) printf("");
else while(m){
int t=m%; m/=;
if(t<) st[++top]=t+'';
else st[++top]=t-+'a';
}
while(top) putchar(st[top--]);
}
int main(){
freopen("Encode.in","r",stdin);
freopen("Encode.out","w",stdout);
for(int i=;i<=;i++) mp[i+'']=i;
mp['a']=;mp['b']=;mp['c']=;mp['d']=;mp['e']=;mp['f']=;
for(int i=;i<=;i++){
scanf("%s",s);
int len=strlen(s);
for(int j=;j<len;j++){
int p=len--j;
//printf("%c %d %d\n",s[j],mp[s[j]],p);
a[i]+=mp[s[j]]*pow(,p);
}
}
tobit();
sol();
//for(int i=0;i<=32;i++) printf("%d",fm[i]);
print();
}
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=,M=1e6,INF=1e9;
typedef long long ll;
inline int read(){
char c=getchar();int x=,f=;
while(c<''||c>''){if(c=='-')f=-;c=getchar();}
while(c>=''&&c<=''){x=x*+c-'';c=getchar();}
return x*f;
}
int n,m,gn;
struct edge{
int v,w,ne;
}e[M];
int h[N],cnt=;
inline void ins(int u,int v,int w){//printf("ins %d %d %d\n",u,v,w);
cnt++;
e[cnt].v=v;e[cnt].w=w;e[cnt].ne=h[u];h[u]=cnt;
}
struct task{
int t,a,b;
}a[N]; void buildGraph(){
for(int i=;i<=gn;i++){
int has=;
for(int j=;j<=n;j++)
if(a[j].a<=i&&i<=a[j].b) has++,ins(i,i+a[j].t,a[j].t);
if(!has&&i<gn) ins(i,i+,);
}
} int q[N],head=,tail=;
inline void lop(int &x){if(x==N) x=;}
int d[N],inq[N];
void spfa(){
for(int i=;i<=gn;i++) d[i]=INF;
d[]=;
q[tail++]=; inq[]=;
while(head!=tail){
int u=q[head++];inq[u]=;lop(head);
for(int i=h[u];i;i=e[i].ne){
int v=e[i].v,w=e[i].w;
if(d[v]>d[u]+w){
d[v]=d[u]+w;
if(!inq[v]){q[tail++]=v;inq[v]=;lop(tail);}
}
}
}
}
int main(){
freopen("Work.in","r",stdin);
freopen("Work.out","w",stdout);
n=read();
for(int i=;i<=n;i++){
a[i].t=read();a[i].a=read();a[i].b=read()-a[i].t;
gn=max(gn,a[i].b+a[i].t);
}
buildGraph();
spfa();
//for(int i=0;i<=gn;i++) printf("d %d %d\n",i,d[i]);
printf("%d",d[gn]);
}
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=1e5+;
typedef unsigned long long ll;
inline int read(){
char c=getchar();int x=,f=;
while(c<''||c>''){if(c=='-')f=-;c=getchar();}
while(c>=''&&c<=''){x=x*+c-'';c=getchar();}
return x*f;
}
ll n,m,x=,y=;
ll gcd(ll a,ll b){return b==?a:gcd(b,a%b);}
int main(){
freopen("Sum.in","r",stdin);
freopen("Sum.out","w",stdout);
n=read();m=read();
for(int i=;i<=n+m-;i++) y*=i;
for(int i=;i<=n;i++){
ll t=,l=i,r=i+m-;
for(int j=;j<l;j++) t*=j;
for(int j=r+;j<=n+m-;j++) t*=j;
x+=t;
}
ll g=gcd(x,y);
printf("%lld\n%lld",x/g,y/g);
}