#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, a[maxn], b[maxn];
vector<pair<int, int> > ans;
long long cnt;
void solve1(int nl, int nr) {
  a[nl]--;
  if (nr - nl & 1)
    a[nr]--;
  else
    a[nr]++;
  if (ans.size() >= 1e5) return;
  for (int i = nr - 1; i >= nl; i--) {
    if (i - nl & 1)
      ans.push_back(make_pair(i, 1));
    else
      ans.push_back(make_pair(i, -1));
  }
}
void solve2(int nl, int nr) {
  a[nl]++;
  if (nr - nl & 1)
    a[nr]++;
  else
    a[nr]--;
  if (ans.size() >= 1e5) return;
  for (int i = nr - 1; i >= nl; i--) {
    if (i - nl & 1)
      ans.push_back(make_pair(i, -1));
    else
      ans.push_back(make_pair(i, 1));
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    a[i] = c - '0';
  }
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    b[i] = c - '0';
  }
  int pt1 = 0, pt2 = 0;
  for (int i = 1; i <= n; i++) {
    swap(pt1, pt2);
    pt1 = max(pt1, i + 1);
    pt2 = max(pt2, i + 1);
    while (a[i] != b[i]) {
      while (pt1 <= n &&
             (pt1 - i & 1 && a[pt1] == 0 || !(pt1 - i & 1) && a[pt1] == 9))
        pt1++;
      while (pt2 <= n &&
             (pt2 - i & 1 && a[pt2] == 9 || !(pt2 - i & 1) && a[pt2] == 0))
        pt2++;
      if (a[i] > b[i]) {
        if (pt1 > n) {
          cout << -1;
          return 0;
        }
        cnt += pt1 - i;
        solve1(i, pt1);
      } else {
        if (pt2 > n) {
          cout << -1;
          return 0;
        }
        cnt += pt2 - i;
        solve2(i, pt2);
      }
    }
  }
  cout << cnt << '\n';
  if (ans.size() > 1e5) ans.resize(1e5);
  for (pair<int, int> p : ans) cout << p.first << ' ' << p.second << '\n';
  return 0;
}
