#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int n;
vector<int> dfs(vector<int>& v,vector<int>& ans, int idx, int sum){
  if(idx == n) return ans;
  REP(i,v.size()){
    if(v[i] > 0 && (sum-(i+1)) % (i+1) == 0){
      v[i]--;
      ans.push_back(i+1);
      vector<int> res = dfs(v, ans, idx + 1, sum - (i + 1));
      if(!res.empty()) return res;
      ans.pop_back();
      v[i]++;
    }
  }
  return vector<int>();
}

int main(){
  while(cin>>n,n){
    vector<int> v(13,0);
    int sum = 0;
    REP(i,n){
      int t; cin>>t;
      sum += t;
      v[t-1]++;
    }
    vector<int> ans;
    vector<int> res = dfs(v, ans, 0, sum);
    reverse(res.begin(), res.end());
    if(!res.empty()) debug(res.begin(), res.end());
    else cout<<"No"<<endl;
  }
  return 0;
}