#include <bits/stdc++.h>
using namespace std;
const long long fix = (long long)1e9 + 7;
long long po2(long long a) {
  double temp = a;
  if (log2(temp) == (long long)log2(temp)) return log2(temp);
  return -1;
}
void tc(long long i) { cout << "Case #" << i + 1 << ": "; }
void yes() { cout << "YES" << '\n'; }
void no() { cout << "NO" << '\n'; }
void impb() { cout << "IMPOSSIBLE" << '\n'; }
long long ct() {
  long long t;
  scanf("%lld", &t);
  return t;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long pwr(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2) x = (x * y) % fix;
    y = (y * y) % fix;
    b /= 2;
  }
  return x;
}
long long power(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2) x = (x * y);
    y = (y * y);
    b /= 2;
  }
  return x;
}
long long pmodinv(long long a) { return pwr(a, fix - 2); }
void error() { cerr << "Here!" << '\n'; }
vector<vector<long long> > adj;
const long long N = 1e6 + 5;
bool visited[N] = {};
queue<long long> q;
long long comanc(long long u, long long v, long long parent[]) {
  while (u ^ v) {
    if (u == 1 || v == 1) return 1;
    u = parent[u];
    v = parent[v];
  }
  return u;
}
long long x;
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
vector<long long> factorial((long long)4002);
long long nCr(long long n, long long k) {
  if (n < k) return 0;
  return (factorial[n] *
          ((pmodinv(factorial[k]) * pmodinv(factorial[n - k])) % fix)) %
         fix;
}
vector<long long> dsu_par(N);
vector<long long> sze(N);
void make_set(long long n) {
  for (long long j = (1); j < (n + 5); ++j) {
    dsu_par[j] = j;
    sze[j] = 1;
  }
}
long long find_set(long long a) {
  if (dsu_par[a] == a) return a;
  return dsu_par[a] = find_set(dsu_par[a]);
}
void union_set(long long a, long long b) {
  a = find_set(a);
  b = find_set(b);
  if (a ^ b) {
    if (sze[a] < sze[b]) swap(a, b);
    dsu_par[b] = a;
    sze[a] += sze[b];
  }
}
map<pair<long long, long long>, long long> mp;
vector<vector<long long> > up;
vector<long long> tin, tout;
long long dfs_timer = 0;
long long lim;
long long dist[N] = {};
void _dfs(long long v, long long par) {
  tin[v] = ++dfs_timer;
  up[v][0] = par;
  for (long long j = (1); j < (lim + 1); ++j)
    up[v][j] = up[up[v][j - 1]][j - 1];
  for (long long u : adj[v]) {
    if (u ^ par) {
      dist[u] = dist[v] + mp.find(pair<long long, long long>(u, v))->second;
      _dfs(u, v);
    }
  }
  tout[v] = ++dfs_timer;
}
bool is_anc(long long u, long long v) {
  return tin[u] <= tin[v] && tout[u] >= tout[v];
}
long long lca(long long u, long long v) {
  if (is_anc(u, v)) return u;
  if (is_anc(v, u)) return v;
  for (long long i = lim; i >= 0; i--)
    if (is_anc(up[u][i], v) ^ 1) u = up[u][i];
  return up[u][0];
}
int32_t main() {
  long long t = 1;
  for (long long ii = (0); ii < (t); ++ii) {
    long long n = ct();
    make_set(27);
    string v, t;
    cin >> v >> t;
    for (long long j = (0); j < (n); ++j) {
      if (v[j] != t[j]) {
        if (find_set(v[j] - 'a' + 1) != find_set(t[j] - 'a' + 1)) {
          union_set(v[j] - 'a' + 1, t[j] - 'a' + 1);
        }
      }
    }
    long long ans = 0;
    for (long long j = (1); j < (27); ++j) {
      if (dsu_par[j] == j) ans += (sze[j] - 1);
    }
    cout << ans << '\n';
    for (long long j = (1); j < (27); ++j) {
      long long comp = find_set(j);
      if (comp ^ j) {
        cout << (char)('a' + comp - 1) << " " << (char)('a' + j - 1) << '\n';
      }
    }
  }
  return 0;
}
