#include <bits/stdc++.h>
using namespace std;
char s1[100005], s2[100005];
int opt[100005];
inline int sgn(int x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s%s", s1 + 1, s2 + 1);
  for (int i = 1; i <= n; i++) opt[i] = s2[i] - s1[i] - opt[i - 1];
  if (opt[n]) {
    puts("-1");
    return 0;
  }
  long long cnt = 0;
  for (int i = 1; i < n; i++) cnt += abs(opt[i]);
  printf("%I64d\n", cnt);
  cnt = min(cnt, (long long)1e5);
  int i = 1, j = 1;
  while (cnt--) {
    while (!opt[j]) ++i, ++j;
    while (!opt[i] || !isdigit(s1[i] + sgn(opt[i])) ||
           !isdigit(s1[i + 1] + sgn(opt[i])))
      i++;
    printf("%d %d\n", i, sgn(opt[i]));
    s1[i] += sgn(opt[i]);
    s1[i + 1] += sgn(opt[i]);
    opt[i] -= sgn(opt[i]);
    i = max(i - 1, j);
  }
  return 0;
}
