Professional Documents
Culture Documents
*;
import java.io.*;
class Main{
}
}
import java.io.*;
import java.util.*;
class Main
{
public static void main(String arg[])
{
int i=0;
String s[]=new String[3];
Scanner sc =new Scanner(System.in);
for(i=0;i<3;i++)
s[i]=sc.nextLine();
i=0;
char ch[]=new char[100];
while(i<3)
{
ch=s[i].toCharArray();
int k=0,size=0;
size=s[i].length();
while(k<size)
{
if(k==0||ch[k-1]==32)
{
if(ch[k]>=65&&ch[k]<=90)
{
while(ch[k]!=32 )
{System.out.print(ch[k]);
k++;
}
}
}
k++;
}
}
}
}
import java.io.*;
import java.util.*;
class Main()
{
public static void main(String arg[])
{
Scanner sc=new Scanner(System.in);
int id[]=new id[10];
int a[]=new a[10];
int k=0;
while(k<10)
{
id[k]=sc.nextInt();
System.out.print("-");
a[k]=sc.nextInt();
System.out.println("");
k++;
}
int temp;
for(int i=0;i<9;i++)
{
for(int j=i+1;j<9;j++)
{
if(id[i]>id[j])
{
temp=id[i];
id[i]=id[j];
id[j]=temp;
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(int i=0;i<9;i++)
{
for(int j=i+1;j<10;j++)
{
if(id[i]==id[j])
{
System.out.print(id[i]);
System.out.print("-");
if(a[i]>a[j])
System.out.print(a[i]);
else
System.out.print(a[j]);
j++;
}
System.out.print(id[i]);
System.out.print("-");
System.out.print(a[i]);
}
}
}
}
}