# data[].attributes.attachment_link.readable_text
#include<bits/stdc++.h>
using namespace std;
string s,m;
char s1;
int main()
{
	getline(cin,s);
	cin>>s1;
	s+=" ";
	for (int i=0;i<s.length();i++)
		if (s[i]==s1)
	{
		cout<<s.substr(i,s.find(' '))<<endl;
	}
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
string s,m,t;
char s1;
int MAX;
int main()
{
getline(cin,s);
cin>>s1;
s+=" ";
while(s.find(" ")!=-1){
m=s.substr(0,s.find(" "));
if (m[0]==s1 && m.size()>t.size() )
{t=m;}
s.erase(0,s.find(" ")+1);
}
cout<<t;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n;
bool kt=0;
int main(){
cin>>n;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
for(int l=1;l<=n;l++)
for(int k=1;k<=n;k++){
if (i*i+j*j+k*k+l*l==n) kt=1;
}
if (kt==0) cout<<"khong sieu chinh phuong";else cout<<"sieu chinh phuong";
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,k,mid,s,a[100000];
int main(){
cin>>n>>k;
for (int i=1;i<=n;i++)
cin>>a[i];
for (int i=1;i<=n;i++){
s=k+i;
int d=1,c=n;
while(d<c){
mid=(d+c)/2;
if (a[mid]==s)
{
cout<<i<<" "<<mid;
break;
}
else if (s>a[mid]) d=mid+1;
else c=mid-1;
}
}
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int a[100000],t,n,m=0;
int main(){
cin>>n;
for (int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<n;i++)
for(int j=2;j<=n;j++){
t=a[i]*a[j];
if (t>m) m=t;

}
cout<<m;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int uc(int a,int b){
if (b==0) return a;
return uc(b,a%b);
}
int a,b;
int main(){
cin>>a>>b;
int ucln = uc(a,b);
a=a/ucln;
b=b/ucln;
if (b==0) cout<<"INVALID";
else {if (b!=1)
{
if (b<0){
b*=-1;
a*=-1;
}
cout<<a<<" "<<b;
}
else{
cout<<a;
}
return 0;
}
}

# data[].attributes.attachment_link.readable_text
#include<bits/stdc++.h>
using namespace std;
int n,k,p;
long long t;
int main(){
	cin>>n>>k>>p;
	while (n>=k) {
		n-=k+1;
		t+=k*p;
	}
	t+=n*p;
	cout<<t;
}

# data[].attributes.attachment_link.readable_text
#include<bits/stdc++.h>
using namespace std;
long long l,r,nt[100000000];
int d;
void snt(long long n){
	for (long long i=2;i<=n;i++)
		nt[i]=1;
	for (long long i=2;i<=n;i++)
		if (nt[i]==1) 
			for (long long k=i*i;k<=n;k+=i)
				nt[k]=0;
}
int tu(long long n){
	int t=1;
	for (long long i=2;i<=n;i++)
		if (n%i==0) t++;
	return t;
}
int main(){
	cin>>l>>r;
	snt(r);
	for (long long i=l;i<=r;i++)
		if ((!nt[i])&&nt[tu(i)]) d++;
	cout<<d;
}

# data[].attributes.body
#include <bits/stdc++.h>
using namespace std;
int n,y,k,d;
int main()
{
cin>>y>>k>>n;
for(int i=1;i<=n;i++)
if((y+i)%k==0&&(i+y)<n) {
d++;
cout<<i<<" ";
}
if(d==0) cout<<-1;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
map<int,int>kt;
int n,a,b,d;
int main(){
cin>>n;
for (int i=1;i<=n;i++) {
cin>>a>>b;
for (int k=a;k<=b;k++)
kt[k]++;
}
for (auto i:kt) {
if (i.second>d) d=i.second;
}
cout<<d;
}

# data[].attributes.attachment_link.readable_text
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

int main(){
  int n;double s;
  cin >> n;
  for (int i=1; i<=n; i++)
    s+=(double)pow(-1,i)/i;
  cout << setprecision(2) << fixed << s << endl;
}

# data[].attributes.attachment_link.readable_text
#include <cmath>
#include <iostream>
using namespace std;

int main(){
  int n,s=0,x=0;
  cin >> x >> n;
  for (int i=1; i <=n; i++)
    s += pow(x,i*2);
  cout << s << endl;
}

# data[].attributes.attachment_link.readable_text
#include <iostream>
#include <cmath>
using namespace std;

int main(){
  double n, s = 0;
  cin >> n;
  while (n--) {
    s = sqrt((n + 1) + s);
  }
  cout << s;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,a[10000],x;
int main() {
freopen("bai6.inp", "r", stdin);
freopen("bai6.out", "w", stdout);
cin >> n;
for (int i=1;i<=n;i++)
cin >>a[i];      cin >> x;
sort (a+1,a+1+n);
for (int i=1;i<=n;i++)
cout << a[i]<<" ";
cout << endl;
int c=1;
while((c<=n)&&(x>=a[c])) c++;
for(int j=n+1;j>c;j--){
a[j]=a[j-1]; }
a[c]=x;
n++;
for(int i=1;i<=n;i++){
cout<<a[i]<<" "; } }

# data[].attributes.body
#include <bits/stdc++.h>

using namespace std;

long long n,a[10000000],d,x;

long long  tong(int x,int y)

{long long t=0;

for(int i=x;i<=y;i++)

t=t+a[i];

return t;

}

int main()

{

cin>>n>>x;

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

cin>>a[i];

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

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

if(tong(i,j)==x) d++;