#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
bool vis[30];
long long parent[30];
vector<long long> edge[30];
void dfs(long long v, long long p) {
  parent[v] = p;
  vis[v] = true;
  for (auto u : edge[v]) {
    if (!vis[u]) dfs(u, v);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long tst = 1;
  for (long long tt = 1; tt <= tst; tt++) {
    vector<pair<char, char> > v;
    long long n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for (long long i = 0; i < n; i++) {
      edge[s[i] - 'a'].push_back(t[i] - 'a');
      edge[t[i] - 'a'].push_back(s[i] - 'a');
    }
    for (long long i = 0; i < 26; i++) parent[i] = -1;
    for (long long i = 0; i < 26; i++) {
      if (parent[i] == -1) dfs(i, -1);
    }
    for (long long i = 0; i < 26; i++)
      if (parent[i] >= 0) v.push_back({i + 'a', parent[i] + 'a'});
    cout << ((long long)(v).size()) << endl;
    for (long long i = 0; i < ((long long)(v).size()); i++)
      cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
