#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, mod = 1000000007;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const double pi = acosl(-1.), eps = 1e-9;
inline int power(int a, int b, int m = mod, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
const int NN = 101010;
char s[NN];
long long a[NN], b[NN], c[NN];
pair<int, int> op[NN << 1];
int main() {
  int n;
  cin >> n;
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    a[i] = c[i] = s[i] - '0';
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    b[i] = s[i] - '0';
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (i == n) {
      if (a[i] != b[i]) {
        puts("-1");
        return 0;
      }
      break;
    }
    if (a[i] > b[i]) {
      a[i + 1] -= a[i] - b[i];
      ans += a[i] - b[i];
    } else {
      a[i + 1] += b[i] - a[i];
      ans += b[i] - a[i];
    }
  }
  cout << ans << endl;
  int m = 0;
  for (int i = 1; i < n; i++) {
    while (c[i] != b[i] && m < 100000) {
      int r = m;
      if (c[i] > b[i]) {
        int j = i;
        int flag = -1;
        while (j < n) {
          op[m++] = pair<int, int>(j, flag);
          c[j] += flag;
          c[j + 1] += flag;
          if (c[j + 1] < 0) {
            flag = 1;
          } else if (c[j + 1] > 9) {
            flag = -1;
          } else
            break;
          j++;
        }
        reverse(op + r, op + m);
      } else {
        int j = i;
        int flag = 1;
        while (j < n) {
          op[m++] = pair<int, int>(j, flag);
          c[j] += flag;
          c[j + 1] += flag;
          if (c[j + 1] < 0) {
            flag = 1;
          } else if (c[j + 1] > 9) {
            flag = -1;
          } else
            break;
          j++;
        }
        reverse(op + r, op + m);
      }
    }
  }
  m = min(m, 100000);
  for (int i = 0; i < m; i++) {
    printf("%d %d\n", op[i].first, op[i].second);
  }
  return 0;
}
