#include <bits/stdc++.h>
using namespace std;
int mx = 1e5;
int n;
vector<int> a, b, temp, rem;
void dfs(int v) {
  if (v < 0 || v >= n - 1 || !rem[v]) return;
  if (rem[v] > 0) {
    if (a[v] < 9 && a[v + 1] < 9) {
      cout << v + 1 << ' ' << 1 << endl;
      mx--;
      if (!mx) exit(0);
      rem[v]--;
      a[v]++;
      a[v + 1]++;
      dfs(v - 1);
      dfs(v);
      dfs(v + 1);
    }
  } else {
    if (a[v] > 0 && a[v + 1] > 0) {
      cout << v + 1 << ' ' << -1 << endl;
      mx--;
      if (!mx) exit(0);
      rem[v]++;
      a[v]--;
      a[v + 1]--;
      dfs(v - 1);
      dfs(v);
      dfs(v + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  string s;
  a.resize(n);
  b.resize(n);
  cin >> s;
  for (int i = 0; i < n; i++) a[i] = s[i] - '0';
  cin >> s;
  for (int i = 0; i < n; i++) b[i] = s[i] - '0';
  temp = a;
  rem.assign(n, 0);
  for (int i = 0; i < n - 1; i++) {
    rem[i] = b[i] - temp[i];
    temp[i] += rem[i];
    temp[i + 1] += rem[i];
  }
  if (temp[n - 1] != b[n - 1]) {
    cout << -1 << endl;
    return 0;
  }
  long long c = 0;
  for (int i = 0; i < n - 1; i++) c += 1ll * abs(rem[i]);
  cout << c << endl;
  for (int i = 0; i < n - 1; i++) dfs(i);
}
