#include <set>
#include <map>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>

using namespace std;

int main() {
#ifndef __WATASHI__
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  int n;
  vector<vector<int> > ans;

  scanf("%d", &n);
  for (int i = 0; (1 << i) < n; ++i) {
    vector<int> v;
    for (int j = 0; j < n; ++j) {
      if (j & (1 << i)) {
        v.push_back(j);
      }
    }
    ans.push_back(v);
  }

  printf("%d\n", (int)ans.size());
  for (auto& v: ans) {
    printf("%d", (int)v.size());
    for (int i: v) {
      printf(" %d", i + 1);
    }
    puts("");
  }

  return 0;
}


#define LOCAL
//#define IOAC

#ifdef IOAC
    const int BUF_SIZE = 10009 * 15 * 100;
    char pool[BUF_SIZE];
    char *buf;
#endif

/** ` Micro Mezzo Macro Flation -- Overheated Economy ., **/

#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <list>
#include <set>
#include <map>

using namespace std;

#define REP(i, n) for (int i=0;i<int(n);++i)
#define FOR(i, a, b) for (int i=int(a);i<int(b);++i)
#define DWN(i, b, a) for (int i=int(b-1);i>=int(a);--i)
#define REP_1(i, n) for (int i=1;i<=int(n);++i)
#define FOR_1(i, a, b) for (int i=int(a);i<=int(b);++i)
#define DWN_1(i, b, a) for (int i=int(b);i>=int(a);--i)
#define REP_C(i, n) for (int n____=int(n),i=0;i<n____;++i)
#define FOR_C(i, a, b) for (int b____=int(b),i=a;i<b____;++i)
#define DWN_C(i, b, a) for (int a____=int(a),i=b-1;i>=a____;--i)
#define REP_N(i, n) for (i=0;i<int(n);++i)
#define FOR_N(i, a, b) for (i=int(a);i<int(b);++i)
#define DWN_N(i, b, a) for (i=int(b-1);i>=int(a);--i)
#define REP_1_C(i, n) for (int n____=int(n),i=1;i<=n____;++i)
#define FOR_1_C(i, a, b) for (int b____=int(b),i=a;i<=b____;++i)
#define DWN_1_C(i, b, a) for (int a____=int(a),i=b;i>=a____;--i)
#define REP_1_N(i, n) for (i=1;i<=int(n);++i)
#define FOR_1_N(i, a, b) for (i=int(a);i<=int(b);++i)
#define DWN_1_N(i, b, a) for (i=int(b);i>=int(a);--i)
#define REP_C_N(i, n) for (n____=int(n),i=0;i<n____;++i)
#define FOR_C_N(i, a, b) for (b____=int(b),i=a;i<b____;++i)
#define DWN_C_N(i, b, a) for (a____=int(a),i=b-1;i>=a____;--i)
#define REP_1_C_N(i, n) for (n____=int(n),i=1;i<=n____;++i)
#define FOR_1_C_N(i, a, b) for (b____=int(b),i=a;i<=b____;++i)
#define DWN_1_C_N(i, b, a) for (a____=int(a),i=b;i>=a____;--i)

//#define ECH(it, A) for (typeof(A.begin()) it=A.begin(); it != A.end(); ++it)
#define ECH(it, A) for (__typeof(A.begin()) it=A.begin(); it != A.end(); ++it)
#define DO(n) while(n--)
#define DO_C(n) int n____ = n; while(n____--)
#define _TO(i, a, b) int s_=a<b?1:-1,b_=b+s_;for(int i=a+s_;i!=b_;i+=s_)
#define TO(i, a, b) int s_=a<b?1:-1,b_=b+s_;for(int i=a;i!=b_;i+=s_)
#define TO_1(i, a, b) int s_=a<b?1:-1,b_=b;for(int i=a;i!=b_;i+=s_)
#define SQZ(i, j, a, b) for (int i=int(a),j=int(b)-1;i<j;++i,--j)
#define SQZ_1(i, j, a, b) for (int i=int(a),j=int(b);i<=j;++i,--j)
#define REP_2(i, j, n, m) REP(i, n) REP(j, m)
#define REP_2_1(i, j, n, m) REP_1(i, n) REP_1(j, m)

#define ALL(A) A.begin(), A.end()
#define LLA(A) A.rbegin(), A.rend()
#define CPY(A, B) memcpy(A, B, sizeof(A))
#define INS(A, P, B) A.insert(A.begin() + P, B)
#define ERS(A, P) A.erase(A.begin() + P)
#define BSC(A, X) find(ALL(A), X) // != A.end()
#define CTN(T, x) (T.find(x) != T.end())
#define SZ(A) int(A.size())
#define PB push_back
#define MP(A, B) make_pair(A, B)

#define Rush int T____; RD(T____); DO(T____)

#define Display(A, n, m) {           \
	REP(i, n){		                          \
        REP(j, m) cout << A[i][j] << " ";\
		cout << endl;				\
	}						\
}

#define Display_1(A, n, m) {				\
	REP_1(i, n){		\
        REP_1(j, m) cout << A[i][j] << " ";\
		cout << endl;				\
	}						\
}

#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#define Ruby system("ruby main.rb")
#define Haskell system("runghc main.hs")
#define Python system("py main.py")
#define Pascal system("fpc main.pas")

#define fi first
#define se second

typedef long long LL;
typedef double DB;
typedef unsigned UINT;
typedef unsigned long long ULL;

typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<string> VS;
typedef vector<LL> VL;
typedef vector<DB> VD;
typedef set<int> SI;
typedef set<string> SS;
typedef set<LL> SL;
typedef set<DB> SD;
typedef map<int, int> MII;
typedef map<string, int> MSI;
typedef map<LL, int> MLI;
typedef map<DB, int> MDI;
typedef map<int, bool> MIB;
typedef map<string, bool> MSB;
typedef map<LL, bool> MLB;
typedef map<DB, bool> MDB;
typedef pair<int, int> PII;
typedef pair<int, bool> PIB;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef vector<VII> VVII;
typedef set<PII> SII;
typedef map<PII, int> MPIII;
typedef map<PII, bool> MPIIB;

/** I/O Accelerator **/

/* ... :" We are I/O Accelerator ... Use us at your own risk ;) ... " .. */

template<class T> inline void RD(T &);
template<class T> inline void OT(const T &);

//inline int RD(){ int x; RD(x); return x;}
inline LL RD(){ LL x; RD(x); return x;}
template<class T> inline T& _RD(T &x){ RD(x); return x;}
inline void RC(char &c){
#ifdef IOAC
    while (!isalnum(*buf)) ++buf;
    c = *buf++;
#else
    scanf(" %c", &c);
#endif
    }
inline char RC(){char c; RC(c); return c;}
inline char _RC(char &c){RC(c); return c;}
inline void RF(DB &x){scanf("%lf", &x);};
inline DB RF(){DB x; RF(x); return x;}
inline DB _RF(DB &x){RD(x); return x;}
inline void RS(char *s){scanf("%s", s);}
inline char* _RS(char *s){scanf("%s", s); return s;}

template<class T0, class T1> inline void RD(T0 &x0, T1 &x1){RD(x0), RD(x1);}
template<class T0, class T1, class T2> inline void RD(T0 &x0, T1 &x1, T2 &x2){RD(x0), RD(x1), RD(x2);}
template<class T0, class T1, class T2, class T3> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3){RD(x0), RD(x1), RD(x2), RD(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RD(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){RD(x0), RD(x1), RD(x2), RD(x3), RD(x4), RD(x5), RD(x6);}
template<class T0, class T1> inline void OT(T0 &x0, T1 &x1){OT(x0), OT(x1);}
template<class T0, class T1, class T2> inline void OT(T0 &x0, T1 &x1, T2 &x2){OT(x0), OT(x1), OT(x2);}
template<class T0, class T1, class T2, class T3> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3){OT(x0), OT(x1), OT(x2), OT(x3);}
template<class T0, class T1, class T2, class T3, class T4> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void OT(T0 &x0, T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5, T6 &x6){OT(x0), OT(x1), OT(x2), OT(x3), OT(x4), OT(x5), OT(x6);}

inline void RF(DB &a, DB &b){RF(a), RF(b);}
inline void RF(DB &a, DB &b, DB &c){RF(a), RF(b), RF(c);}

inline void RS(char *s1, char *s2){RS(s1), RS(s2);}
inline void RS(char *s1, char *s2, char *s3){RS(s1), RS(s2), RS(s3);}

template<class T> inline void RST(T &A){memset(A, 0, sizeof(A));}
template<class T0, class T1> inline void RST(T0 &A0, T1 &A1){RST(A0), RST(A1);}
template<class T0, class T1, class T2> inline void RST(T0 &A0, T1 &A1, T2 &A2){RST(A0), RST(A1), RST(A2);}
template<class T0, class T1, class T2, class T3> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3){RST(A0), RST(A1), RST(A2), RST(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void RST(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){RST(A0), RST(A1), RST(A2), RST(A3), RST(A4), RST(A5), RST(A6);}

template<class T> inline void CLR(priority_queue<T, vector<T>, less<T> > &Q){
    while (!Q.empty()) Q.pop();
}

template<class T> inline void CLR(priority_queue<T, vector<T>, greater<T> > &Q){
    while (!Q.empty()) Q.pop();
}

template<class T> inline void CLR(T &A){A.clear();}
template<class T0, class T1> inline void CLR(T0 &A0, T1 &A1){CLR(A0), CLR(A1);}
template<class T0, class T1, class T2> inline void CLR(T0 &A0, T1 &A1, T2 &A2){CLR(A0), CLR(A1), CLR(A2);}
template<class T0, class T1, class T2, class T3> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3){CLR(A0), CLR(A1), CLR(A2), CLR(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void CLR(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){CLR(A0), CLR(A1), CLR(A2), CLR(A3), CLR(A4), CLR(A5), CLR(A6);}
template<class T> inline void CLR(T &A, int n){REP(i, n) CLR(A[i]);}
template<class T> inline void FLC(T &A, int x){memset(A, x, sizeof(A));}
template<class T0, class T1> inline void FLC(T0 &A0, T1 &A1, int x){FLC(A0, x), FLC(A1, x);}
template<class T0, class T1, class T2> inline void FLC(T0 &A0, T1 &A1, T2 &A2){FLC(A0), FLC(A1), FLC(A2);}
template<class T0, class T1, class T2, class T3> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3){FLC(A0), FLC(A1), FLC(A2), FLC(A3);}
template<class T0, class T1, class T2, class T3, class T4> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4);}
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5);}
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void FLC(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6){FLC(A0), FLC(A1), FLC(A2), FLC(A3), FLC(A4), FLC(A5), FLC(A6);}

template<class T> inline void SRT(T &A){sort(ALL(A));}
template<class T, class C> inline void SRT(T &A, C B){sort(ALL(A), B);}

/** Add - On **/

const int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const DB EPS = 1e-6;
const DB OO = 1e15;
const DB PI = acos(-1.0); //M_PI;

// <<= ` 0. Daily Use .,

template<class T> inline void checkMin(T &a,const T b){if (b<a) a=b;}
template<class T> inline void checkMax(T &a,const T b){if (b>a) a=b;}
template <class T, class C> inline void checkMin(T& a, const T b, C c){if (c(b,a)) a = b;}
template <class T, class C> inline void checkMax(T& a, const T b, C c){if (c(a,b)) a = b;}
template<class T> inline T min(T a, T b, T c){return min(min(a, b), c);}
template<class T> inline T max(T a, T b, T c){return max(max(a, b), c);}
template<class T> inline T min(T a, T b, T c, T d){return min(min(a, b), min(c, d));}
template<class T> inline T max(T a, T b, T c, T d){return max(max(a, b), max(c, d));}
template<class T> inline T sqr(T a){return a*a;}
template<class T> inline T cub(T a){return a*a*a;}
int Ceil(int x, int y){return (x - 1) / y + 1;}

// <<= ' A. Random Event ..

inline int rand32(){return (bool(rand() & 1) << 30) | (rand() << 15) + rand();}
inline int random32(int l, int r){return rand32() % (r - l + 1) + l;}
inline int random(int l, int r){return rand() % (r - l + 1) + l;}
int dice(){return rand() % 6;}
bool coin(){return rand() % 2;}

// <<= ' 0. I/O Accelerator interface .,

template<class T> inline void RD(T &x){
#ifdef IOAC
    while (!isdigit(*buf)) ++buf; x = 0;
    while (isdigit(*buf)) x = x * 10 + *buf++ - '0';
#else
    //cin >> x;
    //scanf("%d", &x);
    char c; for (c = getchar(); c < '0'; c = getchar()); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';
    //char c; c = getchar(); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';
#endif
}

int ____Case;
template<class T> inline void OT(const T &x){
    //if (x == -1) printf("Case %d: NO\n", ++____Case);
    //else printf("Case %d: %d\n", ++____Case, x);
    //printf("%I64d ", x);
    printf("%d\n", x);
    //cout << x << endl;
}

/* .................................................................................................................................. */

const int N = 10009;

int A[N], C[N], CC[N];
vector<VI> res;
int n;

bool cc(){
    bool flag = true;
    RST(C); REP_1(i, n){
        if (C[A[i]]) flag = false;
        ++C[A[i]];
    }
    return flag;
}

int main(){

//#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
//#endif
#ifdef IOAC
    fread(buf = pool, 1, sizeof pool, stdin);
#endif

    RD(n);

    REP_1(i, n) A[i] = 1;
    int l = 1, r = 1;

    while (true){
        if (cc()) break;
        VI L;
        FOR_1(i, l, r) CC[i] = C[i] / 2;

        /*FOR_1(i, l, r) cout << C[i] << " ";
        cout << endl;*/

#define Ai A[i]
        REP_1(i, n){

            if (--C[Ai] < CC[Ai]){
                L.PB(i);
                Ai *= 2, ++Ai;
            }
            else {
                Ai *= 2;
            }
        }
        res.PB(L);

        /*REP_1(i, n) cout << A[i] << " ";
        cout << endl;*/
        l *= 2, r = r * 2 + 1;
    }

    cout << SZ(res) << endl;
    REP(i, SZ(res)){
        cout << SZ(res[i]) << " ";
        REP(j, SZ(res[i])) cout << res[i][j] << " ";
        cout << endl;
    }

    //C(n, 2)
    // (n/2) * (n/2)
    // [1 2 3 4] [5 6 7 8]

    // [1 2 5 6] [3 4 7 8]
    // [1 3 5 7]

    // [1 2][3 4][5 6][ 7 8]

    // [1 3 5 7] [2 4 6 8]
    // [1 4 7

}


#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <cstring>

using namespace std;

int n ;
vector< vector<int> > v ;

int f(int x){
    if (x==2) return 1 ;
    int nxt = (x&1) ? (x+1)/2 : x/2 ;
    return f(nxt)+1 ;
}

void get(int l,int r,int deep){
    int mid = (l+r)>>1 ;
    for (int i=l;i<=mid;i++) v[deep].push_back(i);
    if (l==r) return  ;
    get(l,mid,deep+1);
    get(mid+1,r,deep+1) ;
}

int main(){
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    scanf("%d",&n) ;
    printf("%d\n",f(n));
    v.resize(f(n)+1) ;
    get(1,n,0) ;
    int x = f(n) ;
    for (int i = 0 ; i < x ; i++){
        printf("%d ",v[i].size()) ;
        for (int j = 0 ; j < v[i].size() ; j++)
            printf("%d ",v[i][j]);
        printf("\n");
    }
    return 0;
}


#include <iostream>
using namespace std;

int main()  {
    int n;
    cin >> n;
    int k = 0;
    while((1 << k) < n) {
        k ++;
    }
    cout << k << endl;
    for(int i = 0; i < k; ++i ) {
        int count = 0;
        for(int j = 0; j < n; j++) {
            if(j & (1 << i)) {
                count ++;
            }
        }
        cout << count ;
        for(int j = 0; j < n; j++) {
            if(j & (1 << i)) {
                cout << " " << j ;
            }
        }
        cout << endl;
    }
    return 0;
}


#include <iostream>
using namespace std;

int main()  {
    int n;
    cin >> n;
    int k = 0;
    while((1 << k) < n) {
        k ++;
    }
    cout << k << endl;
    for(int i = 0; i < k; ++i ) {
        int count = 0;
        for(int j = 0; j < n; j++) {
            if(j & (1 << i)) {
                count ++;
            }
        }
        cout << count ;
        for(int j = 0; j < n; j++) {
            if(j & (1 << i)) {
                cout << " " << j ;
            }
        }
        cout << endl;
    }
}


#include <iostream>
#include <cstdio>
using namespace std;

int main()  {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    int k = 0;
    while((1 << k) < n) {
        k ++;
    }
    cout << k << endl;
    for(int i = 0; i < k; ++i ) {
        int count = 0;
        for(int j = 0; j < n; j++) {
            if(j & (1 << i)) {
                count ++;
            }
        }
        cout << count ;
        for(int j = 0; j < n; j++) {
            if(j & (1 << i)) {
                cout << " " << j ;
            }
        }
        cout << endl;
    }
    return 0;
}


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

using namespace std;

int main()
{
   int n;
   cin >> n;
   int ans = 0;
   while(n > (1 << ans)) ++ans;
   cout << ans << endl;

   bool p[100] = {false};
   for(int i = ans-1; i >= 0; --i){
      int skip = (1 << i);
      for(int j = 0; j < n; j += 2*skip){
         for(int k = 0; k < skip; ++k){
            p[j+k] ^= true;
         }
      }
      vector<int> v;
      for(int j = 0; j < n; ++j)
         if(p[j]) v.push_back(j+1);
      cout << v.size();
      for(int j = 0; j < v.size(); ++j)
         cout << ' ' << v[j];
      cout << endl;
   }

   return 0;
}


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

using namespace std;

int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);

int n;
   cin >> n;
   int ans = 0;
   while(n > (1 << ans)) ++ans;
   cout << ans << endl;

   bool p[10000] = {false};
   for(int i = ans-1; i >= 0; --i){
      int skip = (1 << i);
      for(int j = 0; j < n; j += 2*skip){
         for(int k = 0; k < skip; ++k){
            p[j+k] ^= true;
         }
      }
      vector<int> v;
      for(int j = 0; j < n; ++j)
         if(p[j]) v.push_back(j+1);
      cout << v.size();
      for(int j = 0; j < v.size(); ++j)
         cout << ' ' << v[j];
      cout << endl;
   }

   return 0;
}


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

using namespace std;

int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);

int n;
   cin >> n;
   int ans = 0;
   while(n > (1 << ans)) ++ans;
   cout << ans << endl;

   bool p[100] = {false};
   for(int i = ans-1; i >= 0; --i){
      int skip = (1 << i);
      for(int j = 0; j < n; j += 2*skip){
         for(int k = 0; k < skip; ++k){
            p[j+k] ^= true;
         }
      }
      vector<int> v;
      for(int j = 0; j < n; ++j)
         if(p[j]) v.push_back(j+1);
      cout << v.size();
      for(int j = 0; j < v.size(); ++j)
         cout << ' ' << v[j];
      cout << endl;
   }

   return 0;
}


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

using namespace std;

int main()
{
freopen(stdin, "r", "input.txt");
freopen(stdout, "w", "output.txt");

int n;
   cin >> n;
   int ans = 0;
   while(n > (1 << ans)) ++ans;
   cout << ans << endl;

   bool p[100] = {false};
   for(int i = ans-1; i >= 0; --i){
      int skip = (1 << i);
      for(int j = 0; j < n; j += 2*skip){
         for(int k = 0; k < skip; ++k){
            p[j+k] ^= true;
         }
      }
      vector<int> v;
      for(int j = 0; j < n; ++j)
         if(p[j]) v.push_back(j+1);
      cout << v.size();
      for(int j = 0; j < v.size(); ++j)
         cout << ' ' << v[j];
      cout << endl;
   }

   return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <time.h>
#include <vector>

#if LOCAL
	#define DO_NOT_SEND
#endif

typedef long long LL;

int IntMaxVal = (int) 1e20;
int IntMinVal = (int) -1e20;
LL LongMaxVal = (LL) 1e20;
LL LongMinVal = (LL) -1e20;

#define FOR(i, a, b) for(int i = a; i < b ; ++i)
#define FORD(i, a, b) for(int i = a; i >= b; --i)

#define minimize(a, b) { a = min(a, b); }
#define maximize(a, b) { a = max(a, b); }

#define all(v) v.begin(),v.end()

using namespace std;

#define next(type, i) type i; cin >> i;
template<typename T> struct argument_type;
template<typename T, typename U> struct argument_type<T(U)> { typedef U type; };
#define nextVector(t, v, size) vector< argument_type<void(t)>::type > v(size); { for (int i = 0 ; i < size ; i++) cin >> v[i]; }

template <typename T1, typename T2>
istream& operator >>(istream& is, pair<T1, T2>& s)
{
    is >> s.first >> s.second;
    return is;
}

int main() {
	srand (time(NULL));
    ios_base::sync_with_stdio(false);

    #ifdef ONLINE_JUDGE
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	#endif

	next(int, n);
	int full = 2;
	int x = 1;
	while (full < n) full *= 2, x++;

	vector<int> players(full, -1);
	FOR (i, 0, n) players[i] = i + 1;

	cout << x << endl;
	vector<int> team;
	for (int period = full ; period > 1; period /= 2) {
		team.clear();
		FOR (i, 0, full) if (i % period / (period / 2) == 0 && players[i] != -1) team.push_back(players[i]);

		cout << team.size();
		for (int p : team) cout << ' ' << p;
		cout << endl;
	}
}


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

using namespace std;

int N;
int log(int x){
	int ret = 0;

	int t = x;
	while(t > 1)ret++, t >>= 1;

	if((x & (x - 1)) == 0)return ret;
	else return ret + 1;
}

void get(vector<pair<int, int>> p){
	vector<pair<int, int>> p2;

	int firstTeam = 0;
	for(auto range : p)
		firstTeam += (range.second - range.first + 1 + 1) / 2;

	cout << firstTeam;
	for(auto range : p){
		if(range.first != (range.first + range.second) / 2)
			p2.push_back({range.first, (range.first + range.second) / 2});
		if((range.first + range.second) / 2 + 1 != range.second)
			p2.push_back({(range.first + range.second) / 2 + 1, range.second});

		for(int x = range.first; x <= (range.first + range.second) / 2; x++)
			cout << " " << x;
	}
	cout << endl;

	if(p2.size() > 0)get(p2);
}

int main(){
	freopen ("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);

	cin >> N;

	cout << log(N) << endl;

	vector<pair<int, int>> p;
	p.push_back({1, N});

	get(p);

	return 0;
}


#include <iostream>
#include <algorith>
#include <vector>

using namespace std;

int N;
int log(int x){
	int ret = 0;

	int t = x;
	while(t > 1)ret++, t >>= 1;

	if((x & (x - 1)) == 0)return ret;
	else return ret + 1;
}

void get(vector<pair<int, int>> p){
	vector<pair<int, int>> p2;

	int firstTeam = 0;
	for(auto range : p)
		firstTeam += (range.second - range.first + 1 + 1) / 2;

	cout << firstTeam;
	for(auto range : p){
		if(range.first != (range.first + range.second) / 2)
			p2.push_back({range.first, (range.first + range.second) / 2});
		if((range.first + range.second) / 2 + 1 != range.second)
			p2.push_back({(range.first + range.second) / 2 + 1, range.second});

		for(int x = range.first; x <= (range.first + range.second) / 2; x++)
			cout << " " << x;
	}
	cout << endl;

	if(p2.size() > 0)get(p2);
}

int main(){
	freopen ("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);

	cin >> N;

	cout << log(N) << endl;

	vector<pair<int, int>> p;
	p.push_back({1, N});

	get(p);

	return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int N;
int log(int x){
	int ret = 0;

	int t = x;
	while(t > 1)ret++, t >>= 1;

	if((x & (x - 1)) == 0)return ret;
	else return ret + 1;
}

void get(vector<pair<int, int>> p){
	vector<pair<int, int>> p2;

	int firstTeam = 0;
	for(auto range : p)
		firstTeam += (range.second - range.first + 1 + 1) / 2;

	cout << firstTeam;
	for(auto range : p){
		if(range.first != (range.first + range.second) / 2)
			p2.push_back({range.first, (range.first + range.second) / 2});
		if((range.first + range.second) / 2 + 1 != range.second)
			p2.push_back({(range.first + range.second) / 2 + 1, range.second});

		for(int x = range.first; x <= (range.first + range.second) / 2; x++)
			cout << " " << x;
	}
	cout << endl;

	if(p2.size() > 0)get(p2);
}

int main(){
	freopen ("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);

	cin >> N;

	cout << log(N) << endl;

	vector<pair<int, int>> p;
	p.push_back({1, N});

	get(p);

	return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cstdio>

using namespace std;

void p(vector <pair<int,int> > a)
{
    int now = 1;
    vector <int> t;
    for (int i = 0; i < a.size(); ++i, now = 1 - now)
        for (int j = a[i].first; j <= a[i].second; ++j)
            if (now)
                t.push_back(j + 1);
    cout << t.size() << " ";
    for (int i = 0; i < t.size(); ++i)
        cout << t[i] << " ";
    cout << endl;
}

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    vector <pair<int,int> > a;
    vector <pair<int,int> > b;
    a.push_back(make_pair(0, n-1));
    int total = 0;
    for (int i = 1; i < n; i <<=1)
        total ++;
    cout << total << endl;
    for (int i = 1; i < n; i <<=1)
    {
        b.clear();
         for (int j = 0; j < a.size(); ++j)
         {
             int d = (a[j].second + a[j].first) / 2;
             if (a[j].second < a[j].first)
                 continue;
             b.push_back(make_pair(a[j].first, d));
             b.push_back(make_pair(d+1, a[j].second));
         }
        a = b;
        p(a);
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>

using namespace std;

void p(vector <pair<int,int> > a)
{
    int now = 1;
    vector <int> t;
    for (int i = 0; i < a.size(); ++i, now = 1 - now)
        for (int j = a[i].first; j <= a[i].second; ++j)
            if (now)
                t.push_back(j + 1);
    cout << t.size() << " ";
    for (int i = 0; i < t.size(); ++i)
        cout << t[i] << " ";
    cout << endl;
}

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    vector <pair<int,int> > a;
    vector <pair<int,int> > b;
    a.push_back(make_pair(0, n-1));
    for (int i = 1; i < n; i <<=1)
    {
        b.clear();
         for (int j = 0; j < a.size(); ++j)
         {
             int d = (a[j].second + a[j].first) / 2;
             if (a[j].second < a[j].first)
                 continue;
             b.push_back(make_pair(a[j].first, d));
             b.push_back(make_pair(d+1, a[j].second));
         }
        a = b;
        p(a);
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cstdio>

using namespace std;

void p(vector <pair<int,int> > a)
{
    int now = 1;
    vector <int> t;
    for (int i = 0; i < a.size(); ++i, now = 1 - now)
        for (int j = a[i].first; j <= a[i].second; ++j)
            if (now)
                t.push_back(j + 1);
    cout << t.size() << " ";
    for (int i = 0; i < t.size(); ++i)
        cout << t[i] << " ";
    cout << endl;
}

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    vector <pair<int,int> > a;
    vector <pair<int,int> > b;
    a.push_back(make_pair(0, n-1));
    for (int i = 1; i < n; i <<=1)
    {
        b.clear();
         for (int j = 0; j < a.size(); ++j)
         {
             int d = (a[j].second + a[j].first) / 2;
             if (a[j].second < a[j].first)
                 continue;
             b.push_back(make_pair(a[j].first, d));
             b.push_back(make_pair(d+1, a[j].second));
         }
        a = b;
        p(a);
    }

    return 0;
}


#include<set>
#include<cmath>
#include<stack>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<numeric>
#include<vector>
#include<ctime>
#include<queue>
#include<list>
#include<map>
#define pi acos(-1)
#define INF 0x7fffffff
#define clr(x)  memset(x,0,sizeof(x));
#define clrto(x,siz,y)  for(int xx=0;xx<=siz;xx++)  x[xx]=y;
#define clrset(x,siz)  for(int xx=0;xx<=siz;xx++)  x[xx]=xx;
#define clrvec(x,siz) for(int xx=0;x<=siz;xx++)  x[xx].clear();
#define fop   freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define myprogram By_135678942570
#define clrcpy(x,siz,y)  for(int xx=0;xx<siz;xx++)  x[xx]=y[xx];
using namespace std;
main()
{
     fop;
     int n;
     while(scanf("%d",&n)!=EOF)
     {
         int num[1033]={0};
         clrset(num,n);
         int xx=n-1;
         int cnt=0;
         n=1;
         while(xx)
         {
             cnt++;
             xx>>=1;
             n*=2;
         }
         printf("%d\n",cnt);
         int t=n/2;
        // printf("%d\n",(int)log2((double)n));
         printf("%d",t);
         for(int i=1;i<=n/2;i++)
            printf(" %d",i);
         puts("");
         while(t>1)
         {
            int cnt=0;
            for(int i=1;i<=n/2;i++)
            {
                if(i%t==0||i%t>t/2)
                {
                   swap(num[i],num[i+n/2]);
                }
                if(num[i])
                   cnt++;
            }
            t=t>>1;
            printf("%d",cnt);
            for(int i=1;i<=n/2;i++)
               if(num[i]!=0)  printf(" %d",num[i]);
            puts("");
         }
       //  puts("");
     }
     return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>

using namespace std;

int ans = -1;
vector <int> res[1000];

void solve (int l, int r, int k) {
    if (l == r) return;
    ans = max (ans, k + 1);
    if (l == r - 1) {
          res[k].push_back (l);
    }
    else {
         int m = (l + r) / 2;
         for (int i = l; i <= m; ++i) res[k].push_back (i);
         solve (l, m, k + 1);
         solve (m + 1, r, k + 1);
    }
}

int main () {
    freopen ("input.txt", "r", stdin);
    freopen ("output.txt", "w", stdout);
    int n;
    cin >> n;
    solve (0, n - 1, 0);
    cout << ans << "\n";
    for (int i = 0; i < ans ; ++i) {
        cout << res[i].size () << " ";
        for (int j = 0; j < res[i].size (); ++j) {
            cout << res[i][j] + 1 << " ";
        }
        cout << "\n";
    }
}


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

#define F first
#define LET(x, a)  __typeof(a) x(a)
#define tr(v, it) for(LET(it, v.begin()); it != v.end(); it++)
#define S second
#define PB push_back
#define MP make_pair
#define INF 1000000000
#define MOD 1000000007
#define LL long long int
#define ULL unsigned LL
#define PII pair<int, int>

vector<vector<int> > ans;
void getans(int st, int en, int cdep = 0) {
    if (st > en || st == en)
        return;
    int mid = (st + en) / 2, i;
    if (cdep >= (int)ans.size()) {
        ans.resize(cdep + 1);
    }
    for (i = st; i <= mid; i++) {
        ans[cdep].PB(i);
    }
    getans(st, mid, cdep + 1);
    getans(mid + 1, en, cdep + 1);
}
int main() {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    getans(1, n);
    cout << ans.size() << endl;
    for (int i = 0; i < (int)ans.size(); i++) {
        cout << ans[i].size() << " ";
        for (int j = 0; j < (int)ans[i].size(); j++) {
            cout << ans[i][j] << " ";
        }
        cout << endl;
    }
    return 0;
}


#include <fstream>
#include <vector>

using namespace std;

const char iname[] = "input.txt";
const char oname[] = "output.txt";

ifstream f(iname);
ofstream g(oname);

int main() {
	int N, K;
    f >> N; K = 2;

	int answer = 0;
	int auxN = N;

	while (auxN > 1) {
		++answer;
		if (auxN % K)
			auxN = auxN / K + 1;
		else
			auxN /= K;
	}

	g << answer << "\n";

	vector<int> a(N), b;
	for (int i = 0; i < N; ++i)
		a[i] = i + 1;

	for (int i = 1; i <= answer; ++i) {
		swap(a, b);
		vector<int>().swap(a);

		for (int j = 0; j < K; ++j) {

            if (j == 0) {
			    if (j < N % K)
				    g << N / K + 1 << " ";
			    else
				    g << N / K << " ";
            }

			for (int k = j; k < N; k += K) {
        		a.push_back(b[k]);
                if (j == 0) {
				    g << b[k] << " ";
                }
			}

			if (j == 0)
                g << "\n";
		}
	}
}


#include <cassert>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <complex>
using namespace std;

// begin insert defines
typedef vector<int> VRI;
#define Rep(i,n) for(int n_ = (n), i = 0; i< n_; ++i)
template <class T> void PV(T x) {for(__typeof__((x).begin()) i = (x).begin(); i != (x).end(); i++) cout << *i << " "; cout << endl;}
#define PB push_back
#define VR vector

// end insert defines

typedef VRI Group;

bool checkEnd(VR<Group> &groups)
{
  for (auto &g: groups)
    if (g.size() > 1u)
      return false;
  return true;
}

int main(int argc, char *argv[])
{
  freopen("input.txt", stdin);
  freopen("output.txt", stdout);
  int n;
  VR<Group> groups;
  cin >> n;
  Group firstGroup;
  Rep(i, n) firstGroup.PB(i);
  groups.PB(firstGroup);

  VR<Group> ans;
  while (!checkEnd(groups)) {
    VR<Group> newGroups;
    Group ret;
    for (auto &group: groups) {
      Group g1, g2;
      int t = 0;
      for (auto &e: group) {
        if (!t) {
          g1.PB(e);
          ret.PB(e + 1);
        }
        else g2.PB(e);
        t ^= 1;
      }
      if (g1.size() > 1)
        newGroups.PB(g1);
      if (g2.size() > 1)
        newGroups.PB(g2);
    }
    ans.PB(ret);
    groups = newGroups;
  }
  cout << ans.size() << endl;
  for (auto &ai: ans) {
    cout << ai.size();
    for (auto &gi: ai)
      cout << " " << gi;
    cout << endl;
  }
  return 0;
}


#include <cassert>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <complex>
using namespace std;

// begin insert defines
typedef vector<int> VRI;
#define Rep(i,n) for(int n_ = (n), i = 0; i< n_; ++i)
template <class T> void PV(T x) {for(__typeof__((x).begin()) i = (x).begin(); i != (x).end(); i++) cout << *i << " "; cout << endl;}
#define PB push_back
#define VR vector

// end insert defines

typedef VRI Group;

bool checkEnd(VR<Group> &groups)
{
  for (auto &g: groups)
    if (g.size() > 1u)
      return false;
  return true;
}

int main(int argc, char *argv[])
{
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  int n;
  VR<Group> groups;
  cin >> n;
  Group firstGroup;
  Rep(i, n) firstGroup.PB(i);
  groups.PB(firstGroup);

  VR<Group> ans;
  while (!checkEnd(groups)) {
    VR<Group> newGroups;
    Group ret;
    for (auto &group: groups) {
      Group g1, g2;
      int t = 0;
      for (auto &e: group) {
        if (!t) {
          g1.PB(e);
          ret.PB(e + 1);
        }
        else g2.PB(e);
        t ^= 1;
      }
      if (g1.size() > 1)
        newGroups.PB(g1);
      if (g2.size() > 1)
        newGroups.PB(g2);
    }
    ans.PB(ret);
    groups = newGroups;
  }
  cout << ans.size() << endl;
  for (auto &ai: ans) {
    cout << ai.size();
    for (auto &gi: ai)
      cout << " " << gi;
    cout << endl;
  }
  return 0;
}


#include <cassert>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <complex>
using namespace std;

// begin insert defines
typedef vector<int> VRI;
#define Rep(i,n) for(int n_ = (n), i = 0; i< n_; ++i)
template <class T> void PV(T x) {for(__typeof__((x).begin()) i = (x).begin(); i != (x).end(); i++) cout << *i << " "; cout << endl;}
#define PB push_back
#define VR vector

// end insert defines

typedef VRI Group;

bool checkEnd(VR<Group> &groups)
{
  for (auto &g: groups)
    if (g.size() != 1u)
      return false;
  return true;
}

int main(int argc, char *argv[])
{
  int n;
  VR<Group> groups;
  cin >> n;
  Group firstGroup;
  Rep(i, n) firstGroup.PB(i);
  groups.PB(firstGroup);

  VR<Group> ans;
  while (!checkEnd(groups)) {
    VR<Group> newGroups;
    Group ret;
    for (auto &group: groups) {
      Group g1, g2;
      int t = 0;
      for (auto &e: group) {
        if (t) {
          g1.PB(e);
          ret.PB(e + 1);
        }
        else g2.PB(e);
        t ^= 1;
      }
      if (g1.size())
        newGroups.PB(g1);
      if (g2.size())
        newGroups.PB(g2);
    }
    ans.PB(ret);
    groups = newGroups;
  }
  cout << ans.size() << endl;
  for (auto &ai: ans) {
    cout << ai.size() << " ";
    PV(ai);
  }
  return 0;
}


#include <cassert>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <complex>
using namespace std;

// begin insert defines
typedef vector<int> VRI;
#define Rep(i,n) for(int n_ = (n), i = 0; i< n_; ++i)
template <class T> void PV(T x) {for(__typeof__((x).begin()) i = (x).begin(); i != (x).end(); i++) cout << *i << " "; cout << endl;}
#define PB push_back
#define VR vector

// end insert defines

typedef VRI Group;

bool checkEnd(VR<Group> &groups)
{
  for (auto &g: groups)
    if (g.size() > 1u)
      return false;
  return true;
}

int main(int argc, char *argv[])
{
  int n;
  VR<Group> groups;
  cin >> n;
  Group firstGroup;
  Rep(i, n) firstGroup.PB(i);
  groups.PB(firstGroup);

  VR<Group> ans;
  while (!checkEnd(groups)) {
    VR<Group> newGroups;
    Group ret;
    for (auto &group: groups) {
      Group g1, g2;
      int t = 0;
      for (auto &e: group) {
        if (t) {
          g1.PB(e);
          ret.PB(e + 1);
        }
        else g2.PB(e);
        t ^= 1;
      }
      if (g1.size() > 1)
        newGroups.PB(g1);
      if (g2.size() > 1)
        newGroups.PB(g2);
    }
    ans.PB(ret);
    groups = newGroups;
  }
  cout << ans.size() << endl;
  for (auto &ai: ans) {
    cout << ai.size();
    for (auto &gi: ai)
      cout << " " << gi;
    cout << endl;
  }
  return 0;
}


#include <cassert>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <complex>
using namespace std;

// begin insert defines
#define Rep(i,n) for(int n_ = (n), i = 0; i< n_; ++i)
template <class T> void PV(T x) {for(__typeof__((x).begin()) i = (x).begin(); i != (x).end(); i++) cout << *i << " "; cout << endl;}
#define PB push_back
#define VR vector

// end insert defines

bool checkEnd(set<set<int> > &groups)
{
  for (auto &g: groups)
    if (g.size() != 1u)
      return false;
  return true;
}

int main(int argc, char *argv[])
{
  int n;
  set<set<int> > groups;
  cin >> n;
  set<int> firstGroup;
  Rep(i, n) firstGroup.insert(i);
  groups.insert(firstGroup);

  VR<set<int> > ans;
  while (!checkEnd(groups)) {
    set<set<int> > newGroups;
    set<int> ret;
    for (auto &group: groups) {
      set<int> g1, g2;
      int t = 0;
      for (auto &e: group) {
        if (t) {
          g1.insert(e);
          ret.insert(e + 1);
        }
        else g2.insert(e);
        t ^= 1;
      }
      if (g1.size())
        newGroups.insert(g1);
      if (g2.size())
        newGroups.insert(g2);
    }
    ans.PB(ret);
    groups = newGroups;
  }
  cout << ans.size() << endl;
  for (auto &ai: ans) {
    cout << ai.size() << " ";
    PV(ai);
  }
  return 0;
}


/*
  Vishal Shrivastava
  i_am_kirito
*/
#include <bits/stdc++.h>
using namespace std;
#define minpq priority_queue <int, vector<int>, greater<int> >
#define maxpq  priority_queue <int>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
const int mod = 1e9+7, N = 4e5 + 10;
void solve()
{
  int n;
  cin>>n;

  pair<long double,int> t;
  vector<pair<long double,int>> v;

  for(int i=0;i<n;i++)
  {
     int x;
     cin>>x;
    t={x,1};
    while(!v.empty())
    {

      auto k=v.back();
      if(t.F<k.F)
      {
        v.pop_back();
        t.F=(t.F*t.S+k.F*k.S)/(t.S+k.S);
        t.S+=k.S;
      }
      else
      {
        break;
      }
    }
    v.pb(t);
  }
  cout<<setprecision(14)<<fixed;
  for(auto x:v)
  {
    for(int i=0;i<x.S;i++)
    {
      cout<<x.F<<"\n";
    }
  }
  return;
}

int32_t main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int test=1;
  //cin>>test;
  while(test--)
  {
    solve();
  }
}


/*
  Vishal Shrivastava
  i_am_kirito
*/
#include <bits/stdc++.h>
using namespace std;
#define minpq priority_queue <int, vector<int>, greater<int> >
#define maxpq  priority_queue <int>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
const int mod = 1e9+7, N = 4e5 + 10;
void solve()
{
  int n;
  cin>>n;
  long double a[n];
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  }
  pair<long double,int> t;
  vector<pair<long double,int>> v;
  v.pb(mp(a[0],1));
  for(int i=1;i<n;i++)
  {  t={a[i],1};
    while(!v.empty())
    {

      auto k=v.back();
      if(t.F<k.F)
      {
        v.pop_back();
        t.F=(t.F*t.S+k.F*k.S)/(t.S+k.S);
        t.S+=k.S;
      }
      else
      {
        break;
      }
    }
    v.pb(t);
  }
  cout<<setprecision(14)<<fixed;
  for(auto x:v)
  {
    for(int i=0;i<x.S;i++)
    {
      cout<<x.F<<"\n";
    }
  }
  return;
}

int32_t main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int test=1;
  //cin>>test;
  while(test--)
  {
    solve();
  }
}


/*
  Vishal Shrivastava
  i_am_kirito
*/
#include <bits/stdc++.h>
using namespace std;
#define minpq priority_queue <int, vector<int>, greater<int> >
#define maxpq  priority_queue <int>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
const int mod = 1e9+7, N = 4e5 + 10;
void solve()
{
  int n;
   cin >> n;
   vector<pair<long double,int>> val;
   f(i,0,n){
      int x; cin >> x;
      pair<long double,int> ee;
       ee = {x,1};
      while(!val.empty()){
         auto k = val.back();
         if(ee.F < k.F){
            val.pop_back();
            ee.F = (ee.F*ee.S+k.F*k.S)/(ee.S+k.S);
            ee.S += k.S;
         }else{
            break;
         }
      }
      val.pb(ee);
   }
   cout << setprecision(14) << fixed;
   for(auto &e : val){
      f(i,0,e.S){
         cout << e.F << '\n';
      }
   }
  return;
}

int32_t main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int test=1;
  //cin>>test;
  while(test--)
  {
    solve();
  }
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000033;
int a[MAXN];
int n;
#define ll long long
ll sum[MAXN];

int stk[MAXN];
int tp;
bool usd[MAXN];

inline long long X(ll x, ll y, ll a, ll b)
{
    return x * b - y * a;
}

inline bool check(int i)
{
    ll y = sum[stk[tp]] - sum[stk[tp - 1]];
    ll x = stk[tp] - stk[tp - 1];
    ll b = sum[i] - sum[stk[tp]];
    ll a = i - stk[tp];
    return X(x, y, a, b) >= 0;
}
int lst[MAXN];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    sum[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        sum[i] = sum[i - 1] + a[i];
    }
    stk[++tp] = n;
    usd[n] = 1;
    for (int i = n - 1; i >= 0; i--)
    {
        while (tp >= 2 && check(i))
            usd[stk[tp--]] = 0;
        usd[i] = 1;
        stk[++tp] = i;
    }
    // for (int i = 0; i <= n; i++)
    //     if (usd[i])
    //         cout << i << endl;
    // lst[n] = n;
    for (int i = n; i >= 0; i--)
    {
        if (usd[i])
            lst[i] = i;
        else
            lst[i] = lst[i + 1];
    }
    for (int i = 1; i <= n; i++)
    {
        int j = lst[i];
        double ss = sum[j] - sum[i - 1];
        ss /= (j - i + 1);
        for (int k = i; k <= j; k++)
            cout << fixed << setprecision(10) << ss << endl;
        i = j;
    }
    // for (int i = 0; i <= n; i++)
    //     cout << i << " " << lst[i] << endl;
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000033;
int a[MAXN];
int n;
int pos[MAXN];
int sz[MAXN];
#define ll long long
ll sum[MAXN];
bool vis[MAXN];
double val[MAXN];
inline bool check(int i)
{
    ll nx = a[i - 1];
    ll oldsum = sum[pos[i]] - sum[i - 1];
    return nx * (pos[i] - i + 1) >= oldsum;
}

inline double getval(int i)
{
    double ssum = sum[pos[i]] - sum[i - 1];
    ssum /= pos[i] - i + 1;
    return ssum;
}

// set<pair<ll, ll>> S;
list<pair<ll, ll>> S;

inline double getval(pair<ll, ll> pr)
{
    ll sz = pr.second;
    ll pos_i = pr.first;
    double ssum = sum[pos_i] - sum[pos_i - sz];
    return ssum / sz;
}

inline bool judge(pair<ll, ll> a, pair<ll, ll> b)
{
}

void check()
{
    bool flag;
    vector<pair<ll, ll>> buf;
    while (true)
    {
        flag = true;
        buf.clear();
        for (auto i : S)
        {
            buf.push_back(i);
        }
        for (int i = buf.size() - 1; i >= 0; i--)
        {
            while (i > 0)
            {
                if (getval(buf[i]) < getval(buf[i - 1]))
                {
                    buf[i - 1].second += buf[i].second;
                    buf[i - 1].first = buf[i].first;
                    buf[i].first = -1;
                    flag = false;
                    i--;
                }
                else
                    break;
            }
        }
        S.clear();
        for (auto i : buf)
        {
            if (i.first != -1)
                S.push_back(i);
        }
        if (flag)
            break;
    }
}

// #define DEBUG
int main()
{
#ifdef DEBUG
    freopen("data.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    // ios::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cin >> n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        // cin >> a[i];
        scanf("%d", &a[i]);
    sum[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        pos[i] = i;
        sum[i] = sum[i - 1] + a[i];
        val[i] = a[i];
        sz[i] = 1;
    }
    for (int i = n; i >= 1; i--)
    {
        while (i > 1)
        {
            // cout << i - 1 << " " << pos[i] << " " << a[i - 1] << " " << val[pos[i]] << endl;
            // if (a[i - 1] >= val[pos[i]])
            if (check(i))
            {
                sz[pos[i]] += sz[pos[i - 1]];
                pos[i - 1] = pos[i];
                i--;
            }
            else
                break;
        }
    }
    S.push_back(make_pair(pos[1], sz[pos[1]]));
    for (int i = 2; i <= n; i++)
    {
        if (pos[i] == pos[i - 1])
            continue;
        S.push_back(make_pair(pos[i], sz[pos[i]]));
    }
    check();
    for (auto x : S)
    {
        double vval = sum[x.first] - sum[x.first - x.second];
        vval /= x.second;
        for (int i = x.first - x.second + 1; i <= x.first; i++)
        {
            val[i] = vval;
        }
    }

    for (int i = 1; i <= n; i++)
    {

        //         cout << fixed
        // #ifdef DEBUG
        //              << setprecision(2)
        // #endif
        // #ifndef DEBUG
        //              << setprecision(10)
        // #endif
        //              << val[i] << endl;
        printf("%.10lf\n", val[i]);
    }
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000033;
int a[MAXN];
int n;
#define ll long long
ll sum[MAXN];

int stk[MAXN];
int tp;
bool usd[MAXN];

inline long long X(ll x, ll y, ll a, ll b)
{
    return x * b - y * a;
}

inline bool check(int i)
{
    ll y = sum[stk[tp]] - sum[stk[tp - 1]];
    ll x = stk[tp] - stk[tp - 1];
    ll b = sum[i] - sum[stk[tp]];
    ll a = i - stk[tp];
    return X(x, y, a, b) >= 0;
}
int lst[MAXN];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    // cin >> n;
    scanf("%d", &n);
    sum[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        // cin >> a[i];
        scanf("%d", &a[i]);
        sum[i] = sum[i - 1] + a[i];
    }
    stk[++tp] = n;
    usd[n] = 1;
    for (int i = n - 1; i >= 0; i--)
    {
        while (tp >= 2 && check(i))
            usd[stk[tp--]] = 0;
        usd[i] = 1;
        stk[++tp] = i;
    }
    // for (int i = 0; i <= n; i++)
    //     if (usd[i])
    //         cout << i << endl;
    // lst[n] = n;
    for (int i = n; i >= 0; i--)
    {
        if (usd[i])
            lst[i] = i;
        else
            lst[i] = lst[i + 1];
    }
    for (int i = 1; i <= n; i++)
    {
        int j = lst[i];
        double ss = sum[j] - sum[i - 1];
        ss /= (j - i + 1);
        for (int k = i; k <= j; k++)
            // cout << fixed << setprecision(10) << ss << endl;
            printf("%.10lf\n", ss);
        i = j;
    }
    // for (int i = 0; i <= n; i++)
    //     cout << i << " " << lst[i] << endl;
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000033;
int a[MAXN];
int n;
int pos[MAXN];
int sz[MAXN];
#define ll long long
ll sum[MAXN];
bool vis[MAXN];
double val[MAXN];
inline bool check(int i)
{
    ll nx = a[i - 1];
    ll oldsum = sum[pos[i]] - sum[i - 1];
    return nx * (pos[i] - i + 1) >= oldsum;
}

inline double getval(int i)
{
    double ssum = sum[pos[i]] - sum[i - 1];
    ssum /= pos[i] - i + 1;
    return ssum;
}

// set<pair<ll, ll>> S;
list<pair<ll, ll>> S;

inline double getval(pair<ll, ll> pr)
{
    ll sz = pr.second;
    ll pos_i = pr.first;
    double ssum = sum[pos_i] - sum[pos_i - sz];
    return ssum / sz;
}

inline bool judge(pair<ll, ll> a, pair<ll, ll> b)
{
}

void check()
{
    bool flag;
    vector<pair<ll, ll>> buf;
    while (true)
    {
        flag = true;
        buf.clear();
        for (auto i : S)
        {
            buf.push_back(i);
        }
        for (int i = buf.size() - 1; i >= 0; i--)
        {
            while (i > 0)
            {
                if (getval(buf[i]) < getval(buf[i - 1]))
                {
                    buf[i - 1].second += buf[i].second;
                    buf[i - 1].first = buf[i].first;
                    buf[i].first = -1;
                    flag = false;
                    i--;
                }
                else
                    break;
            }
        }
        S.clear();
        for (auto i : buf)
        {
            if (i.first != -1)
                S.push_back(i);
        }
        if (flag)
            break;
    }
}

// #define DEBUG
int main()
{
#ifdef DEBUG
    freopen("data.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sum[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        pos[i] = i;
        sum[i] = sum[i - 1] + a[i];
        val[i] = a[i];
        sz[i] = 1;
    }
    for (int i = n; i >= 1; i--)
    {
        while (i > 1)
        {
            // cout << i - 1 << " " << pos[i] << " " << a[i - 1] << " " << val[pos[i]] << endl;
            // if (a[i - 1] >= val[pos[i]])
            if (check(i))
            {
                sz[pos[i]] += sz[pos[i - 1]];
                pos[i - 1] = pos[i];
                i--;
            }
            else
                break;
        }
    }
    S.push_back(make_pair(pos[1], sz[pos[1]]));
    for (int i = 2; i <= n; i++)
    {
        if (pos[i] == pos[i - 1])
            continue;
        S.push_back(make_pair(pos[i], sz[pos[i]]));
    }
    check();
    for (auto x : S)
    {
        double vval = sum[x.first] - sum[x.first - x.second];
        vval /= x.second;
        for (int i = x.first - x.second + 1; i <= x.first; i++)
        {
            val[i] = vval;
        }
    }

    for (int i = 1; i <= n; i++)
    {

        cout << fixed
#ifdef DEBUG
             << setprecision(2)
#endif
#ifndef DEBUG
             << setprecision(10)
#endif
             << val[i] << endl;
    }
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000033;
int a[MAXN];
int n;
int pos[MAXN];
int sz[MAXN];
#define ll long long
ll sum[MAXN];
bool vis[MAXN];
double val[MAXN];
inline bool check(int i)
{
    ll nx = a[i - 1];
    ll oldsum = sum[pos[i]] - sum[i - 1];
    return nx * (pos[i] - i + 1) >= oldsum;
}

inline double getval(int i)
{
    double ssum = sum[pos[i]] - sum[i - 1];
    ssum /= pos[i] - i + 1;
    return ssum;
}

set<pair<ll, ll>> S;

inline double getval(pair<ll, ll> pr)
{
    ll sz = pr.second;
    ll pos_i = pr.first;
    double ssum = sum[pos_i] - sum[pos_i - sz];
    return ssum / sz;
}

void check()
{
    bool flag;
    vector<pair<ll, ll>> buf;
    while (true)
    {
        flag = true;
        buf.clear();
        for (auto i : S)
        {
            buf.push_back(i);
        }
        for (int i = buf.size() - 1; i >= 0; i--)
        {
            while (i > 0)
            {
                if (getval(buf[i]) < getval(buf[i - 1]))
                {
                    buf[i - 1].second += buf[i].second;
                    buf[i - 1].first = buf[i].first;
                    buf[i].first = -1;
                    flag = false;
                    i--;
                }
                else
                    break;
            }
        }
        S.clear();
        for (auto i : buf)
        {
            if (i.first != -1)
                S.insert(i);
        }
        if (flag)
            break;
    }
}

// #define DEBUG
int main()
{
#ifdef DEBUG
    freopen("data.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sum[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        pos[i] = i;
        sum[i] = sum[i - 1] + a[i];
        val[i] = a[i];
        sz[i] = 1;
    }
    for (int i = n; i >= 1; i--)
    {
        while (i > 1)
        {
            // cout << i - 1 << " " << pos[i] << " " << a[i - 1] << " " << val[pos[i]] << endl;
            // if (a[i - 1] >= val[pos[i]])
            if (check(i))
            {
                sz[pos[i]] += sz[pos[i - 1]];
                pos[i - 1] = pos[i];
                i--;
            }
            else
                break;
        }
    }
    S.insert(make_pair(pos[1], sz[pos[1]]));
    for (int i = 2; i <= n; i++)
    {
        if (pos[i] == pos[i - 1])
            continue;
        S.insert(make_pair(pos[i], sz[pos[i]]));
    }
    // cout << S.size() << endl;
    // for (auto x : S)
    // {
    //     cout << getval(x) << endl;
    // }
    check();
    for (auto x : S)
    {
        double vval = sum[x.first] - sum[x.first - x.second];
        vval /= x.second;
        for (int i = x.first - x.second + 1; i <= x.first; i++)
        {
            val[i] = vval;
        }
    }

    for (int i = 1; i <= n; i++)
    {

        cout << fixed
#ifdef DEBUG
             << setprecision(2)
#endif
#ifndef DEBUG
             << setprecision(10)
#endif
             << val[i] << endl;
    }
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000033;
int a[MAXN];
int n;
int pos[MAXN];
#define ll long long
ll sum[MAXN];
double val[MAXN];

inline bool check(int i)
{
    ll nx = a[i - 1];
    ll oldsum = sum[pos[i]] - sum[i - 1];
    return nx * (pos[i] - i + 1) >= oldsum;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sum[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        pos[i] = i;
        sum[i] = sum[i - 1] + a[i];
        val[i] = a[i];
    }
    for (int i = n; i >= 1; i--)
    {
        while (i > 1)
        {
            // cout << i - 1 << " " << pos[i] << " " << a[i - 1] << " " << val[pos[i]] << endl;
            // if (a[i - 1] >= val[pos[i]])
            if (check(i))
            {
                pos[i - 1] = pos[i];
                val[pos[i]] = sum[pos[i]] - sum[i - 2];
                val[pos[i]] /= pos[i] - i + 2;
                i--;
            }
            else
                break;
        }
    }
    for (int i = 1; i <= n; i++)
        cout << fixed << setprecision(10) << val[pos[i]] << endl;
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000000){
		double d=i/3;
	//	cout<<setprecision(10)<<fixed<<d<<endl;
		printf("%.10lf\n",d);
	}
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
ll n,ss[1000005],mm[1000005],c,t,m,s;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
/**/	cin>>n;
	re(i,n){
		cin>>c;
		m=1;
		while(t and ss[t]*m>c*mm[t]){
			c+=ss[t];m+=mm[t];t--;
		}
		t++;
		ss[t]=c;mm[t]=m;
	}
	for(ll i=1;i<=t;i++)for(ll j=1;j<=mm[i];j++){
	//	cout<<setprecision(10)<<fixed<<(double)ss[i]/mm[i]<<"\n";
	//	long double v=(long double)ss[i]/mm[i];
		printf("%.10Lf\n",(long double)ss[i]/mm[i]);
	}

}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
ll n,ss[1000005],mm[1000005],c,t,m,s;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	cin>>n;
	re(i,n){
		cin>>c;
		m=1;
		while(t and ss[t]*m>c*mm[t]){
			c+=ss[t];m+=mm[t];t--;
		}
		t++;
		ss[t]=c;mm[t]=m;
	}
	for(ll i=1;i<=t;i++)for(ll j=1;j<=mm[i];j++)
		cout<<setprecision(10)<<fixed<<(double)ss[i]/mm[i]<<"\n";
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000000)cout<<i<<endl;
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
		#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000000){
		double d=(double)i/3;
	//	cout<<setprecision(10)<<fixed<<d<<endl;
		printf("%.10f\n",d);
	}
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
ll n,ss[1000005],mm[1000005],c,t,m,s;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
/**/	cin>>n;
	re(i,n){
		cin>>c;
		m=1;
		while(t and ss[t]*m>c*mm[t]){
			c+=ss[t];m+=mm[t];t--;
		}
		t++;
		ss[t]=c;mm[t]=m;
	}
	for(ll i=1;i<=t;i++)for(ll j=1;j<=mm[i];j++){
	//	cout<<setprecision(10)<<fixed<<(double)ss[i]/mm[i]<<"\n";
		long double v=(long double)ss[i]/mm[i];
		printf("%.10Lf\n",v);
	}

}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
		#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000001){
		double d=(double)i/3;
		cout<<setprecision(10)<<fixed<<d<<"\n";
	//	printf("%.10f\n",d);
	}
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,10000000)cout<<i<<endl;
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
		#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000000){
		double d=(double)i/3;
		cout<<setprecision(10)<<fixed<<d<<"\n";
	//	printf("%.10f\n",d);
	}
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
		#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000000){
		double d=(double)i/3;
		cout<<setprecision(10)<<fixed<<d<<endl;
	//	printf("%.10f\n",d);
	}
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
ll n,ss[1000005],mm[1000005],c,t,m,s;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
/**/	cin>>n;
	re(i,n){
		cin>>c;
		m=1;
		while(t and ss[t]*m>c*mm[t]){
			c+=ss[t];m+=mm[t];t--;
		}
		t++;
		ss[t]=c;mm[t]=m;
	}
	for(ll i=1;i<=t;i++)for(ll j=1;j<=mm[i];j++){
	//	cout<<setprecision(10)<<fixed<<(double)ss[i]/mm[i]<<"\n";
		double v=(double)ss[i]/mm[i];
	//	double v=(double)6/7;
		printf("%.10f\n",v);
	}

}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
		#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000001){
		double d=(double)i/3;
	//	cout<<setprecision(10)<<fixed<<d<<"\n";
		printf("%.10f\n",d);
	}
}


#include <bits/stdc++.h>
#define mis(x) cout << #x <<" = " <<x<<endl
#define rep(i, a, b) for(int i=(a);(i)<(b);(i)++)
#define re(i,a) rep((i),0,(a))
#define eb emplace_back
	//	#define cin fin
using namespace std;
typedef long long ll;
ifstream fin("AAtest.in.txt");
int main(){
	ios::sync_with_stdio(0);cin.tie(0);	cout.tie(0);cerr.tie(0);
	re(i,1000000){
		double d=i/3;
		printf("%.10f\n",d);
	}
}


#include<bits/stdc++.h>

using namespace std;

int const maxn = 1e6 + 5;
double a[maxn];

main() {
#ifdef HOME
    //freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, x, ptr = 1;
    cin >> n;
    vector < pair < int, int > > Q;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        a[i] = x;
    }
    for (int i = 1; i <= n; ++i) {
        double best = a[i];
        double sum = 0, was = a[i];
        int pos = i;
        if (a[i] == a[i - 1]) continue;
        for (int j = i; j <= n; j++) {
            sum += a[j];
            if (sum / (double)(j - i + 1) < best) {
                best = sum / (double)(j - i + 1), pos = j;
                was = sum;
            }
            else {
                double cnt = sum / best;
                if (cnt > 2 * n) break;
            }
        }
        for (int j = i; j <= pos; ++j) a[j] = was / (double)(pos - i + 1);
    }
    for (int i = 1; i <= n; ++i) cout << fixed << setprecision(10) << a[i] << '\n';
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int const maxn = 1e6 + 5;
double a[maxn];

main() {
#ifdef HOME
    //freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, x, ptr = 1;
    cin >> n;
    vector < pair < int, int > > Q;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        a[i] = x;
    }
    for (int i = 1; i <= n; ++i) {
        double best = a[i];
        double sum = 0, was = a[i];
        int pos = i;
        if (a[i] == a[i - 1]) continue;
        for (int j = i; j <= n; j++) {
            sum += a[j];
            if (sum / (double)(j - i + 1) < best) {
                best = sum / (double)(j - i + 1), pos = j;
                was = sum;
            }
            /*else {
                double cnt = sum / best;
                if (cnt > 2 * n) break;
                j = max(j, (int)cnt - 1);
            }*/
        }
        for (int j = i; j <= pos; ++j) a[j] = was / (double)(pos - i + 1);
    }
    for (int i = 1; i <= n; ++i) cout << fixed << setprecision(10) << a[i] << '\n';
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int const maxn = 1e6 + 5;
double a[maxn];

main() {
#ifdef HOME
    //freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, x, ptr = 1;
    cin >> n;
    vector < pair < int, int > > Q;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        a[i] = x;
    }
    for (int i = 1; i <= n; ++i) {
        double best = a[i];
        double sum = 0, was = a[i];
        int pos = i;
        if (a[i] == a[i - 1]) continue;
        for (int j = i; j <= n; j++) {
            sum += a[j];
            if (sum / (double)(j - i + 1) < best) {
                best = sum / (double)(j - i + 1), pos = j;
                was = sum;
            }
            else {
                double cnt = sum / best;
                if (cnt > 2 * n) break;
                j = max(j, (int)cnt - 1);
            }
        }
        for (int j = i; j <= pos; ++j) a[j] = was / (double)(pos - i + 1);
    }
    for (int i = 1; i <= n; ++i) cout << fixed << setprecision(9) << a[i] << '\n';
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define double long double
int const maxn = 1e6 + 5;
double a[maxn];

main() {
#ifdef HOME
    //freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin >> n;
    vector < pair < int, int > > Q;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        a[i] = x;
    }
    for (int i = 1; i <= n; ++i) {
        int pos = i;
        double best = a[i];
        double sum = 0, was = a[i];
        for (int j = i; j <= n; ++j) {
            sum += a[j];
            if (sum < best * (j - i + 1)) {
                best = sum / (j - i + 1), pos = j;
                was = sum;
            }
        }
        for (int j = i; j <= pos; ++j) a[j] = was / (double)(pos - i + 1);
    }
    for (int i = 1; i <= n; ++i) cout << fixed << setprecision(9) << a[i] << '\n';
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define double long double
int const maxn = 1e6 + 5;
double a[maxn];
double ans[maxn];

main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        a[i] = x;
    }
    vector < pair < double, int > > Q;
    for (int i = 1; i <= n; ++i) {
        Q.push_back({a[i], i});
        while ((int)Q.size() > 1) {
            int N = (int)Q.size();
            if (Q[N - 1].first < Q[N - 2].first) {
                double t = (Q[N - 1].first * (i - Q[N - 1].second + 1) + Q[N - 2].first * (Q[N - 1].second - Q[N - 2].second)) / (i - Q[N - 2].second + 1);
                int pos = Q[N - 2].second;
                Q.pop_back(), Q.pop_back();
                Q.push_back({t, pos});
            }
            else break;
        }
        //for (auto key : Q) cout << key.first << " " << key.second << endl;
        //cout << endl;
    }
    for (int i = 0; i < (int)Q.size() - 1; ++i) {
        for (int j = Q[i].second; j < Q[i + 1].second; ++j) ans[j] = Q[i].first;
    }
    for (int j = Q.back().second; j <= n; ++j) ans[j] = Q.back().first;
    for (int i = 1; i <= n; ++i) cout << fixed << setprecision(9) << ans[i] << '\n';
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define double long double
int const maxn = 1e6 + 5;
double a[maxn];

main() {
#ifdef HOME
    //freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, x, ptr = 1;
    cin >> n;
    vector < pair < int, int > > Q;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        a[i] = x;
    }
    for (int i = 1; i <= n; ++i) {
        double best = a[i];
        double sum = 0, was = a[i];
        int pos = i;
        if (a[i] == a[i - 1]) continue;
        for (int j = i; j <= n; j++) {
            sum += a[j];
            if (sum / (double)(j - i + 1) < best) {
                best = sum / (double)(j - i + 1), pos = j;
                was = sum;
            }
            else {
                double cnt = sum / best;
                if (cnt > 2 * n) break;
            }
        }
        for (int j = i; j <= pos; ++j) a[j] = was / (double)(pos - i + 1);
    }
    for (int i = 1; i <= n; ++i) cout << fixed << setprecision(10) << a[i] << '\n';
    return 0;
}


#include <bits/stdc++.h>
#define db long double

using namespace std;
const int MN = 1e6+7;

    long long a[MN];
    db pef[MN];
    db ans[MN];

vector<pair<db, db> > po;

void add(db x, db y){
    while(po.size() > 1){
        db sh = (po[po.size()-1].second - po[po.size()-2].second) / (po[po.size()-1].first - po[po.size()-2].first);
        if(sh < (y - po.back().second) / (x - po.back().first)){
            break;
        }
        else{
            po.pop_back();
        }
    }
    po.push_back({x, y});
}

int main(){
    po.push_back({0, 0});
    cout << setprecision(12);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)cin >> a[i];
    pef[0] = a[0];
    add(1, pef[0]);
    for(int i = 1; i < n; i++){
        pef[i] = pef[i-1] + a[i];
        add(i+1, pef[i]);
    }
    for(int i = 1; i < po.size(); i++){
        db y = po[i-1].second;
        db sh = (po[i].second - po[i-1].second) / (po[i].first - po[i-1].first);
        for(int x = po[i-1].first+1; x <= po[i].first; x++){
            y += sh;
            ans[x] = y;
        }
    }
    ans[0] = 0;
    for(int i = n; i > 0; i--){
        ans[i] -= ans[i-1];
    }
    for(int i = 1; i <= n; i++){
        cout << ans[i] << ' ';
    }
}


#include <bits/stdc++.h>
#define db long double

using namespace std;
const int MN = 1e6+7;

bool co(pair<db, db> a, pair<db, db> b){
    return ((a.first * b.second) < (a.second * b.first));
}

    long long a[MN];
    db pef[MN];
    db ans[MN];

vector<pair<db, db> > po;

void add(db x, db y){
    while(po.size() > 1){
        pair<db, db> sh = {(po[po.size()-1].second - po[po.size()-2].second), (po[po.size()-1].first - po[po.size()-2].first)};
        if(co(sh, {(y - po.back().second), (x - po.back().first)})){
            break;
        }
        else{
            po.pop_back();
        }
    }
    po.push_back({x, y});
}

int main(){
    po.push_back({0, 0});
    cout << setprecision(12);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)cin >> a[i];
    pef[0] = a[0];
    add(1, pef[0]);
    for(int i = 1; i < n; i++){
        pef[i] = pef[i-1] + a[i];
        add(i+1, pef[i]);
    }
    for(int i = 1; i < po.size(); i++){
        db y = 0;
        int z = 1;
        for(int x = po[i-1].first+1; x <= po[i].first; x++){
            y = (z * (po[i].second - po[i-1].second)) / (po[i].first - po[i-1].first);
            ans[x] = y + po[i-1].second;
            z++;
        }
    }
    ans[0] = 0;
    for(int i = n; i > 0; i--){
        ans[i] -= ans[i-1];
    }
    for(int i = 1; i <= n; i++){
        cout << ans[i] << ' ';
    }
}


#include <bits/stdc++.h>
#define db long double

using namespace std;

vector<pair<db, db> > po;

void add(db x, db y){
    while(po.size() > 1){
        db sh = (po[po.size()-1].second - po[po.size()-2].second) / (po[po.size()-1].first - po[po.size()-2].first);
        if(sh < (y - po.back().second) / (x - po.back().first)){
            break;
        }
        else{
            po.pop_back();
        }
    }
    po.push_back({x, y});
}

int main(){
    po.push_back({0, 0});
    int n;
    cin >> n;
    int a[n+2];
    for(int i = 0; i < n; i++)cin >> a[i];
    long long pef[n+2];
    db ans[n+2];
    pef[0] = a[0];
    add(1, pef[0]);
    for(int i = 1; i < n; i++){
        pef[i] = pef[i-1] + a[i];
        add(i+1, pef[i]);
    }
    for(int i = 1; i < po.size(); i++){
        db y = po[i-1].second;
        db sh = (po[i].second - po[i-1].second) / (po[i].first - po[i-1].first);
        for(int x = po[i-1].first+1; x <= po[i].first; x++){
            y += sh;
            ans[x] = y;
        }
    }
    ans[0] = 0;
    for(int i = 1; i <= n; i++){
        cout << setprecision(12) << ans[i]-ans[i-1] << ' ';
    }
}


#include <bits/stdc++.h>
#define db long double

using namespace std;
const int MN = 1e6+7;

    long long a[MN];
    long long pef[MN];
    db ans[MN];

vector<pair<db, db> > po;

void add(db x, db y){
    while(po.size() > 1){
        db sh = (po[po.size()-1].second - po[po.size()-2].second) / (po[po.size()-1].first - po[po.size()-2].first);
        if(sh < (y - po.back().second) / (x - po.back().first)){
            break;
        }
        else{
            po.pop_back();
        }
    }
    po.push_back({x, y});
}

int main(){
    po.push_back({0, 0});
    cout << setprecision(12);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)cin >> a[i];
    pef[0] = a[0];
    add(1, pef[0]);
    for(int i = 1; i < n; i++){
        pef[i] = pef[i-1] + a[i];
        add(i+1, pef[i]);
    }
    for(int i = 1; i < po.size(); i++){
        db y = po[i-1].second;
        db sh = (po[i].second - po[i-1].second) / (po[i].first - po[i-1].first);
        for(int x = po[i-1].first+1; x <= po[i].first; x++){
            y += sh;
            ans[x] = y;
        }
    }
    ans[0] = 0;
    for(int i = 1; i <= n; i++){
        cout << ans[i]-ans[i-1] << ' ';
    }
}


#include <bits/stdc++.h>
#define db long double
using namespace std;

vector<pair<db, db> > po;

void add(db x, db y){
    while(po.size() > 1){
        db sh = (po[po.size()-1].second - po[po.size()-2].second) / (po[po.size()-1].first - po[po.size()-2].first);
        if(sh < (y - po.back().second) / (x - po.back().first)){
            break;
        }
        else{
            po.pop_back();
        }
    }
    po.push_back({x, y});
}

int main(){
    po.push_back({0, 0});
    int n;
    cin >> n;
    int a[n+2];
    for(int i = 0; i < n; i++)cin >> a[i];
    int pef[n+2];
    db ans[n+2];
    pef[0] = a[0];
    add(1, pef[0]);
    for(int i = 1; i < n; i++){
        pef[i] = pef[i-1] + a[i];
        add(i+1, pef[i]);
    }
    for(int i = 1; i < po.size(); i++){
        db y = po[i-1].second;
        db sh = (po[i].second - po[i-1].second) / (po[i].first - po[i-1].first);
        for(int x = po[i-1].first+1; x <= po[i].first; x++){
            y += sh;
            ans[x] = y;
        }
    }
    ans[0] = 0;
    for(int i = 1; i <= n; i++){
        cout << setprecision(12) << ans[i]-ans[i-1] << ' ';
    }
}


#include <bits/stdc++.h>
#define db long double

using namespace std;
const int MN = 1e6+7;

    long long a[MN];
    db pef[MN];
    db ans[MN];

vector<pair<db, db> > po;

void add(db x, db y){
    while(po.size() > 1){
        db sh = (po[po.size()-1].second - po[po.size()-2].second) / (po[po.size()-1].first - po[po.size()-2].first);
        if(sh < (y - po.back().second) / (x - po.back().first)){
            break;
        }
        else{
            po.pop_back();
        }
    }
    po.push_back({x, y});
}

int main(){
    po.push_back({0, 0});
    cout << setprecision(12);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)cin >> a[i];
    pef[0] = a[0];
    add(1, pef[0]);
    for(int i = 1; i < n; i++){
        pef[i] = pef[i-1] + a[i];
        add(i+1, pef[i]);
    }
    for(int i = 1; i < po.size(); i++){
        db y = po[i-1].second;
        db sh = (po[i].second - po[i-1].second) / (po[i].first - po[i-1].first);
        db rs = (po[i].second - po[i-1].second) - sh * (po[i].first - po[i-1].first);
        sh += rs / (po[i].first - po[i-1].first);
        for(int x = po[i-1].first+1; x <= po[i].first; x++){
            y += sh;
            ans[x] = y;
        }
    }
    ans[0] = 0;
    for(int i = n; i > 0; i--){
        ans[i] -= ans[i-1];
    }
    for(int i = 1; i <= n; i++){
        cout << ans[i] << ' ';
    }
}


// 5 - 20
// 4.000
// 25th June
#include <bits/stdc++.h>
using namespace std;
// #define int long long int
#define ld long double
#define pb push_back
#define F first
#define S second
#define MOD 1000000007
#define mod1 1187278649
#define mod2 1149736019
#define ioi cout<<"\n------------ioi------------\n"
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

const ld PI=3.14159265358979323;
// int linf=(int)2e18;
const int inf=1011111111;
const int N=1000005;
// global variables...
int n;
double arr[N];

//functions...
void input(){
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>arr[i];
}

int32_t main()
{
    // #ifndef ONLINE_JUDGE
    //     freopen("inputf.txt", "r", stdin);
    //     freopen("outputf.txt", "w", stdout);
    // #endif

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int test=1;
    // cin>>test;
    while(test--){
        input();
        vector < pair < double , int> > ans;
        for(int i=0;i<n;i++){
            pair < double , int > cur={arr[i], 1};
            while(!ans.empty()){
                if(ans.back().F>cur.F){
                    auto tmp=ans.back();
                    ans.pop_back();
                    cur.F=(cur.F*cur.S+tmp.F*tmp.S)/(cur.S+tmp.S);
                    cur.S+=tmp.S;
                }
                else
                    break;
            }
            ans.pb(cur);
        }
        cout<<fixed<<setprecision(15);
        for(auto x:ans){
            for(int i=0;i<x.S;i++)
                cout<<x.F<<"\n";
        }
    }
    cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
}


// 5 - 20
// 4.000
// 25th June
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
// #define int long long int
#define ld long double
#define pb push_back
#define F first
#define S second
#define MOD 1000000007
#define mod1 1187278649
#define mod2 1149736019
#define ioi cout<<"\n------------ioi------------\n"
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

const ld PI=3.14159265358979323;
// int linf=(int)2e18;
const int inf=1011111111;
const int N=1000005;
// global variables...
int n;
int arr[N];

//functions...
void input(){
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>arr[i];
}

int32_t main()
{
    // #ifndef ONLINE_JUDGE
    //     freopen("inputf.txt", "r", stdin);
    //     freopen("outputf.txt", "w", stdout);
    // #endif

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int test=1;
    // cin>>test;
    while(test--){
        input();
        vector < pair < double , int> > ans;
        for(int i=0;i<n;i++){
            pair < double , int > cur={arr[i], 1};
            while(!ans.empty()){
                if(ans.back().F>cur.F){
                    auto tmp=ans.back();
                    ans.pop_back();
                    cur.F=(cur.F*cur.S+tmp.F*tmp.S)/(cur.S+tmp.S);
                    cur.S+=tmp.S;
                }
                else
                    break;
            }
            ans.pb(cur);
        }
        cout<<fixed<<setprecision(15);
        for(auto x:ans){
            for(int i=0;i<x.S;i++)
                cout<<x.F<<"\n";
        }
    }
    cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
}


// 5 - 20
// 4.000
// 25th June
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define F first
#define S second
#define MOD 1000000007
#define mod1 1187278649
#define mod2 1149736019
#define ioi cout<<"\n------------ioi------------\n"
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

const ld PI=3.14159265358979323;
int linf=(int)2e18;
const int inf=1011111111;
const int N=1000005;
// global variables...
int n;
double arr[N];

//functions...
void input(){
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>arr[i];
}

int32_t main()
{
    // #ifndef ONLINE_JUDGE
    //     freopen("inputf.txt", "r", stdin);
    //     freopen("outputf.txt", "w", stdout);
    // #endif

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int test=1;
    // cin>>test;
    while(test--){
        input();
        vector < pair < double , int> > ans;
        for(int i=0;i<n;i++){
            pair < double , int > cur={arr[i], 1};
            while(!ans.empty()){
                if(ans.back().F>cur.F){
                    auto tmp=ans.back();
                    ans.pop_back();
                    cur.F=(cur.F*cur.S+tmp.F*tmp.S)/(cur.S+tmp.S);
                    cur.S+=tmp.S;
                }
                else
                    break;
            }
            ans.pb(cur);
        }
        cout<<fixed<<setprecision(15);
        for(auto x:ans){
            for(int i=0;i<x.S;i++)
                cout<<x.F<<"\n";
        }
    }
    cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
}


// 5 - 20
// 4.000
// 25th June
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define F first
#define S second
#define MOD 1000000007
#define mod1 1187278649
#define mod2 1149736019
#define ioi cout<<"\n------------ioi------------\n"
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

const ld PI=3.14159265358979323;
int linf=(int)2e18;
const int inf=1011111111;
const int N=1000005;
// global variables...
int n;
ld arr[N];

//functions...
void input(){
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>arr[i];
}

int32_t main()
{
    // #ifndef ONLINE_JUDGE
    //     freopen("inputf.txt", "r", stdin);
    //     freopen("outputf.txt", "w", stdout);
    // #endif

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int test=1;
    // cin>>test;
    while(test--){
        input();
        vector < pair < ld , int> > ans;
        for(int i=0;i<n;i++){
            pair < ld , int > cur={arr[i], 1};
            while(!ans.empty()){
                if(ans.back().F>cur.F){
                    auto tmp=ans.back();
                    ans.pop_back();
                    cur.F=(cur.F*cur.S+tmp.F*tmp.S)/(cur.S+tmp.S);
                    cur.S+=tmp.S;
                }
                else
                    break;
            }
            ans.pb(cur);
        }
        cout<<fixed<<setprecision(15);
        for(auto x:ans){
            for(int i=0;i<x.S;i++)
                cout<<x.F<<"\n";
        }
    }
    cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

        cout << fixed;
    for (int i = 1; i <= n; i++)
    cout << setprecision(9) << ans[i] << "\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    if (n > 10000)
        return;

    for (int i = 1; i <= n; i++)
    cout << a[i] << "\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    if (n > 10000)
        return;

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    cout << fixed;
    for (int i = 1; i <= n; i++)
        cout << setprecision(9) << ans[i] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    cout << fixed;
    for (int i = 1; i <= n; i++)
        cout << setprecision(9) << ans[i] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

double ans[maxn];
void solve()
{
    int pos = 1;
    while (pos <= n)
    {
        double mins = 1000000000000;
        int idx;
        long long sum = 0;
        for (int j = pos; j <= n; j++)
        {
            sum += a[j];
            double r = (double)(sum) / (double)(j-pos+1);
            if (r < mins)
                mins = r, idx = j;
        }

        for (int i = pos; i <= idx; i++)
            ans[i] = mins;

        pos = idx + 1;
    }

    cout << fixed;
    for (int i = 1; i <= n; i++)
        cout << setprecision(9) << ans[i] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    if (n > 10000)
        return;

        cout << fixed;
    for (int i = 1; i <= n; i++)
    cout << setprecision(9) << ans[i] << "\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    if (n > 10000)
        return;

    cout << fixed;
    for (int i = 1; i <= n; i++)
        cout << setprecision(9) << ans[i] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double eps = 0.000000001;

int n;
double a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

set <int> s;
void solve()
{
    for (int i = 1; i <= n-1; i++)
        if (a[i] - a[i+1] > eps)
        s.insert(i);

    while (!s.empty())
    {
        int curr = *s.begin();
        s.erase(s.begin());

        double r = (a[curr] + a[curr+1]) / 2.0;
        a[curr] = a[curr+1] = r;

        if (curr + 1 < n)
        {
            if (a[curr+1] - a[curr+2] > eps)
            s.insert(curr+1);

        else
            s.erase(curr+1);
        }

        if (curr-1 >= 1)
        {
            if (a[curr-1] - a[curr] > eps)
                s.insert(curr-1);

            else
                s.erase(curr-1);
        }
    }

    cout << fixed;
    for (int i = 1; i <= n; i++)
        cout << setprecision(9) << a[i] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    int cnt = 0;
    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        cnt++;
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

                cnt++;
            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    if (cnt > 10000000)
    {
        cout << "WTF" << endl;
        return;
    }
    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    cout << fixed;
    for (int i = 1; i <= n; i++)
        cout << setprecision(9) << ans[i] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    if (n > 10000)
        return;

    for (int i = 1; i <= n; i++)
    printf("%.9f\n", a[i]);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 3;
const double inf = 1/.0;

int n;
int a[maxn];
void read()
{
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
}

long long pr[maxn];
double average(int l, int r)
{
    return (double)(pr[r]-pr[l-1]) / (double)(r-l+1);
}

double ans[maxn];
void solve()
{
    for (int i = 1; i <= n; i++)
        pr[i] = pr[i-1] + a[i];

    vector <pair <int, int> > v;
    for (int i = 1; i <= n; i++)
    {
        v.push_back({i, i});
        for (;;)
        {
            int sz = v.size();
            if (sz < 2)
                break;

            double av1 = average(v[sz-1].first, v[sz-1].second), av2 = average(v[sz-2].first, v[sz-2].second);
            if (av1 <= av2)
            {
                v[sz-2].second = v[sz-1].second;
                v.pop_back();
            }

            else
                break;
        }
    }

    for (auto i: v)
    {
        double av = average(i.first, i.second);
        for (int j = i.first; j <= i.second; j++)
            ans[j] = av;
    }

    if (n > 10000)
        return;

    for (int i = 1; i <= n; i++)
    cout << ans[i] << "\n";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}