#include <bits/stdc++.h>
using namespace std;
string a, b;
int n;
int need[100000];
queue<int> Q;
vector<pair<int, int> > sol;
int check(int u) {
  if ((u < 0) || (u >= n - 1)) return 0;
  int i = u;
  int x = a[i] - '0';
  int y = a[i + 1] - '0';
  if (need[i] == 0) return 0;
  int d = (need[i] > 0) ? 1 : -1;
  if (i == 0) {
    if (((x + d) > 0) && ((x + d) <= 9) && ((y + d) >= 0) && ((y + d) <= 9))
      Q.push(i);
  } else {
    if (((x + d) >= 0) && ((x + d) <= 9) && ((y + d) >= 0) && ((y + d) <= 9))
      Q.push(i);
  }
  return 0;
}
int check2(int u) {
  if ((u < 0) || (u >= n - 1)) return 0;
  int i = u;
  int x = a[i] - '0';
  int y = a[i + 1] - '0';
  if (need[i] == 0) return 0;
  int d = (need[i] > 0) ? 1 : -1;
  if (i == 0) {
    if (((x + d) > 0) && ((x + d) <= 9) && ((y + d) >= 0) && ((y + d) <= 9))
      return 1;
  } else {
    if (((x + d) >= 0) && ((x + d) <= 9) && ((y + d) >= 0) && ((y + d) <= 9))
      return 1;
  }
  return 0;
}
int main() {
  int i;
  cin >> n;
  cin >> a >> b;
  int c = 0;
  for (i = 0; i < n - 1; i++) {
    int x = a[i] - '0' + c;
    int y = b[i] - '0';
    need[i] = y - x, c = y - x;
  }
  int x = a[i] - '0' + c;
  int y = b[i] - '0';
  if (y - x != 0) {
    printf("-1\n");
    return 0;
  }
  long long int ans = 0;
  for (i = 0; i < n - 1; i++) ans += abs(need[i]);
  for (i = 0; i < n - 1; i++) check(i);
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    if (!check2(u)) continue;
    if (need[u] > 0) {
      a[u]++, a[u + 1]++, need[u]--;
      sol.push_back(make_pair(u, 1));
      check(u - 1), check(u), check(u + 1);
    } else if (need[u] < 0) {
      a[u]--, a[u + 1]--, need[u]++;
      sol.push_back(make_pair(u, -1));
      check(u - 1), check(u), check(u + 1);
    }
    if (sol.size() > 100005) break;
  }
  printf("%I64d\n", ans);
  for (i = 0; i < min((int)sol.size(), 100000); i++)
    printf("%d %d\n", sol[i].first + 1, sol[i].second);
  return 0;
}
