#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
int c[maxn], a[maxn], b[maxn], cnt;
int main() {
  ios::sync_with_stdio(false);
  int n;
  string A, B;
  cin >> n >> A >> B;
  A = "#" + A;
  B = "#" + B;
  for (int i = 1; i <= n; i++) a[i] = A[i] - '0';
  for (int i = 1; i <= n; i++) b[i] = B[i] - '0';
  long long ans = 0;
  for (int i = 1; i <= n - 1; i++) {
    c[i] = b[i] - a[i] - c[i - 1];
  }
  if (a[n] + c[n - 1] != b[n]) {
    cout << -1 << endl;
    return 0;
  }
  int t = 2;
  for (int i = 1; i <= n - 1; i++) {
    t = max(t, i + 1);
    while (a[i] < b[i]) {
      if ((t - i) % 2) {
        if (a[t] < 9) {
          a[t]++;
          a[i]++;
          ans += t - i;
        } else {
          t++;
        }
      } else {
        if (a[t] > 0) {
          a[t]--;
          a[i]++;
          ans += t - i;
        } else {
          t++;
        }
      }
    }
    while (a[i] > b[i]) {
      if ((t - i) % 2 == 0) {
        if (a[t] < 9) {
          a[t]++;
          a[i]--;
          ans += t - i;
        } else {
          t++;
        }
      } else {
        if (a[t] > 0) {
          a[t]--;
          a[i]--;
          ans += t - i;
        } else {
          t++;
        }
      }
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++) a[i] = A[i] - '0';
  for (int i = 1; i <= n; i++) b[i] = B[i] - '0';
  t = 2;
  ans = 0;
  for (int i = 1; i <= n - 1; i++) {
    t = max(t, i + 1);
    while (a[i] < b[i]) {
      if ((t - i) % 2) {
        if (a[t] < 9) {
          a[t]++;
          a[i]++;
          int w = 1;
          for (int j = t - 1; j >= i; j--) {
            ans++;
            cout << j << " " << w << endl;
            w *= -1;
            if (ans == 1e5) return 0;
          }
        } else {
          t++;
        }
      } else {
        if (a[t] > 0) {
          a[t]--;
          a[i]++;
          int w = -1;
          for (int j = t - 1; j >= i; j--) {
            ans++;
            cout << j << " " << w << endl;
            w *= -1;
            if (ans == 1e5) return 0;
          }
        } else {
          t++;
        }
      }
    }
    while (a[i] > b[i]) {
      if ((t - i) % 2 == 0) {
        if (a[t] < 9) {
          a[t]++;
          a[i]--;
          int w = 1;
          for (int j = t - 1; j >= i; j--) {
            ans++;
            cout << j << " " << w << endl;
            w *= -1;
            if (ans == 1e5) return 0;
          }
        } else {
          t++;
        }
      } else {
        if (a[t] > 0) {
          a[t]--;
          a[i]--;
          int w = -1;
          for (int j = t - 1; j >= i; j--) {
            ans++;
            cout << j << " " << w << endl;
            w *= -1;
            if (ans == 1e5) return 0;
          }
        } else {
          t++;
        }
      }
    }
  }
}
