#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1;
  int res = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -f;
  } while (ch < '0' || ch > '9');
  do {
    res = res * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f == 1 ? res : -res;
}
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 100010;
const int mod = 998244353;
const long long INF = 1e18;
int n, m, q;
int A[N], B[N];
char str[N];
int head[N], to[N * 2], nxt[N * 2], tot;
void addEdge(int u, int v) {
  tot++;
  nxt[tot] = head[u];
  to[tot] = v;
  head[u] = tot;
}
long long mmax(long long a, long long b) { return a > b ? a : b; }
long long mmin(long long a, long long b) { return a < b ? a : b; }
void add(vector<pair<long long, long long> >& res, int idx, int v) {
  if (res.size() < 100000) {
    res.push_back(make_pair(idx, v));
  }
}
int main() {
  fast_io();
  cin >> n;
  cin >> str;
  for (int i = 0; i < n; i++) A[i] = str[i] - '0';
  cin >> str;
  for (int i = 0; i < n; i++) B[i] = str[i] - '0';
  vector<pair<long long, long long> > res;
  long long ans = 0;
  int MAX = 100000;
  int nxt = 1;
  for (int i = 0; i < n - 1; i++) {
    int diff = A[i] - B[i];
    if (diff < 0) {
      for (int j = 0; j < -diff; j++) {
        if (A[i + 1] < 9) {
          A[i]++;
          A[i + 1]++;
          ans++;
          if (res.size() < MAX) {
            res.push_back(make_pair(i, 1));
          }
        } else {
          nxt = mmax(i + 1, nxt);
          while (nxt < n) {
            if ((nxt - i) % 2 == 1 && A[nxt] < 9) {
              A[nxt]++;
              A[i]++;
              ans += nxt - i;
              int tmp = nxt;
              while (tmp > i && res.size() < MAX) {
                if ((tmp - i) % 2 == 1)
                  res.push_back(make_pair(tmp - 1, 1));
                else
                  res.push_back(make_pair(tmp - 1, -1));
                tmp--;
              }
              break;
            } else if ((nxt - i) % 2 == 0 && A[nxt] > 0) {
              A[nxt]--;
              A[i]++;
              ans += nxt - i;
              int tmp = nxt;
              while (tmp > i && res.size() < MAX) {
                if ((tmp - i) % 2 == 1)
                  res.push_back(make_pair(tmp - 1, 1));
                else
                  res.push_back(make_pair(tmp - 1, -1));
                tmp--;
              }
              break;
            } else {
              nxt++;
            }
          }
          if (nxt >= n) {
            cout << -1 << endl;
            return 0;
          }
        }
      }
    } else if (diff > 0) {
      for (int j = 0; j < diff; j++) {
        if (A[i + 1] > 0) {
          A[i]--;
          A[i + 1]--;
          ans++;
          if (res.size() < MAX) {
            res.push_back(make_pair(i, -1));
          }
        } else {
          nxt = mmax(i + 1, nxt);
          while (nxt < n) {
            if ((nxt - i) % 2 == 0 && A[nxt] < 9) {
              A[nxt]++;
              A[i]--;
              ans += nxt - i;
              int tmp = nxt;
              while (tmp > i && res.size() < MAX) {
                if ((tmp - i) % 2 == 0)
                  res.push_back(make_pair(tmp - 1, 1));
                else
                  res.push_back(make_pair(tmp - 1, -1));
                tmp--;
              }
              break;
            } else if ((nxt - i) % 2 == 1 && A[nxt] > 0) {
              A[nxt]--;
              A[i]--;
              ans += nxt - i;
              int tmp = nxt;
              while (tmp > i && res.size() < MAX) {
                if ((tmp - i) % 2 == 0)
                  res.push_back(make_pair(tmp - 1, 1));
                else
                  res.push_back(make_pair(tmp - 1, -1));
                tmp--;
              }
              break;
            } else {
              nxt++;
            }
          }
          if (nxt >= n) {
            cout << -1 << endl;
            return 0;
          }
        }
      }
    }
  }
  if (A[n - 1] != B[n - 1]) {
    cout << -1 << endl;
    return 0;
  } else {
    cout << ans << endl;
    for (int i = 0; i < res.size(); i++) {
      cout << res[i].first + 1 << " " << res[i].second << endl;
    }
  }
  return 0;
}
