#include <bits/stdc++.h>
using namespace std;
inline int rei() {
  int x;
  cin >> x;
  return x;
}
inline long long rel() {
  long long x;
  cin >> x;
  return x;
}
inline string res() {
  string x;
  cin >> x;
  return x;
}
int A[100000];
int B[100000];
int AA[100000];
int BB[100000];
vector<pair<int, bool>> Move;
int N;
void Plus(int v);
void Minus(int v);
void Plus(int v) {
  if (A[v + 1] == 9) {
    Minus(v + 1);
  }
  Move.push_back({v, true});
  if (Move.size() >= 100000) {
    return;
  }
  A[v]++;
  A[v + 1]++;
}
void Minus(int v) {
  if (A[v + 1] == 0) {
    Plus(v + 1);
  }
  Move.push_back({v, false});
  if (Move.size() >= 100000) {
    return;
  }
  A[v]--;
  A[v + 1]--;
}
void Calc() {
  N = rei();
  string S = res();
  for (int i = 0; i < N; i++) {
    A[i] = S[i] - '0';
    AA[i] = A[i];
  }
  S = res();
  for (int i = 0; i < N; i++) {
    B[i] = S[i] - '0';
    BB[i] = B[i];
  }
  int a = 0;
  int b = 0;
  long long c = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      a += A[i];
      b += B[i];
    } else {
      a -= A[i];
      b -= B[i];
    }
  }
  if (a != b) {
    cout << -1 << endl;
    return;
  }
  for (int i = 0; i < N - 1; i++) {
    if (AA[i] < BB[i]) {
      c += BB[i] - AA[i];
      AA[i + 1] += BB[i] - AA[i];
      AA[i] += BB[i] - AA[i];
    }
    if (AA[i] > BB[i]) {
      c += AA[i] - BB[i];
      AA[i + 1] -= AA[i] - BB[i];
      AA[i] -= AA[i] - BB[i];
    }
  }
  for (int i = 0; i < N - 1; i++) {
    while (A[i] < B[i]) {
      if (Move.size() >= 100000) {
        break;
      }
      Plus(i);
    }
    while (A[i] > B[i]) {
      if (Move.size() >= 100000) {
        break;
      }
      Minus(i);
    }
    if (Move.size() >= 100000) {
      break;
    }
  }
  cout << c << endl;
  for (int i = 0; i < Move.size() && i < 100000; i++) {
    cout << Move[i].first + 1 << " ";
    if (Move[i].second) {
      cout << 1 << endl;
    } else {
      cout << -1 << endl;
    }
  }
}
int main(int argc, char** argv) {
  ios::sync_with_stdio(false), cin.tie(0);
  cout.tie(0);
  Calc();
  return 0;
}
