#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long a[N], b[N], cnt;
vector<pair<int, int> > ans;
void dfs(int x, int op) {
  if (op == 1) {
    if (a[x + 1] == 9) dfs(x + 1, -1);
    a[x]++, a[x + 1]++;
    if (cnt <= 1e5) ans.push_back({x, 1});
    cnt++;
    if (cnt > 1e5) return;
  } else {
    if (a[x + 1] == 0) dfs(x + 1, 1);
    a[x]--, a[x + 1]--;
    if (cnt <= 1e5) ans.push_back({x, -1});
    cnt++;
    if (cnt > 1e5) return;
  }
}
long long c[N];
int main() {
  int n;
  cnt = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%1lld", &a[i]), c[i] = a[i];
  for (int i = 1; i <= n; i++) scanf("%1lld", &b[i]);
  long long all = 0;
  for (int i = 1; i < n; i++)
    c[i + 1] -= c[i] - b[i],
        all += (long long)c[i] - b[i] >= 0 ? c[i] - b[i] : b[i] - c[i];
  if (c[n] != b[n]) return 0 * printf("-1\n");
  for (int i = 1; i < n; i++) {
    if (cnt > 1e5) break;
    while (a[i] > b[i]) {
      if (a[i + 1] == 0) dfs(i + 1, 1);
      a[i]--, a[i + 1]--;
      if (cnt <= 1e5) ans.push_back({i, -1});
      cnt++;
      if (cnt > 1e5) break;
    }
    while (a[i] < b[i]) {
      if (a[i + 1] == 9) dfs(i + 1, -1);
      a[i]++, a[i + 1]++;
      if (cnt <= 1e5) ans.push_back({i, 1});
      cnt++;
      if (cnt > 1e5) break;
    }
  }
  printf("%lld\n", all);
  for (auto i : ans) printf("%d %d\n", i.first, i.second);
  return 0;
}
