import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt(); String[]s=new String[n+1]; int length=0; for (int i = 0; i < s.length; i++) { s[i]=sc.nextLine(); if(s[i].equals("stop")){ break;} length++; } for (int i =1; i < length-1; i++) { for (int j =1; j < length-1; j++) { if(s[j].length()>s[j+1].length()){ String temp=s[j]; s[j]=s[j+1]; s[j+1]=temp; } } } for (int i =1; i < length; i++) { System.out.println(s[i]); } } } }
0.0分
2 人评分