#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;


#define FOR(i,a,b) for(int i=a; i <=(b); i++)
#define ROF(i,a,b) for(int i=a; i >=(b); i--)
#define loop(i,a) for(int i=0; i < (a); i++)
#define rloop(i,a) for(int i=(a-1); i >= 0; i--)
#define MAX(a,b) (a < b) ? (b) : (a)
#define BIGGEST(a,b,c) (MAX(a,b) < c) ? (c) : MAX(a,b)
#define END "\n"
#define pb push_back
#define ff first
#define ss second
#define sort(a) sort(a.begin(),a.end())
 
const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;

void solve(){
    
    int n;
    cin >> n;

    map<string,ll>mp;
    string s[n];
    string ans = "satisfiable";
    loop(i,n){
        cin >> s[i];
        if(s[i][0] != '!'){
          mp[s[i]] = 1;
        }
    }

    loop(i, n) {
        if (s[i][0] == '!') {
            if (mp[s[i].substr(1, s[i].length() - 1)]) {
                ans = s[i].substr(1, s[i].length() - 1);
            }
        }
    }
    cout << ans;

}



int main() {
    
    ios_base::sync_with_stdio(false);cin.tie(NULL); 
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        freopen("error.txt","w",stderr);
    #endif

    // int t; cin >> t;

    // while(t--)
	solve();
    
        

     cerr<<"\ntime taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl; 
   return 0; 
}

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

const ll MAX_N = 1e18 + 2000;

int main () {
  ios::sync_with_stdio(false);
  
  ll n;
  cin >> n;

  ll on = n;

  vector<ll> fib = {0, 1};
  while (fib.back() < MAX_N) {
    ll a = fib.back();
    ll b = *next(fib.rbegin());
    fib.push_back(a + b);
  }

  int mx = -1;
  vector<int> decomp;
  for (int i = (int) fib.size() - 1; i > 0; i--) {
    if (n >= fib[i]) {
      decomp.push_back(i);
      n -= fib[i];
      mx = max(mx, i);
    }
  }

  if (mx % 2 == 1) {
    mx++;
  }

  vector<int> adds (mx, 0);
  for (int u : decomp) {
    adds[mx - u] = 1;
  }

  ll a = 0, b = 0;
  vector<int> sol;
  for (int i = 0; i < (int) adds.size(); i += 2) {
    if (a != 0) {
      b += a;
      sol.push_back(4);
    }
      
    if (adds[i]) {
      b++;
      sol.push_back(2);
    }

    if (b != 0) {
      a += b;
      sol.push_back(3);
    }
      
    if (adds[i + 1]) {
      a++;
      sol.push_back(1);
    }
  }

  cout << sol.size() << '\n';
  for (int o : sol) {
    cout << o << '\n';
  }
}
