func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:268435456 )   using namespace std;   template <typename T>   inline T abs(T a) {     return ((a < 0) ? -a : a);   }   template <typename T>   inline T sqr(T a) {     return a * a;   }   template <class T>   T gcd(T a, T b) {     return a ? gcd(b % a, a) : b;   }   template <class T>   T lcm(T a, T b) {     return a / gcd(a, b) * b;   }   template <class T>   T sign(T a) {     return a > 0 ? 1 : (a < 0 ? -1 : 0);   }   template <typename A, typename B>   inline ostream& operator<<(ostream& out, const pair<A, B>& p) {     return out << p.X <<     << p.Y <<    ;   }   template <typename T>   inline ostream& operator<<(ostream& out, const vector<T>& a) {     for (int i = 0; i < (int)((int)(a.size())); ++i) {       if (i) out <<    ;       out << a[i];     }     return out <<    ;   }   template <typename T>   inline ostream& operator<<(ostream& out, const set<T>& a) {     return out << vector<T>(a.begin(), a.end());   }   const int dx[] = {-1, 0, 1, 0};   const int dy[] = {0, 1, 0, -1};   const int dxK[] = {-1, -1, 0, 1, 1, 1, 0, -1};   const int dyK[] = {0, 1, 1, 1, 0, -1, -1, -1};   const int dxKn[] = {-2, -1, 1, 2, 2, 1, -1, -2};   const int dyKn[] = {1, 2, 2, 1, -1, -2, -2, -1};   const int N = int(5e5) + 9;   const int M = int(2e2) + 9;   const int LOGN = 22;   const int SQN = 350;   const int MOD = int(1e9) + 7;   const int INF = 1e9 + 100;   const long long INF64 = 2e18;   const long double PI = 3.1415926535897932384626433832795;   const long double EPS = 1e-9;   struct edge {     int to, f, c, rev;   };   const int V = 1000 * 1000 + 3;   vector<edge> g[V];   int lev[V];   int head, tail, q[V];   inline bool bfs(int s, int t) {     memset(lev, 63, sizeof(lev));     head = tail = 0;     lev[s] = 0;     q[head++] = s;     while (head != tail) {       int v = q[tail++];       for (int i = 0; i < (int)((int)(g[v].size())); ++i)         if (g[v][i].f < g[v][i].c && lev[g[v][i].to] > lev[v] + 1) {           lev[g[v][i].to] = lev[v] + 1;           q[head++] = g[v][i].to;         }     }     return lev[t] < INF / 2;   }   inline void add(int from, int to, int c) {     edge f = {to, 0, c, (int)(g[to].size())};     edge b = {from, 0, 0, (int)(g[from].size())};     g[from].push_back(f);     g[to].push_back(b);   }   int ptr[V];   int dfs(int v, int t, int f) {     if (v == t) return f;     for (; ptr[v] < (int)(g[v].size()); ++ptr[v]) {       edge& e = g[v][ptr[v]];       if (e.f == e.c || lev[e.to] != lev[v] + 1) continue;       int df = dfs(e.to, t, min(f, e.c - e.f));       if (df > 0) {         e.f += df;         g[e.to][e.rev].f -= df;         return df;       }     }     return 0;   }   inline int dinic(int s, int t) {     int ans = 0;     while (bfs(s, t)) {       memset(ptr, 0, sizeof(ptr));       for (int f; (f = dfs(s, t, INF)) != 0; ans += f)         ;     }     return ans;   }   int n, b, m;   pair<int, int> a[N];   void solve() {     cin >> n >> b >> m;     for (int i = 0; i < (int)(m); ++i) cin >> a[i].first >> a[i].second;     sort(a, a + m);     m = unique(a, a + m) - a;     for (int i = 1; i < (int)(m); ++i) {       if (a[i - 1].second > a[i].second) {         cout <<  unfair ;         return;       }       if (a[i - 1].second != a[i].second && a[i - 1].first == a[i].first) {         cout <<  unfair ;         return;       }     }     for (int i = 0; i < (int)(5); ++i) add(0, 100 * 1000 + (i % 5), n / 5);     for (int i = 1; i <= b; ++i) add(100 * 1000 + (i % 5), i, 1);     int pos = 0;     for (int i = 1; i <= b; ++i) {       while (pos < m && a[pos].first < i) ++pos;       add(i, pos + 1 + b, 1);     }     pos = 0;     for (int i = b + 1; i <= b + m + 1; ++i, ++pos) {       int r = (pos == m ? n : a[pos].second);       int l = (pos == 0 ? 0 : a[pos - 1].second);       add(i, N - 1, r - l);     }     if (dinic(0, N - 1) == n)       cout <<  fair ;     else       cout <<  unfair ;   }   int main() {     srand(time(NULL));     cout << setprecision(10) << fixed;     cerr << setprecision(10) << fixed;     solve();     return 0;   }   