#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 2 << 29;

#define FORN(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define RFORN(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define RESET(a,b)      memset((a),(b),sizeof(a))

#define SC(x)           scanf("%d",&x)
#define SC2(x,y)        scanf("%d%d",&x,&y)
#define PR(x)           printf("%d ",x)
#define PR2(x,y)        printf("%d %d ",x,y)
#define PRS(x)          printf("%s",x)
#define END             printf("\n")
#define EXIT(x)         {PRS(x);return 0;}
#define DBG(x)          {cerr << "--> " << #x << " = " << x << endl;}

#define fi              first
#define se              second
#define PB              push_back
#define ALL(x)          (x).begin(),(x).end()
#define MP(X,Y)         make_pair(X,Y)//NOTES:MP(
#define TR(c, i)        for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

int compare (const void *a, const void *b){
    return (*(int*)a-*(int*)b);
}

void startDBG(){
    PRS("------------------- Start Debug -------------------\n\n");
}

void endDBG(){
    PRS("\n\n------------------- End Debug -------------------\n");
}

template<class T> inline void DebM(T A[], T ii, T jj){//Debug sequence
    END;PRS("----------------DEBUG----------------");END;
    FORN (i,ii,jj) cout<<A[i]<<" ";
    END;PRS("-------------------------------------");END;
}
//Template code by ACRush
template<class T> inline bool isPrimeNumber(T n)//NOTES:isPrimeNumber(
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline void checkmin(T &a, T b) {
    if (b < a) a = b;
}//NOTES:checkmin(

template<class T> inline void checkmax(T &a, T b) {
    if (b > a) a = b;
}//NOTES:checkmax(

template<class T> inline T sqr(T x) {
    return x*x;
}//NOTES:sqr

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}//NOTES:lowbit(

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}//NOTES:countbit(
//Numberic Functions

int64 C(int64 m, int64 n){
    int64 tot = 1;
    int64 i = m;
    while (i > m - n)
        tot *= i--;
    i = n;
    while (i > 1) tot /= i--;
    return tot;
}

template<class T> inline T gcd(T a, T b)//NOTES:gcd(
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)//NOTES:lcm(
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)//NOTES:euclide(
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)//NOTES:factorize(
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)//NOTES:eularFunction(
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

//Matrix Operations
const int MaxMatrixSize = 40; //NOTES:MaxMatrixSize

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:showMatrix(
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}//NOTES:checkMod(

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:identityMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}//NOTES:multiplyMod(

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulModMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}

template<class T> inline T powerMod(T p, int e, T m)//NOTES:powerMod(
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}
//Point&Line

double dist(double x1, double y1, double x2, double y2) {
    return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}//NOTES:dist(

double distR(double x1, double y1, double x2, double y2) {
    return sqr(x1 - x2) + sqr(y1 - y2);
}//NOTES:distR(

template<class T> T cross(T x0, T y0, T x1, T y1, T x2, T y2) {
    return (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
}//NOTES:cross(

int crossOper(double x0, double y0, double x1, double y1, double x2, double y2)//NOTES:crossOper(
{
    double t = (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)//NOTES:isIntersect(
{
    return crossOper(x1, y1, x2, y2, x3, y3) * crossOper(x1, y1, x2, y2, x4, y4) < 0 && crossOper(x3, y3, x4, y4, x1, y1) * crossOper(x3, y3, x4, y4, x2, y2) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}//NOTES:isMiddle(
//Translator

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}//NOTES:isUpperCase(

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}//NOTES:isLowerCase(

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}//NOTES:isLetter(

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}//NOTES:isDigit(

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}//NOTES:toLowerCase(

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}//NOTES:toUpperCase(

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}//NOTES:toString(

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt(

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt64(

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toDouble(

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}//NOTES:stoa(

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}//NOTES:atos(

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}//NOTES:atov(

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}//NOTES:vtoa(

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}//NOTES:stov(

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}//NOTES:vtos(
//Fraction

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
}; //NOTES:Fraction

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
//Template code by ACRush

bool isAmpliLine(string s){
    vector<string> tam;
    stov(s, tam);
    if (tam.size() > 0 && tam[0][0] == '#') return true;
    return false;
}

int main(){
    //freopen ("INP.txt", "r", stdin);
    vector<string> ampliLine;
    vector<string> otherLine;
    string s;
    string tam = "";
    while (getline(cin, s)){
        if (isAmpliLine(s)) {
            otherLine.PB(tam);
            ampliLine.PB(s);
            tam = "";
        }
        else{
            vector<string> luu;
            stov(s, luu);
            FORN (i, 0, luu.size()) tam = tam + luu[i];
        }
    }
    if (!tam.empty()) otherLine.PB(tam);
    FORN (i, 0, ampliLine.size()){
        cout << ampliLine[i] << endl;
        if (i + 1 < otherLine.size()){
            cout << otherLine[i + 1] << endl;
        }
    }
}


#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

typedef vector <int> vi;
typedef vector <vi> vvi;
typedef pair <int, int> ii;
typedef vector <string> vs;
typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 2 << 29;

#define FORN(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define RFORN(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define RESET(a,b)      memset((a),(b),sizeof(a))

#define SC(x)           scanf("%d",&x)
#define SC2(x,y)        scanf("%d %d",&x,&y)
#define PR(x)           printf("%d ",x)
#define PR2(x,y)        printf("%d %d ",x,y)
#define PRS(x)          printf("%s",x)
#define END             printf("\n")
#define EXIT(x)         {PRS(x);return 0;}
#define DBG(x)          {cerr << "--> " << #x << " = " << x << endl;}

#define fi              first
#define se              second
#define PB              push_back
#define ALL(x)          (x).begin(),(x).end()
#define MP(X,Y)         make_pair(X,Y)//NOTES:MP(
#define foreach(i, c)   for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

int compare (const void *a, const void *b){
    return (*(int*)a-*(int*)b);
}

void startDBG(){
    PRS("------------------- Start Debug -------------------\n\n");
}

void endDBG(){
    PRS("\n\n------------------- End Debug -------------------\n");
}

template<class T> inline void DebM(T A[], T ii, T jj){//Debug sequence
    END;PRS("----------------DEBUG----------------");END;
    FORN (i,ii,jj) cout<<A[i]<<" ";
    END;PRS("-------------------------------------");END;
}
//Template code by ACRush
template<class T> inline bool isPrimeNumber(T n)//NOTES:isPrimeNumber(
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline void checkmin(T &a, T b) {
    if (b < a) a = b;
}//NOTES:checkmin(

template<class T> inline void checkmax(T &a, T b) {
    if (b > a) a = b;
}//NOTES:checkmax(

template<class T> inline T sqr(T x) {
    return x*x;
}//NOTES:sqr

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}//NOTES:lowbit(

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}//NOTES:countbit(
//Numberic Functions

int64 C(int64 m, int64 n){
    int64 tot = 1;
    int64 i = m;
    while (i > m - n)
        tot *= i--;
    i = n;
    while (i > 1) tot /= i--;
    return tot;
}

template<class T> inline T gcd(T a, T b)//NOTES:gcd(
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)//NOTES:lcm(
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)//NOTES:euclide(
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)//NOTES:factorize(
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)//NOTES:eularFunction(
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

//Matrix Operations
const int MaxMatrixSize = 40; //NOTES:MaxMatrixSize

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:showMatrix(
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}//NOTES:checkMod(

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:identityMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}//NOTES:multiplyMod(

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulModMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}

template<class T> inline T powerMod(T p, int e, T m)//NOTES:powerMod(
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}
//Point&Line

double dist(double x1, double y1, double x2, double y2) {
    return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}//NOTES:dist(

double distR(double x1, double y1, double x2, double y2) {
    return sqr(x1 - x2) + sqr(y1 - y2);
}//NOTES:distR(

template<class T> T cross(T x0, T y0, T x1, T y1, T x2, T y2) {
    return (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
}//NOTES:cross(

int crossOper(double x0, double y0, double x1, double y1, double x2, double y2)//NOTES:crossOper(
{
    double t = (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)//NOTES:isIntersect(
{
    return crossOper(x1, y1, x2, y2, x3, y3) * crossOper(x1, y1, x2, y2, x4, y4) < 0 && crossOper(x3, y3, x4, y4, x1, y1) * crossOper(x3, y3, x4, y4, x2, y2) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}//NOTES:isMiddle(
//Translator

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}//NOTES:isUpperCase(

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}//NOTES:isLowerCase(

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}//NOTES:isLetter(

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}//NOTES:isDigit(

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}//NOTES:toLowerCase(

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}//NOTES:toUpperCase(

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}//NOTES:toString(

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt(

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt64(

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toDouble(

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}//NOTES:stoa(

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}//NOTES:atos(

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}//NOTES:atov(

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}//NOTES:vtoa(

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}//NOTES:stov(

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}//NOTES:vtos(
//Fraction

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
}; //NOTES:Fraction

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
//Template code by ACRush

bool isSpell(string s){
    vs tam;
    stov(s, tam);
    if (!tam.empty() && tam[0].find("#") == 0) return true;
    return false;
}

int main(){
    //freopen ("INP.txt", "r", stdin);
    //freopen ("OUT.txt", "w", stdout);
    string s;
    vs luu;
    while (getline(cin, s)) luu.PB(s);
    vs spell, other;
    int i = 0;
    while (i < luu.size()){
        if (i < luu.size() && isSpell(luu[i])){
            cout << luu[i];
            i++;
        }
        else{
            string s = "";
            while (i < luu.size() && !isSpell(luu[i])){
                vs tam;
                stov(luu[i], tam);
                FORN (j, 0, tam.size()) s = s + tam[j];
                i++;
            }
            cout << s;
        }
        if (i <= luu.size()) cout << endl;
    }
}


#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 2 << 29;

#define FORN(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define RFORN(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define RESET(a,b)      memset((a),(b),sizeof(a))

#define SC(x)           scanf("%d",&x)
#define SC2(x,y)        scanf("%d%d",&x,&y)
#define PR(x)           printf("%d ",x)
#define PR2(x,y)        printf("%d %d ",x,y)
#define PRS(x)          printf("%s",x)
#define END             printf("\n")
#define EXIT(x)         {PRS(x);return 0;}
#define DBG(x)          {cerr << "--> " << #x << " = " << x << endl;}

#define fi              first
#define se              second
#define PB              push_back
#define ALL(x)          (x).begin(),(x).end()
#define MP(X,Y)         make_pair(X,Y)//NOTES:MP(
#define TR(c, i)        for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

int compare (const void *a, const void *b){
    return (*(int*)a-*(int*)b);
}

void startDBG(){
    PRS("------------------- Start Debug -------------------\n\n");
}

void endDBG(){
    PRS("\n\n------------------- End Debug -------------------\n");
}

template<class T> inline void DebM(T A[], T ii, T jj){//Debug sequence
    END;PRS("----------------DEBUG----------------");END;
    FORN (i,ii,jj) cout<<A[i]<<" ";
    END;PRS("-------------------------------------");END;
}
//Template code by ACRush
template<class T> inline bool isPrimeNumber(T n)//NOTES:isPrimeNumber(
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline void checkmin(T &a, T b) {
    if (b < a) a = b;
}//NOTES:checkmin(

template<class T> inline void checkmax(T &a, T b) {
    if (b > a) a = b;
}//NOTES:checkmax(

template<class T> inline T sqr(T x) {
    return x*x;
}//NOTES:sqr

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}//NOTES:lowbit(

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}//NOTES:countbit(
//Numberic Functions

int64 C(int64 m, int64 n){
    int64 tot = 1;
    int64 i = m;
    while (i > m - n)
        tot *= i--;
    i = n;
    while (i > 1) tot /= i--;
    return tot;
}

template<class T> inline T gcd(T a, T b)//NOTES:gcd(
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)//NOTES:lcm(
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)//NOTES:euclide(
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)//NOTES:factorize(
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)//NOTES:eularFunction(
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

//Matrix Operations
const int MaxMatrixSize = 40; //NOTES:MaxMatrixSize

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:showMatrix(
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}//NOTES:checkMod(

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:identityMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}//NOTES:multiplyMod(

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulModMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}

template<class T> inline T powerMod(T p, int e, T m)//NOTES:powerMod(
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}
//Point&Line

double dist(double x1, double y1, double x2, double y2) {
    return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}//NOTES:dist(

double distR(double x1, double y1, double x2, double y2) {
    return sqr(x1 - x2) + sqr(y1 - y2);
}//NOTES:distR(

template<class T> T cross(T x0, T y0, T x1, T y1, T x2, T y2) {
    return (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
}//NOTES:cross(

int crossOper(double x0, double y0, double x1, double y1, double x2, double y2)//NOTES:crossOper(
{
    double t = (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)//NOTES:isIntersect(
{
    return crossOper(x1, y1, x2, y2, x3, y3) * crossOper(x1, y1, x2, y2, x4, y4) < 0 && crossOper(x3, y3, x4, y4, x1, y1) * crossOper(x3, y3, x4, y4, x2, y2) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}//NOTES:isMiddle(
//Translator

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}//NOTES:isUpperCase(

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}//NOTES:isLowerCase(

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}//NOTES:isLetter(

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}//NOTES:isDigit(

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}//NOTES:toLowerCase(

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}//NOTES:toUpperCase(

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}//NOTES:toString(

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt(

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt64(

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toDouble(

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}//NOTES:stoa(

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}//NOTES:atos(

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}//NOTES:atov(

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}//NOTES:vtoa(

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}//NOTES:stov(

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}//NOTES:vtos(
//Fraction

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
}; //NOTES:Fraction

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
//Template code by ACRush

bool isAmpliLine(string s){
    vector<string> tam;
    stov(s, tam);
    if (tam.size() > 0 && tam[0][0] == '#') return true;
    return false;
}

int main(){
    //freopen ("INP.txt", "r", stdin);
    vector<string> ampliLine;
    vector<string> otherLine;
    string s;
    string tam = "";
    while (getline(cin, s)){
        if (isAmpliLine(s)) {
            otherLine.PB(tam);
            ampliLine.PB(s);
            tam = "";
        }
        else{
            vector<string> luu;
            stov(s, luu);
            FORN (i, 0, luu.size()) tam = tam + luu[i];
        }
    }
    if (!tam.empty()) otherLine.PB(tam);
    if (!otherLine[0].empty()) cout << otherLine[0] << endl;
    FORN (i, 0, ampliLine.size()){
        cout << ampliLine[i] << endl;
        if (i + 1 < otherLine.size()){
            cout << otherLine[i + 1] << endl;
        }
    }
}


#include <set>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <cassert>

#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef long long int64; //NOTES:int64
typedef unsigned long long uint64; //NOTES:uint64
const double pi = acos(-1.0); //NOTES:pi
const double eps = 1e-11; //NOTES:eps
const int MAXI = 2 << 29;

#define FORN(i,a,b)     for (int i=(a),_b=(b); i<_b; i++)
#define RFORN(i,b,a)    for (int i=(b)-1,_a=(a); i>=_a; i--)
#define RESET(a,b)      memset((a),(b),sizeof(a))

#define SC(x)           scanf("%d",&x)
#define SC2(x,y)        scanf("%d%d",&x,&y)
#define PR(x)           printf("%d ",x)
#define PR2(x,y)        printf("%d %d ",x,y)
#define PRS(x)          printf("%s",x)
#define END             printf("\n")
#define EXIT(x)         {PRS(x);return 0;}
#define DBG(x)          {cerr << "--> " << #x << " = " << x << endl;}

#define fi              first
#define se              second
#define PB              push_back
#define ALL(x)          (x).begin(),(x).end()
#define MP(X,Y)         make_pair(X,Y)//NOTES:MP(
#define TR(c, i)        for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x)   ((c).find(x) != (c).end())

int compare (const void *a, const void *b){
    return (*(int*)a-*(int*)b);
}

void startDBG(){
    PRS("------------------- Start Debug -------------------\n\n");
}

void endDBG(){
    PRS("\n\n------------------- End Debug -------------------\n");
}

template<class T> inline void DebM(T A[], T ii, T jj){//Debug sequence
    END;PRS("----------------DEBUG----------------");END;
    FORN (i,ii,jj) cout<<A[i]<<" ";
    END;PRS("-------------------------------------");END;
}
//Template code by ACRush
template<class T> inline bool isPrimeNumber(T n)//NOTES:isPrimeNumber(
{
    if (n <= 1)return false;
    for (T i = 2; i * i <= n; i++) if (n % i == 0) return false;
    return true;
}

template<class T> inline void checkmin(T &a, T b) {
    if (b < a) a = b;
}//NOTES:checkmin(

template<class T> inline void checkmax(T &a, T b) {
    if (b > a) a = b;
}//NOTES:checkmax(

template<class T> inline T sqr(T x) {
    return x*x;
}//NOTES:sqr

template<class T> inline T lowbit(T n) {
    return (n^(n - 1))&n;
}//NOTES:lowbit(

template<class T> inline int countbit(T n) {
    return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}//NOTES:countbit(
//Numberic Functions

int64 C(int64 m, int64 n){
    int64 tot = 1;
    int64 i = m;
    while (i > m - n)
        tot *= i--;
    i = n;
    while (i > 1) tot /= i--;
    return tot;
}

template<class T> inline T gcd(T a, T b)//NOTES:gcd(
{
    if (a < 0)return gcd(-a, b);
    if (b < 0)return gcd(a, -b);
    return (b == 0) ? a : gcd(b, a % b);
}

template<class T> inline T lcm(T a, T b)//NOTES:lcm(
{
    if (a < 0)return lcm(-a, b);
    if (b < 0)return lcm(a, -b);
    return a * (b / gcd(a, b));
}

template<class T> inline T euclide(T a, T b, T &x, T &y)//NOTES:euclide(
{
    if (a < 0) {
        T d = euclide(-a, b, x, y);
        x = -x;
        return d;
    }
    if (b < 0) {
        T d = euclide(a, -b, x, y);
        y = -y;
        return d;
    }
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    } else {
        T d = euclide(b, a % b, x, y);
        T t = x;
        x = y;
        y = t - (a / b) * y;
        return d;
    }
}

template<class T> inline vector<pair<T, int> > factorize(T n)//NOTES:factorize(
{
    vector<pair<T, int> > R;
    for (T i = 2; n > 1;) {
        if (n % i == 0) {
            int C = 0;
            for (; n % i == 0; C++, n /= i);
            R.push_back(make_pair(i, C));
        }
        i++;
        if (i > n / i) i = n;
    }
    if (n > 1) R.push_back(make_pair(n, 1));
    return R;
}

template<class T> inline T eularFunction(T n)//NOTES:eularFunction(
{
    vector<pair<T, int> > R = factorize(n);
    T r = n;
    for (int i = 0; i < R.size(); i++)r = r / R[i].first * (R[i].first - 1);
    return r;
}

//Matrix Operations
const int MaxMatrixSize = 40; //NOTES:MaxMatrixSize

template<class T> inline void showMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:showMatrix(
{
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++)cout << A[i][j];
        cout << endl;
    }
}

template<class T> inline T checkMod(T n, T m) {
    return (n % m + m) % m;
}//NOTES:checkMod(

template<class T> inline void identityMatrix(int n, T A[MaxMatrixSize][MaxMatrixSize])//NOTES:identityMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = (i == j) ? 1 : 0;
}

template<class T> inline void addMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] + B[i][j];
}

template<class T> inline void subMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = A[i][j] - B[i][j];
}

template<class T> inline void mulMatrix(int n, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j];
}

template<class T> inline void addModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:addModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] + B[i][j], m);
}

template<class T> inline void subModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T A[MaxMatrixSize][MaxMatrixSize], T B[MaxMatrixSize][MaxMatrixSize])//NOTES:subModMatrix(
{
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) C[i][j] = checkMod(A[i][j] - B[i][j], m);
}

template<class T> inline T multiplyMod(T a, T b, T m) {
    return (T) ((((int64) (a)*(int64) (b) % (int64) (m))+(int64) (m)) % (int64) (m));
}//NOTES:multiplyMod(

template<class T> inline void mulModMatrix(int n, T m, T C[MaxMatrixSize][MaxMatrixSize], T _A[MaxMatrixSize][MaxMatrixSize], T _B[MaxMatrixSize][MaxMatrixSize])//NOTES:mulModMatrix(
{
    T A[MaxMatrixSize][MaxMatrixSize], B[MaxMatrixSize][MaxMatrixSize];
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) A[i][j] = _A[i][j], B[i][j] = _B[i][j], C[i][j] = 0;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) for (int k = 0; k < n; k++) C[i][j] = (C[i][j] + multiplyMod(A[i][k], B[k][j], m)) % m;
}

template<class T> inline T powerMod(T p, int e, T m)//NOTES:powerMod(
{
    if (e == 0)return 1 % m;
    else if (e % 2 == 0) {
        T t = powerMod(p, e / 2, m);
        return multiplyMod(t, t, m);
    } else return multiplyMod(powerMod(p, e - 1, m), p, m);
}
//Point&Line

double dist(double x1, double y1, double x2, double y2) {
    return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}//NOTES:dist(

double distR(double x1, double y1, double x2, double y2) {
    return sqr(x1 - x2) + sqr(y1 - y2);
}//NOTES:distR(

template<class T> T cross(T x0, T y0, T x1, T y1, T x2, T y2) {
    return (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
}//NOTES:cross(

int crossOper(double x0, double y0, double x1, double y1, double x2, double y2)//NOTES:crossOper(
{
    double t = (x1 - x0)*(y2 - y0)-(x2 - x0)*(y1 - y0);
    if (fabs(t) <= eps) return 0;
    return (t < 0) ? -1 : 1;
}

bool isIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)//NOTES:isIntersect(
{
    return crossOper(x1, y1, x2, y2, x3, y3) * crossOper(x1, y1, x2, y2, x4, y4) < 0 && crossOper(x3, y3, x4, y4, x1, y1) * crossOper(x3, y3, x4, y4, x2, y2) < 0;
}

bool isMiddle(double s, double m, double t) {
    return fabs(s - m) <= eps | fabs(t - m) <= eps | (s < m) != (t < m);
}//NOTES:isMiddle(
//Translator

bool isUpperCase(char c) {
    return c >= 'A' && c <= 'Z';
}//NOTES:isUpperCase(

bool isLowerCase(char c) {
    return c >= 'a' && c <= 'z';
}//NOTES:isLowerCase(

bool isLetter(char c) {
    return c >= 'A' && c <= 'Z' | c >= 'a' && c <= 'z';
}//NOTES:isLetter(

bool isDigit(char c) {
    return c >= '0' && c <= '9';
}//NOTES:isDigit(

char toLowerCase(char c) {
    return (isUpperCase(c)) ? (c + 32) : c;
}//NOTES:toLowerCase(

char toUpperCase(char c) {
    return (isLowerCase(c)) ? (c - 32) : c;
}//NOTES:toUpperCase(

template<class T> string toString(T n) {
    ostringstream ost;
    ost << n;
    ost.flush();
    return ost.str();
}//NOTES:toString(

int toInt(string s) {
    int r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt(

int64 toInt64(string s) {
    int64 r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toInt64(

double toDouble(string s) {
    double r = 0;
    istringstream sin(s);
    sin >> r;
    return r;
}//NOTES:toDouble(

template<class T> void stoa(string s, int &n, T A[]) {
    n = 0;
    istringstream sin(s);
    for (T v; sin >> v; A[n++] = v);
}//NOTES:stoa(

template<class T> void atos(int n, T A[], string &s) {
    ostringstream sout;
    for (int i = 0; i < n; i++) {
        if (i > 0)sout << ' ';
        sout << A[i];
    }
    s = sout.str();
}//NOTES:atos(

template<class T> void atov(int n, T A[], vector<T> &vi) {
    vi.clear();
    for (int i = 0; i < n; i++) vi.push_back(A[i]);
}//NOTES:atov(

template<class T> void vtoa(vector<T> vi, int &n, T A[]) {
    n = vi.size();
    for (int i = 0; i < n; i++)A[i] = vi[i];
}//NOTES:vtoa(

template<class T> void stov(string s, vector<T> &vi) {
    vi.clear();
    istringstream sin(s);
    for (T v; sin >> v; vi.push_back(v));
}//NOTES:stov(

template<class T> void vtos(vector<T> vi, string &s) {
    ostringstream sout;
    for (int i = 0; i < vi.size(); i++) {
        if (i > 0)sout << ' ';
        sout << vi[i];
    }
    s = sout.str();
}//NOTES:vtos(
//Fraction

template<class T> struct Fraction {
    T a, b;
    Fraction(T a = 0, T b = 1);
    string toString();
}; //NOTES:Fraction

template<class T> Fraction<T>::Fraction(T a, T b) {
    T d = gcd(a, b);
    a /= d;
    b /= d;
    if (b < 0) a = -a, b = -b;
    this->a = a;
    this->b = b;
}

template<class T> string Fraction<T>::toString() {
    ostringstream sout;
    sout << a << "/" << b;
    return sout.str();
}

template<class T> Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b + q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b - q.a * p.b, p.b * q.b);
}

template<class T> Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.a, p.b * q.b);
}

template<class T> Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
    return Fraction<T > (p.a * q.b, p.b * q.a);
}
//Template code by ACRush

bool isAmpliLine(string s){
    vector<string> tam;
    stov(s, tam);
    if (tam.size() > 0 && tam[0][0] == '#') return true;
    return false;
}

int main(){
    //freopen ("INP.txt", "r", stdin);
    vector<string> ampliLine;
    vector<string> otherLine;
    string s;
    string tam = "";
    string luuString;
    while (getline(cin, s)){
        if (isAmpliLine(s)) {
            otherLine.PB(tam);
            ampliLine.PB(s);
            tam = "";
        }
        else{
            vector<string> luu;
            stov(s, luu);
            FORN (i, 0, luu.size()) tam = tam + luu[i];
        }
        luuString = s;
    }
    if (!isAmpliLine(luuString)) otherLine.PB(tam);
    if (!otherLine[0].empty()) cout << otherLine[0] << endl;
    FORN (i, 0, ampliLine.size()){
        cout << ampliLine[i] << endl;
        if (i + 1 < otherLine.size()){
            cout << otherLine[i + 1] << endl;
        }
    }
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=0,c_space;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(a==1)
                cout<<endl;
                a=1;
                cout<<s<<endl;
            }
            /*else if(s[i]=='\0')
            {
                if(a==1)
                cout<<endl;
                }*/
            else
            {
                while(s[i]!='\0')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }

            }
        }
        cout<<endl;
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=0,c_space;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(a==1)
                cout<<endl;
                a=1;
                cout<<s<<endl;
            }
            /*else if(s[i]=='\0')
            {
                if(a==1)
                cout<<endl;
                }*/
            else
            {
                while(s[i]!='\0')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }
            }
        }
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=0,c_space,f=0;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(f==1)
                cout<<endl;
               else if(a==0)
                cout<<endl;

                a=1;
                cout<<s<<endl;
            }
            else if(s[i]=='\0')
            {
                if(a==1)
                f=1;
            }
            else
            {
                a=0;
                while(s[i]!='\0')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }

            }
        }
        if(a==0)
        cout<<endl;
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=2,b=0,c_space,f=0;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(f==1)
                cout<<endl;
               else if(a==0)
                cout<<endl;

                a=1;
                cout<<s<<endl;
            }
            else if(s[i]=='\0')
            {
                if(a==1)
                f=1;
            }
            else
            {
                a=0;
                while(s[i]!='\0')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }

            }
        }
        if(a==0)
        cout<<endl;
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=0,c_space,f=0;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(f==1)
                cout<<endl;

                a=1;
                cout<<s<<endl;
            }
            else if(s[i]=='\0')
            {
                if(a==1)
                f=1;
            }
            else
            {
                a=0;
                while(s[i]!='\0')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }

            }
        }
        if(a==0)
        cout<<endl;
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=2,b=0,c_space,f=0;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(f==1)
                cout<<endl;
               else if(a==0)
                cout<<endl;

                a=1;
                cout<<s<<endl;
            }
            else if(s[i]=='\0')
            {
                if(a==1)
                f=1;
            }
            else
            {
                a=0;
                while( s[i]!='\0'&&s[i+1]!='\n')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }

            }
        }
        if(a==0)
        cout<<endl;
}


#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int a=2,b=0,c_space,f=0;

        while(getline(cin,s))
        {
            int i=0;
            c_space=0;
            while(s[i]==' ')
            {
                c_space++;
                i++;
            }
            if(s[i]=='#')
            {
                if(f==1)
                cout<<endl;
               else if(a==0)
                cout<<endl;

                a=1;
                cout<<s<<endl;
            }
            else if(s[i]=='\0'&&s[i+1]=='\n')
            {
                if(a==1)
                f=1;
            }
            else
            {
                a=0;
                while( s[i]!='\0'&&s[i+1]!='\n')
                {
                    if(s[i]!=' ')

                    cout<<s[i];
                    i++;
                }

            }
        }
        if(a==0)
        cout<<endl;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
    //FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    //while(fgets(input,1048580,fp)!=NULL)
    while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;

                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
    //FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;

                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    printf("%s",input);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;

                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    printf("%s\n",input);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[3048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(gets(input)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;
                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            flag2=0;
            printf("%s",input);

        }
    }
    if(flag2)
    printf("\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;
                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    if(!flag2)
    printf("\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;
                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            flag2=0;
            printf("%s",input);

        }
    }
    if(flag2)
    printf("\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;

                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    return 0;
}

[close]


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;

                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[3048580];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,3048580,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;
                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            flag2=0;
            printf("%s",input);

        }
    }
    if(flag2)
    printf("\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{

   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;

                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[1048580];
int main()
{
  //  FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,1048580,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        for(i=0;i<strlen(input)-1;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;
                }
                break;
            }
        }
        if(!flag)
        {
            for(i=0;i<strlen(input)-1;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            printf("%s",input);

        }
    }
    printf("\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char input[2000000];
int main()
{
   // FILE * fp=fopen("in.txt","r");
    int i,flag=0,flag2=0;
    while(fgets(input,2000000,stdin)!=NULL)
    //while(gets(input)!=NULL)
    {
        flag=0;
        int len=strlen(input)-1;
        for(i=0;i<len;i++)
        {
            if(input[i]!=' ')
            {
                if(input[i]=='#')
                {
                    flag=1;
                }
                break;
            }
        }
        if(!flag)
        {
            len=strlen(input)-1;
            for(i=0;i<len;i++)
            if(input[i]!=' ')printf("%c",input[i]);
            flag2=1;
        }
        else
        {
            if(flag2)printf("\n");
            flag2=0;
            printf("%s",input);

        }
    }
    if(flag2)
    printf("\n");
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	//freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			last=false;
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			last=false;
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	//freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	//printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	//freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			last=false;
			num++;
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[(1<<20)+10];
int main()
{
	//freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			last=false;
			num++;
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

using namespace std;
char s[1000010];
int main()
{
	//freopen("in.txt","r",stdin);
	int num=0;
	bool last=false;
	while (gets(s))
	{
		int n=strlen(s);
		char c=0;
		bool fl=false;
		FOR(i,0,n)
			if (s[i]!=' ')
			{
				fl=true;
				c=s[i];
				break;
			}
		if (!fl)
		{
			if (last)
				printf("\n");
			last=false;
			num++;
			continue;
		}
		if (c=='#')
		{
			if (num)
				printf("\n");
			printf("%s",s);
			last=true;
		}
		else
		{
			if (last)
				printf("\n");
			last=false;
			FOR(i,0,n)
				if (s[i]!=' ')
					printf("%c",s[i]);
		}
		num++;
	}
	printf("\n");
	return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    /*vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }*/
    string s;
    while (getline(cin, s))
    {
        vc vv;
        for (int i = 0; i < s.size(); i++)
            vv.push_back(s[i]);
        vvc.push_back(vv);
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size()-2; j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            //putchar(13);
            putchar(10);
        }
    }
    //putchar(13);
    putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    /*vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }*/
    string s;
    while (getline(cin, s))
    {
        vc vv;
        for (int i = 0; i < s.size(); i++)
            vv.push_back(s[i]);
        vvc.push_back(vv);
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i].size() && vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
            //putchar(13);
            putchar(10);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size(); j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            //putchar(13);
            putchar(10);
        }
    }
    //putchar(13);
    if (!amp[vvc.size()-1])
        putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    /*vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }*/
    string s;
    while (getline(cin, s))
    {
        vc vv;
        for (int i = 0; i < s.size(); i++)
            vv.push_back(s[i]);
        vvc.push_back(vv);
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i].size() && vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
            //putchar(13);
            putchar(10);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size(); j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
            // print newline if next is amp
            if (amp[i+1])
            {
                //putchar(13);
                putchar(10);
            }
        }
    }
    //putchar(13);
    if (!amp[vvc.size()-1])
        putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size()-2; j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            putchar(13);
            putchar(10);
        }
    }
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    /*vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }*/
    string s;
    while (getline(cin, s))
    {
        vc vv;
        for (int i = 0; i < s.size(); i++)
            vv.push_back(s[i]);
        vvc.push_back(vv);
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i].size() && vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
            //putchar(13);
            putchar(10);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size(); j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            //putchar(13);
            putchar(10);
        }
    }
    //putchar(13);
    putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    /*vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }*/
    string s;
    while (getline(cin, s))
    {
        vc vv;
        for (int i = 0; i < s.size(); i++)
            vv.push_back(s[i]);
        vvc.push_back(vv);
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i].size() && vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
            putchar(13);
            putchar(10);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size(); j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            putchar(13);
            putchar(10);
        }
    }
    putchar(13);
    putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size()-2; j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            //putchar(13);
            putchar(10);
        }
    }
    //putchar(13);
    putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


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

typedef vector<char> vc;

int main()
{
    char c;
    vector<vc> vvc;
    vector<char> v;
    while ((c = getchar()) != EOF)
        v.push_back(c);
    int ind = 1, ind2 = 0;
    while (ind < v.size())
    {
        while (ind < v.size() && !(v[ind-1] == 13 && v[ind] == 10))
            ind++;
        vector<char> av;
        for (int i = ind2; i <= ind; i++)
            av.push_back(v[i]);
        vvc.push_back(av);
        ind2 = ind+1;
        ind++;
    }
    vector<bool> amp(vvc.size()+1, 0);
    for (int i = 0; i < vvc.size(); i++)
    {
        int ind = 0;
        while (ind < vvc[i].size() && vvc[i][ind] == ' ')
            ind++;
        if (vvc[i][ind] == '#')
            amp[i] = true;
    }
    for (int i = 0; i < vvc.size(); i++)
    {
        //cout << "line " << i << " " << amp[i] << endl;
        if (amp[i])
        {
            // print as is
            for (int j = 0; j < vvc[i].size(); j++)
                putchar(vvc[i][j]);
        }
        else
        {
            // else print without any spaces
            for (int j = 0; j < vvc[i].size()-2; j++)
                if (vvc[i][j] != ' ')
                    putchar(vvc[i][j]);
        }
        // print newline if next is amp
        if (amp[i+1])
        {
            putchar(13);
            putchar(10);
        }
    }
    putchar(13);
    putchar(10);
    /*for (int i = 0; i < vvc.size(); i++)
    {
        for (int j = 0; j < vvc[i].size(); j++)
            cout << (int)vvc[i][j] << " ";
        cout << endl;
    }
    cout << endl;*/
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
    bool last=1;
    char str[10000];
    while(gets(str))
    {
        bool cur,flag=0;
        int len=strlen(str);
        for(int i=0;i<len;i++)
        {
            if(str[i]==' ') continue;
            else
            {
                flag=1;
                if(str[i]=='#'){
                    cur=1;
                    if(last) puts(str);
                    else printf("\n%s\n",str);
                    last=cur;
                    break;
                }
                else
                {
                    cur=0;
                    for(int j=0;j<len;j++) if(str[j]!=' ') putchar(str[j]);
                    last=cur;
                    break;
                }
            }
        }
        if(!flag) {last=0;}
    }
    if(!last) puts("");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
    bool last=1;
    char str[10000];
    while(gets(str))
    {
        bool yes;
        int len=strlen(str);
        int ind=0;
        for(ind=0;ind<len;ind++) if(str[ind]!=' ') break;
        if(str[ind]=='#') yes=1;
        else yes=0;
        if(yes)
        {
            if(!last) {
                puts("");puts(str);
            }
            else puts(str);
        }
        else {
            for(int i=ind;i<len;i++) if(str[i]!=' ') putchar(str[i]);
        }
        last=yes;
    }
    if(!last) puts("");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
vector<string> str;
vector<int> flag;
int main()
{
    //freopen("in.txt","r",stdin);
    char tmp[10000];
    while(gets(tmp)) str.push_back(tmp);
    int cnt=(int)str.size();
    for(int i=0;i<cnt;i++)
    {
        bool is_flag=0;
        for(int j=0;j<(int)str[i].length();j++)
        {
            if(str[i][j]==' ') continue;
            else
            {
                is_flag=1;
                if(str[i][j]=='#') {flag.push_back(1);break;}
                else {flag.push_back(0);break;}
            }
        }
        if(!is_flag) flag.push_back(0);
    }
    for(int i=0;i<cnt;i++)
    {
        string tmp;
        if(flag[i]) continue;
        for(int j=0;j<(int)str[i].length();j++)
        {
            if(str[i][j]!=' ') tmp+=str[i][j];
        }
        str[i]=tmp;
    }
    int ind=0;
    while(ind<cnt)
    {
        if(flag[ind]) cout<<str[ind++]<<endl;
        else
        {
            while(ind<cnt&&!flag[ind]) cout<<str[ind++];
            cout<<endl;
        }
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
    //freopen("in.txt","r",stdin);
    bool last=1;
    char str[10000];
    while(gets(str))
    {
        bool cur,flag=0;
        int len=strlen(str);
        for(int i=0;i<len;i++)
        {
            if(str[i]==' ') continue;
            else
            {
                flag=1;
                if(str[i]=='#'){
                    cur=1;
                    if(last) puts(str);
                    else printf("\n%s\n",str);
                    last=cur;
                    break;
                }
                else
                {
                    cur=0;
                    for(int j=0;j<len;j++) if(str[j]!=' ') putchar(str[j]);
                    last=cur;
                    break;
                }
            }
        }
        if(!flag) puts("");
    }
    if(!last) puts("");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
//  freopen("in.txt","r",stdin);
    bool last=1;
    char str[10000];
    while(gets(str))
    {
        bool yes;
        int len=strlen(str);
        int ind=0;
        for(ind=0;ind<len;ind++) if(str[ind]!=' ') break;
        if(str[ind]=='#') yes=1;
        else yes=0;
        if(yes)
        {
            if(!last) {
                puts("");puts(str);
            }
            else puts(str);
        }
        else {
            for(int i=ind;i<len;i++) if(str[i]!=' '&&str[i]!='\n') putchar(str[i]);
        }
        last=yes;
    }
    if(!last) puts("");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
const int N=100000;
char tmp[N][130];
bool flag[N];
int main()
{
    //freopen("in.txt","r",stdin);
    int cnt=0;
    while(gets(tmp[cnt]))
    {
        //puts(str[cnt]);
        cnt++;
    }
    string str[N],output[N];
    //for(int i=0;i<cnt;i++) puts(tmp[i]);
    for(int i=0;i<cnt;i++) str[i]=tmp[i];
    //for(int i=0;i<cnt;i++) cout<<str[i]<<endl;
    for(int i=0;i<cnt;i++)
    {
        for(int j=0;j<(int)str[i].length();j++)
        {
            if(str[i][j]==' ') continue;
            else if(str[i][j]=='#') {flag[i]=1;break;}
            else break;
        }
    }
    for(int i=0;i<cnt;i++)
    {
        if(flag[i]) continue;
        else
        {
            string tmp;
            for(int j=0;j<(int)str[i].length();j++)
            {
                if(str[i][j]!=' ') tmp+=str[i][j];
            }
            str[i]=tmp;
        }
    }
    //for(int i=0;i<cnt;i++) printf("%d\n",(int)str[i].length());
    //for(int i=0;i<cnt;i++) cout<<str[i]<<endl;
    //for(int i=0;i<cnt;i++) printf("%d ",flag[i]);puts("");
    int res=0,data=0;
    for(int i=0;i<cnt;i++)
    {
        if(flag[i]) {

            if(data==0) output[res++]=str[i];
            else
            {
                output[++res]=str[i];res++;
            }
            data++;
        }
        else output[res]+=str[i];
    }
    //printf("res=%d\n",res);
    if(flag[cnt-1]) res--;
    for(int i=0;i<=res;i++) cout<<output[i]<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
    int cnt=0;
    bool last=0;
    char str[10000];
    while(gets(str))
    {
        bool is_3=0;
        int len=strlen(str);
        for(int i=0;i<len;i++)
        {
            if(str[i]==' ')continue;
            else
            {
                if(str[i]=='#'){is_3=1;last=1;break;}
                else {last=0;break;}
            }
        }
        if(is_3)
        {
            if(cnt==0) {printf("%s\n",str);}
            else {printf("\n%s\n",str);}
        }
        else
        {
            for(int i=0;i<len;i++) if(str[i]!=' ') putchar(str[i]);
        }
        cnt++;
    }
    if(!last) puts("");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
    freopen("in.txt","r",stdin);
    bool flag=0;
    char str[10000];
    while(gets(str))
    {
        bool is_3=0;
        int len=strlen(str);
        for(int i=0;i<len;i++)
        {
            if(str[i]==' ')continue;
            else
            {
                if(str[i]=='#'){is_3=1;break;}
                else break;
            }
        }
        if(is_3)
        {
            if(!flag) {printf("%s\n",str);flag=1;}
            else {printf("\n%s\n",str);}
        }
        else
        {
            for(int i=0;i<len;i++) if(str[i]!=' ') putchar(str[i]);
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
   // freopen("in.txt","r",stdin);
    bool flag=0;
    char str[10000];
    while(gets(str))
    {
        bool is_3=0;
        int len=strlen(str);
        for(int i=0;i<len;i++)
        {
            if(str[i]==' ')continue;
            else
            {
                if(str[i]=='#'){is_3=1;break;}
                else break;
            }
        }
        if(is_3)
        {
            if(!flag) {printf("%s\n",str);flag=1;}
            else {printf("\n%s\n",str);}
        }
        else
        {
            for(int i=0;i<len;i++) if(str[i]!=' ') putchar(str[i]);
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <algorithm>
using namespace std;
typedef long long LL;
#define eps (1e-8)
int main()
{
//  freopen("in.txt","r",stdin);
    bool last=1;
    string str;
    while(getline(cin,str))
    {
        bool yes;
        LL len=(int)str.length();
        LL ind=0;
        for(ind=0;ind<len;ind++) if(str[ind]!=' ') break;
        if(str[ind]=='#') yes=1;
        else yes=0;
        if(yes)
        {
            if(!last) {
                puts("");puts(str);
            }
            else puts(str);
        }
        else {
            for(int i=ind;i<len;i++) if(str[i]!=' ') putchar(str[i]);
        }
        last=yes;
    }
    if(!last) puts("");
    return 0;
}