#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, A[MAXN], cur;
long long ans;
char a[MAXN], b[MAXN];
inline int ff(int x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }
inline bool chkout(int x) { return !(x >= 0 && x <= 9); }
void solve(int i, int val) {
  if (cur == 100000) return;
  int k = ff(val);
  if (chkout(A[i + 1] + val)) {
    if (A[i + 1] + val > 9)
      solve(i + 1, 9 - (A[i + 1] + val));
    else
      solve(i + 1, 0 - (A[i + 1] + val));
  }
  if (cur == 100000) return;
  while (val) {
    ++cur;
    printf("%d %d\n", i, k);
    val -= k, A[i] += k, A[i + 1] += k;
    if (cur == 100000) return;
  }
}
int main() {
  scanf("%d", &n);
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  for (int i = 1; i <= n; ++i) A[i] = a[i] - '0';
  for (int i = 1; i <= n; ++i) {
    A[i + 1] += b[i] - '0' - A[i];
    ans += abs(b[i] - '0' - A[i]);
    A[i] = b[i] - '0';
  }
  if (A[n + 1])
    puts("-1");
  else {
    printf("%I64d\n", ans);
    for (int i = 1; i <= n; ++i) A[i] = a[i] - '0';
    for (int i = 1; i <= n && cur < 100000; ++i) solve(i, b[i] - '0' - A[i]);
  }
}
