#include <bits/stdc++.h>
const long long md = 1e9 + 7;
const int Inf = 1e9;
const long long Inf64 = 1e18;
const long long MaxN = 1005;
const long long MaxM = 1005;
const long double eps = 1e-15;
const long long dx[4] = {0, 1, 0, -1};
const long long dy[4] = {1, 0, -1, 0};
using namespace std;
long long gcd(long long a, long long b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
long long gcdex(long long a, long long mod = md) {
  long long g = mod, r = a, x = 0, y = 1;
  while (r != 0) {
    long long q = g / r;
    g %= r;
    swap(g, r);
    x -= q * y;
    swap(x, y);
  }
  return x < 0 ? x + mod : x;
}
vector<long long> A;
vector<long long> B;
vector<pair<long long, long long> > Ans;
vector<long long> Mt;
void dfs(long long v) {
  if (Mt[v + 1] > 0) {
    if (A[v + 1] == 9) dfs(v + 1);
    ++A[v];
    ++A[v + 1];
    Ans.push_back({v + 1, 1});
    --Mt[v + 1];
  } else {
    if (A[v + 1] == 0) dfs(v + 1);
    --A[v];
    --A[v + 1];
    Ans.push_back({v + 1, -1});
    ++Mt[v + 1];
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  long long N;
  cin >> N;
  A.resize(N + 1);
  B.resize(N + 1);
  long long M = 1e5;
  long long a = 0;
  long long b = 0;
  for (int i = 0; i < N; i++) {
    char c;
    cin >> c;
    c -= '0';
    A[i] = c;
    a += c * (i % 2 == 0 ? -1 : 1);
  }
  for (int i = 0; i < N; i++) {
    char c;
    cin >> c;
    c -= '0';
    B[i] = c;
    b += c * (i % 2 == 0 ? -1 : 1);
  }
  if (b != a) {
    cout << -1;
    return 0;
  }
  long long i = 0;
  long long Res = 0;
  Mt.resize(N + 1, 0);
  for (int i = 0; i < N - 1; i++) {
    long long g = B[i] - A[i] - Mt[i];
    Res += abs(g);
    Mt[i + 1] = g;
  }
  for (int i = 0; i < N - 1; i++) {
    if (Ans.size() > M) break;
    while (Mt[i + 1] != 0 && Ans.size() < M) {
      dfs(i);
    }
  }
  cout << Res << '\n';
  for (int i = 0; i < min((long long)Ans.size(), M); i++) {
    cout << Ans[i].first << ' ' << Ans[i].second << '\n';
  }
  cerr << '\n'
       << "Time execute: " << clock() / (double)CLOCKS_PER_SEC << " sec"
       << '\n';
  return 0;
}
