#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< M; set S; vector V; void dfs(int mask){ if(mask==0 && V.size()==1){ ll g = __gcd(V[0].first, V[0].second); S.insert(pll(V[0].first/g,V[0].second/g)); return; } if(mask != 0){ // push REP(i,n)if((mask>>i)&1){ int nmsk = mask ^ (1<=2){ // pop pll x = V.back(); V.pop_back(); pll y = V.back(); V.pop_back(); ll xa = x.first; ll xb = x.second; ll ya = y.first; ll yb = y.second; // add { ll zb = xb*yb; ll za = xa*yb + ya*xb; V.push_back(pll(za,zb)); dfs(mask); V.pop_back(); } // sub { ll zb = xb*yb; ll za = xa*yb - ya*xb; V.push_back(pll(za,zb)); dfs(mask); V.pop_back(); } // mul { ll za = xa*ya; ll zb = xb*yb; if(zb<0){ zb*=-1; za*=-1; } V.push_back(pll(za,zb)); dfs(mask); V.pop_back(); } // div if(ya!=0){ ll za = xa*yb; ll zb = xb*ya; if(zb<0){ zb*=-1; za*=-1; } V.push_back(pll(za,zb)); dfs(mask); V.pop_back(); } V.push_back(y); V.push_back(x); } } int main(){ scanf("%d",&n); REP(i,n)scanf("%d",a+i); REP(mask,1<