#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17 + 5;
const int N = 200005;
int a[N], b[N], c[N], d[N];
bool good[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  string ss, q;
  cin >> n >> ss >> q;
  for (int i = 0; i < n; ++i) a[i] = ss[i] - '0', c[i] = a[i];
  for (int i = 0; i < n; ++i) b[i] = q[i] - '0';
  long long ans = 0;
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    if (i % 2)
      sum -= a[i];
    else
      sum += a[i];
  }
  for (int i = 0; i < n; ++i) {
    if (i % 2)
      sum += b[i];
    else
      sum -= b[i];
  }
  if (sum || (!a[0] && n > 1)) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; ++i) c[i + 1] += b[i] - c[i], ans += abs(b[i] - c[i]);
  cout << ans << endl;
  vector<pair<long long, int> > v;
  stack<pair<long long, int> > s;
  s.push({0, (a[0] < b[0])});
  while (v.size() < 1e5 && s.size()) {
    int x = s.top().first;
    bool op = s.top().second;
    if (x == n) break;
    bool pr = 0;
    if (!x || good[x - 1]) pr = 1;
    if (pr) {
      bool con = 0;
      while (a[x] < b[x]) {
        if (a[x + 1] == 9) {
          s.push({x + 1, 0});
          con = 1;
          break;
        }
        v.push_back({x, 1});
        a[x]++, a[x + 1]++;
      }
      while (a[x] > b[x]) {
        if (!a[x + 1]) {
          s.push({x + 1, 1});
          con = 1;
          break;
        }
        v.push_back({x, -1});
        a[x]--, a[x + 1]--;
      }
      if (con) continue;
      good[x] = 1;
      s.pop();
      s.push({x + 1, 0});
    } else {
      if (op) {
        if (a[x + 1] == 9) {
          s.push({x + 1, 0});
          continue;
        } else {
          v.push_back({x, 1});
          a[x + 1]++, a[x]++;
        }
        s.pop();
      } else {
        if (!a[x + 1]) {
          s.push({x + 1, 1});
          continue;
        } else {
          v.push_back({x, -1});
          a[x + 1]--, a[x]--;
        }
        s.pop();
      }
    }
  }
  for (int i = 0; i < min(v.size(), (size_t)(1e5)); ++i)
    cout << v[i].first + 1 << " " << v[i].second << endl;
}
