#include <bits/stdc++.h>
using namespace std;
const long long P = 1e9 + 7;
const int N = 1e5 + 5;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, c[N];
char a[N], b[N];
int calc(char a[], int n) {
  int res = 0;
  for (int i = (1); i <= (n); ++i) res += (i & 1) ? a[i] : -a[i];
  return res;
}
bool check(int i) {
  if (i <= 0 || i >= n) return false;
  if (c[i] < 0 && (i == 1 && a[i] > 1 || i > 1 && a[i] > 0) && a[i + 1] > 0)
    return true;
  if (c[i] > 0 && a[i] < 9 && a[i + 1] < 9) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> (a + 1) >> (b + 1);
  for (int i = (1); i <= (n); ++i) a[i] -= 48, b[i] -= 48;
  if (calc(a, n) != calc(b, n)) {
    cout << -1;
    return 0;
  }
  long long ans = 0;
  for (int i = (1); i <= (n - 1); ++i) c[i] = (b[i] - a[i]) - c[i - 1];
  for (int i = (1); i <= (n - 1); ++i) ans += 1ll * abs(c[i]);
  cout << ans << endl;
  unordered_set<int> st;
  for (int i = (1); i <= (n - 1); ++i)
    if (check(i)) st.insert(i);
  for (int i = (1); i <= (1e5); ++i) {
    if (st.empty()) break;
    int x = *st.begin();
    if (c[x] < 0)
      c[x]++, a[x]--, a[x + 1]--, cout << x << " -1\n";
    else
      c[x]--, a[x]++, a[x + 1]++, cout << x << " 1\n";
    if (!check(x)) st.erase(x);
    if (check(x - 1)) st.insert(x - 1);
    if (check(x + 1)) st.insert(x + 1);
  }
  return 0;
}
