#include <bits/stdc++.h>
using namespace std;
int gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gli() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
char a[100004];
char b[100004];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n = gi();
  scanf("%s", a);
  scanf("%s", b);
  int s = 0;
  for (int i = 0; i < n; i++) {
    s += ((i % 2) * 2 - 1) * (a[i] - b[i]);
    a[i] -= '0';
    b[i] -= '0';
  }
  if (s) {
    printf("-1\n");
    return 0;
  }
  int p1 = 0, p2 = 0;
  vector<pair<int, int> > res;
  long long c = 0;
  while (1) {
    while (p1 < n && a[p1] == b[p1]) p1++;
    if (p1 == n) break;
    int req = b[p1] - a[p1];
    int sign = (req < 0 ? -1 : 1);
    req *= sign;
    p2 = (p2 > p1 + 1 ? p2 : p1 + 1);
    int sign2 = ((p2 - p1) % 2 ? sign : -sign);
    int av = (sign2 == 1 ? 9 - a[p2] : a[p2]);
    if (av) {
      av = (av < req ? av : req);
      a[p1] += sign * av;
      a[p2] += sign2 * av;
      while (av--)
        if (c < 100000) {
          sign = sign2;
          for (int i = p2; i > p1; i--) {
            if (c < 100000) {
              res.push_back({i, sign});
              sign *= -1;
            }
            c++;
          }
        } else
          c += p2 - p1;
    } else
      p2++;
  }
  cout << c << endl;
  for (pair<int, int> &p : res) cout << p.first << " " << p.second << endl;
  return 0;
}
