func_code_string: #include <bits/stdc++.h>   using namespace std;   const int OO = 1e9;   const long long INF = 1e18;   const int irand(int lo, int hi) {     return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;   }   const long long lrand(long long lo, long long hi) {     return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;   }   template <typename T>   T getnum() {     int sign = 1;     T ret = 0;     char c;     do {       c = getchar();     } while (c ==     || c ==   n );     if (c ==  - )       sign = -1;     else       ret = c -  0 ;     while (1) {       c = getchar();       if (c <  0  || c >  9 ) break;       ret = 10 * ret + c -  0 ;     }     return sign * ret;   }   inline void ini(int& x) { x = getnum<int>(); }   inline void scani(int& x) { scanf( %d , &x); }   const int N = 1e5 + 5;   int n;   int a[N], b[N];   long long ans = 0;   vector<pair<int, int> > ins;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cout.setf(ios::fixed);     cout.setf(ios::showpoint);     cout.precision(10);     cin >> n;     string str;     cin >> str;     for (int i = 0; i < n; i++) {       a[i + 1] = str[i] -  0 ;     }     cin >> str;     for (int i = 0; i < n; i++) {       b[i + 1] = str[i] -  0 ;     }     int difa = 0, difb = 0;     for (int i = 1; i <= n; i += 1) {       if (i & 1) {         difa += a[i];         difb += b[i];       } else {         difa -= a[i];         difb -= b[i];       }     }     if (difa != difb) {       cout << -1 <<   n ;       return 0;     }     int f = 2;     for (int i = 1; i <= n - 1; i += 1) {       if (f == i) f++;       while (a[i] > b[i]) {         a[i]--;         while (1) {           assert(f <= n);           if ((f - i) & 1) {             if (a[f] == 0) {               f++;             } else {               a[f]--;               break;             }           } else {             if (a[f] == 9) {               f++;             } else {               a[f]++;               break;             }           }         }         ans += f - i;         if (ins.size() < 100000) {           for (int j = f - 1; j >= i; j -= 1) {             if ((j - i) & 1) {               ins.push_back({j, 1});             } else {               ins.push_back({j, -1});             }           }         }       }       while (a[i] < b[i]) {         a[i]++;         while (1) {           assert(f <= n);           if ((f - i) & 1) {             if (a[f] == 9) {               f++;             } else {               a[f]++;               break;             }           } else {             if (a[f] == 0) {               f++;             } else {               a[f]--;               break;             }           }         }         ans += f - i;         if (ins.size() < 100000) {           for (int j = f - 1; j >= i; j -= 1) {             if ((j - i) & 1) {               ins.push_back({j, -1});             } else {               ins.push_back({j, 1});             }           }         }       }     }     cout << ans <<   n ;     for (int i = 0; i < min(100000, (int)ins.size()); i++) {       cout << ins[i].first <<     << ins[i].second <<   n ;     }     return 0;   }   