#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << "[ ";
  for (auto e : v) os << e << " ";
  return os << "]";
}
template <typename T, typename V>
ostream& operator<<(ostream& os, set<T, V> v) {
  os << "{ ";
  for (auto e : v) os << e << " ";
  return os << "}";
}
template <typename T, typename V, typename S>
ostream& operator<<(ostream& os, map<T, V, S> v) {
  os << "{ ";
  for (auto e : v) os << e << " ";
  return os << "}";
}
template <typename T, typename V>
ostream& operator<<(ostream& os, pair<T, V> x) {
  return os << "( " << x.first << ", " << x.second << " )";
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& e : v) is >> e;
  return is;
}
template <typename T, typename V>
istream& operator>>(istream& is, pair<T, V>& x) {
  return is >> x.first >> x.second;
}
void solve();
int main() { solve(); }
int n, a[100005], b[100005], dir[100005];
ll x[100005];
void read(int x[]) {
  for (int i = 1; i <= n; ++i) {
    char c;
    scanf(" %c", &c);
    x[i] = c - '0';
  }
}
bool valid(int d) { return 0 <= d && d < 10; }
template <typename T>
int sign(T x) {
  return int(x > 0) - int(x < 0);
}
bool moveok(int i) {
  return valid(a[i] + dir[i]) && valid(a[i + 1] + dir[i]) &&
         !(i == 1 && a[i] + dir[i] == 0) && x[i] != 0;
}
void solve() {
  scanf("%d", &n);
  read(a);
  read(b);
  x[n - 1] = b[n] - a[n];
  for (int i = n - 1; i; --i) {
    x[i - 1] = b[i] - a[i] - x[i];
  }
  if (0)
    cout << "vector<int>(x + 1, x + n)"
            " = "
         << (vector<int>(x + 1, x + n)) << "\n";
  ;
  if (x[1] + 1LL * a[1] != 1LL * b[1] || b[1] == 0) {
    if (0)
      cout << "x[1] + a[1]"
              " = "
           << (x[1] + a[1]) << "\n";
    ;
    printf("-1\n");
    return;
  }
  ll c = 0;
  for (int i = 1; i < n; ++i) {
    c += abs(x[i]);
    dir[i] = sign(x[i]);
  }
  printf("%lld\n", c);
  set<int> second;
  for (int i = 1; i < n; ++i) {
    if (moveok(i)) {
      second.insert(i);
    }
  }
  int moves = 0;
  if (0)
    cout << "s"
            " = "
         << (second) << "\n";
  ;
  while (!second.empty()) {
    int i = *second.begin();
    assert(moveok(i));
    printf("%d %d\n", i, dir[i]);
    a[i] += dir[i];
    a[i + 1] += dir[i];
    x[i] -= dir[i];
    if (!moveok(i)) {
      second.erase(i);
    }
    if (i + 1 < n && moveok(i + 1)) {
      second.insert(i + 1);
    }
    if (i + 1 < n && !moveok(i + 1)) {
      second.erase(i + 1);
    }
    if (i - 1 > 0 && moveok(i - 1)) {
      second.insert(i - 1);
    }
    if (i - 1 > 0 && !moveok(i - 1)) {
      second.erase(i - 1);
    }
    ++moves;
    if (moves == (int)1e5) {
      return;
    }
  }
  assert(vector<int>(a + 1, a + 1 + n) == vector<int>(b + 1, b + 1 + n));
}
