#include<bits/stdc++.h>
using namespace std;
struct area{
int height;
int width;
};
int main(){
int on=1;
int m;
int h[m],w[m];
area a[m];
area temp;
for(m=0;;m++){
cout<<"width? ";
cin>>h[m];
if(h[m]==-1)
{
for(int i=0;i<m;i++){
for(int j=1;j<m-i-1;j++){
if((a[j].height*a[j].width)>(a[j+1].height*a[j+1].width))
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}}
break;}
cout<<"height? ";
cin>>w[m];
a[m]={w[m],h[m]};
}
for(int k=0;k<m;k++){
cout<<a[k].width<<","<<a[k].height<<endl;
}
}