/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }

#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,s,v,r;
    int pp = -1, suiv = -1, minv = mod;
    siii(n,s,x);
    int p = 1+(n-1)/1000;
    for(int i = 1; i <= n; i += p) {
        printf("? %d\n", i);
        fflush(stdout);
        sii(v, r);
        if (v < x && v > pp) { pp = v; suiv = r; }
        minv = min(minv, v);
    }
    if (pp == -1) { printf("! %d\n", minv); }
    else if (suiv == -1) { printf("! -1\n"); }
    else {
        v = -1;
        while (v < x) {
            printf("? %d\n", suiv);
            fflush(stdout);
            sii(v, suiv);
        }
        printf("! %d\n", v);
    }
    return 0;

}


/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }

#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,s,v,r,v2,r2;
    int pp = -1, suiv = -1, minv = mod;
    siii(n,s,x);
    D pm = 1;
    int p = 0;
    if (n >= 2000) {
    int m = 1999;
    fin2(i, 1, 1999) {
        if (pow(((D) (n - m + i)) / (D) n, (D) i) < pm) { pm = pow(((D) (n - m + i)) / (D) n, (D) i); p = i; }
    }
    }
    else { p = n; }
    for(int i = 1; i <= p-2; i++) {
        int lol = rand();
        int output = (n < 2000) ? i : rand() % n + 1;
        printf("? %d\n", output);
        fflush(stdout);
        sii(v, r);
        if (v < x && v > pp) { pp = v; suiv = r; }
        minv = min(minv, v);
    }
    if (pp == -1) { printf("! %d\n", minv); }
    else if (suiv == -1) { printf("! -1\n"); }
    else {
        v = -1;
        while (v < x && suiv > 0) {
            printf("? %d\n", suiv);
            fflush(stdout);
            sii(v, suiv);
        }
        if (v < x) { printf("! -1\n"); }
        else { printf("! %d\n", v); }
    }
    return 0;

}


/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }

#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,s,v,r,v2,r2;
    int pp = -1, suiv = -1, minv = mod;
    siii(n,s,x);
    D pm = 1;
    int p = 0;
    if (n >= 2000) {
    int m = 1999;
    fin2(i, 1, 1999) {
        if (pow(((D) (n - m + i)) / (D) n, (D) i) < pm) { pm = pow(((D) (n - m + i)) / (D) n, (D) i); p = i; }
    }
    }
    else { p = min(1000, n); }
    for(int i = 1; i <= p; i++) {
        int lol = rand();
        int output = (n < 1000) ? i : rand() % n + 1;
        printf("? %d\n", output);
        fflush(stdout);
        sii(v, r);
        if (v < x && v > pp) { pp = v; suiv = r; }
        minv = min(minv, v);
    }
    if (pp == -1) { printf("! %d\n", minv); }
    else if (suiv == -1) { printf("! -1\n"); }
    else {
        v = -1;
        while (v < x && suiv > 0) {
            printf("? %d\n", suiv);
            fflush(stdout);
            sii(v, suiv);
        }
        if (v < x) { printf("! -1\n"); }
        else { printf("! %d\n", v); }
    }
    return 0;

}


/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }

#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,s,v,r,v2,r2;
    int pp = -1, suiv = -1, minv = mod;
    siii(n,s,x);
    for(int i = 1; i <= 1000; i ++) {
        int output = rand() % n + 1;
        printf("? %d\n", output);
        fflush(stdout);
        sii(v, r);
        if (v < x && v > pp) { pp = v; suiv = r; }
        minv = min(minv, v);
    }
    if (pp == -1) { printf("! %d\n", minv); }
    else if (suiv == -1) { printf("! -1\n"); }
    else {
        v = -1;
        while (v < x && suiv > 0) {
            printf("? %d\n", suiv);
            fflush(stdout);
            sii(v, suiv);
        }
        if (v < x) { printf("! -1\n"); }
        else { printf("! %d\n", v); }
    }
    return 0;

}


/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }

#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,s,v,r,v2,r2;
    int pp = -1, suiv = -1, minv = mod;
    siii(n,s,x);
    int p = 1+(n-1)/1000;
    for(int i = 1; i <= n; i += p) {
        printf("? %d\n", i);
        fflush(stdout);
        sii(v, r);
        if (v < x && v > pp) { pp = v; suiv = r; }
        minv = min(minv, v);
    }
    if (pp == -1) { printf("! %d\n", minv); }
    else if (suiv == -1) { printf("! -1\n"); }
    else {
        v = -1;
        while (v < x && suiv >= 0) {
            printf("? %d\n", suiv);
            fflush(stdout);
            sii(v, suiv);
        }
        if (v < x) { printf("! -1\n"); }
        else { printf("! %d\n", v); }
    }
    return 0;

}


/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <pthread.h>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000007
#define PI 3.1415926535897932384626

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define sd(n) scanf("%lf", &n)
#define sdd(n,m) scanf("%lf %lf", &n, &m)
#define sddd(n,m,k) scanf("%lf %lf %lf", &n, &m, &k)
#define sc(c) scanf("%c", &c)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }
#define sad(t,n) fin(i,n) { scanf("%lf", &t[i]); }

#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s)
#define pi(n) printf("%d\n", n)
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pd(n) printf("%lf\n", n)
#define pdd(n,m) printf("%lf %lf\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n")
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n")
#define pad(t,n) fin(i,n) { printf("%lf ", t[i]); } printf("\n")

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,s,v,r,v2,r2;
    int pp = -1, suiv = -1, minv = mod;
    siii(n,s,x);
    D pm = 1;
    int p = 0;
    fin2(i, 1, 2000) {
        if (pow(((D) n - 1999 + i) / (D) n, (D) i) < pm) { pm = pow(((D) n - 1999 + i) / (D) n, (D) i); p = i; }
    }
    for(int i = 1; i <= p; i ++) {
        int lol = rand();
        int output = rand() % n + 1;
        printf("? %d\n", output);
        fflush(stdout);
        sii(v, r);
        if (v < x && v > pp) { pp = v; suiv = r; }
        minv = min(minv, v);
    }
    if (pp == -1) { printf("! %d\n", minv); }
    else if (suiv == -1) { printf("! -1\n"); }
    else {
        v = -1;
        while (v < x && suiv > 0) {
            printf("? %d\n", suiv);
            fflush(stdout);
            sii(v, suiv);
        }
        if (v < x) { printf("! -1\n"); }
        else { printf("! %d\n", v); }
    }
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
}
void revv(){
	cin>>val>>idx;
}
bool used[50005];
int main(){
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	min1=val;
	imin=strt;
	inext=idx;
	used[strt]=true;
	for(i=1;i<=999;i++){
		j=rand()%n+1;
		if(!used[j]){
			used[j]=true;
			ask(j);
			revv();
		}
		else{
			i--;
		}
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<"cac "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<-1;
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
//bool used[50005];
int main(){
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
//	used[strt]=true;
	for(i=1;i<=1000;i++){
		j=(rand()*rand())%n+1;
		ask(j);
		revv();
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=998;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<"! -1"<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
bool used[50005];
int main(){
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val;
		return 0;
	}
	used[strt]=true;
	for(i=1;i<=999;i++){
		j=rand()%n+1;
		if(!used[j]){
			used[j]=true;
			ask(j);
			revv();
		}
		else{
			i--;
		}
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<-1;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
//bool used[50005];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
//	used[strt]=true;
	for(i=1;i<=999;i++){
		j=rand()%n+1;
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<-1<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
//bool used[50005];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
//	used[strt]=true;
	for(i=1;i<=15;i++){
		j=rand()%n+1;
		ask(j);
		revv();
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<"! -1"<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
//bool used[50005];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
//	used[strt]=true;
	for(i=1;i<=999;i++){
		j=rand()%n+1;
		ask(j);
		revv();
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<"! -1"<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
bool used[50005];
int main(){
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
	used[strt]=true;
	for(i=1;i<=999;i++){
		j=rand()%n+1;
		if(!used[j]){
			used[j]=true;
			ask(j);
			revv();
		}
		else{
			i--;
		}
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<-1<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
//bool used[50005];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
//	used[strt]=true;
	for(i=1;i<=999;i++){
		j=rand()%n+1;
		ask(j);
		revv();
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=999;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<-1<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int val,idx;
void ask(int x){
	cout<<"? "<<x<<endl;
	fflush(stdout);
}
void revv(){
	cin>>val>>idx;
}
//bool used[50005];
int main(){
	srand(time(0));
	int n,strt,k,i,j,min1=0,imin,inext;
//	bool break1=true;
	cin>>n>>strt>>k;
	ask(strt);
	revv();
	if(val<k){
		min1=val;
		imin=strt;
		inext=idx;
	}
	else{
		cout<<"! "<<val<<endl;
		fflush(stdout);
		return 0;
	}
//	used[strt]=true;
	for(i=1;i<=1000;i++){
		j=(rand()*rand())%n+1;
		ask(j);
		revv();
//		for(j=1;j<=n;j++){
//			if(used[j]){
//				if(j==n){
//					break1=0;
//				}
//			}
//			else{
//				break;
//			}
//		}
//		if(!break1){
//			break;
//		}
		if(val<k&&val>min1){
			min1=val;
			imin=j;
			inext=idx;
		}
	}
	//cout<<min1<<" "<<imin<<" "<<inext<<endl;
	for(i=1;i<=998;i++){
		if(inext!=-1){
			ask(inext);
			revv();
		}
		else{
			cout<<"! -1"<<endl;
			fflush(stdout);
			return 0;
		}
		if(val>=k){
			cout<<"! "<<val<<endl;
			fflush(stdout);
			return 0;
		}
		else{
			imin=inext;
			inext=idx;
			min1=val;
		}
	}
}


#include<bits/stdc++.h>
#include<ctime>
#include<random>
using namespace std;
//
vector<pair<int, int> > v;

int ask(int id){
	printf("? %d\n", id);
	fflush(stdout);
	int a,b;
	scanf("%d%d", &a, &b);
	v.push_back(make_pair(a, id));
	return b;
}

int main(){
	v.push_back(make_pair(INT_MAX, -1));
	int n;
	cin >> n;
	uniform_int_distribution<> uf(1, n);
	random_device rd;
	mt19937 rnd(rd());
	int star;
	int x;
	cin >> star >> x;
	ask(star);
	for (int i = 0; i < 1600; i++){
		ask(max(1,(int)rnd()%n));
	}
	sort(v.begin(), v.end());
	int id = lower_bound(v.begin(), v.end(), make_pair(x, -1)) - v.begin();
	id--;
	if (id >= 0){
		int cur = v[id].second;
		while (cur != v[id + 1].second){
			cur=ask(cur);
		}
	}
	sort(v.begin(), v.end());
	id = lower_bound(v.begin(), v.end(), make_pair(x, -1)) - v.begin();
	if (v[id].second == -1){
		v[id].first = -1;
	}
	cout <<"! "<<v[id].first<< endl;
	fflush(stdout);
	return 0;
}////


#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
const int m = 999;
int n,st,x;
pair<int,int> a[1111];
int main()
{
	srand(time(0));
	cout<<rand()<<endl;
	return 0;
	cin>>n>>st>>x;
	int i,j,h,o,y,z;
	h=-1;
	o=st;
	for(i=1;i<=m;i=i+1){
		j=(rand()+rand()*rand())%n+1;
		cout<<"? "<<j<<endl;
		cin>>y>>z;
		if(y<=x&&y>h){
			h=y;
			o=j;
		}
	}
	while(o!=-1&&h<x){
		cout<<"? "<<o<<endl;
		cin>>h>>o;
	}
	if(h<x){
		cout<<"! -1\n";
		return 0;
	}
	cout<<"! "<<h<<endl;
	return 0;
}


#include <bits/stdc++.h>
#include <vector>
using namespace std;
char c;
int cnt;
vector<string> v[1000001];
void add(int k)
{
    cnt=max(k,cnt);
    string s;
    int n;
    if(k==1)s+=c;
    while((c=getchar())!=',')s+=c;
    cin>>n;
    getchar();

    v[k].push_back(s);
    for(int i=1;i<=n;i++)
    {
        add(k+1);
    }

}
int main()
{
    while(cin>>c){add(1);}
    cout<<cnt<<"\n";
    for(int i=1;i<=cnt;i++)
    {
        for(int j=0;j<v[i].size();j++)
            cout<<v[i][j]<<" ";
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <vector>
using namespace std;
char c;
int cnt;
vector<string> v[1000001];
void add(int k)
{
    cnt=max(k,cnt);
    string s;
    int n;
    if(k==1)s+=c;
    while((c=getchar())!=',')s+=c;
    cin>>n;
    getchar();

    v[k].push_back(s);
    for(int i=1;i<=n;i++)
    {
        add(k+1);
    }

}
int main()
{
    while(cin>>c){add(1);}
    for(int i=1;i<=cnt;i++)
    {
        for(int j=0;j<v[i].size();j++)
            cout<<v[i][j]<<" ";
        cout<<"\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
string s;
int n,ma,visited[1000001];
vector<string> vs,h[1000001];
vector<int> vn;

void DFS(int& s,int l)
{
    visited[s] =1;
    int tmp=s;
    ma=max(ma,l);
    //cout<<s<<" "<<vs[s]<<" "<<l<<endl;
    h[l].push_back(vs[s]);
    for(int i=1;i<=vn[tmp];i++)
    {
        s++;
        //cout<<i<<" ";
        DFS(s,l+1);
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin>>s;
    for(int i=0;i<s.length();i++)
    {
        int j=i;
        string r;
        while(s[j]!=',')
        {
            r+=s[j];
            j++;
        }
        vs.push_back(r);
        vn.push_back(s[++j]-'0');
        i=j+1;
    }
    //for(int i=0;i<vs.size();i++)cout<<vs[i]<<vn[i]<<endl;
    for(int i=0;i<vs.size();i++)
    {
        if(!visited[i])
        DFS(i,1);
    }
    cout<<ma<<"\n";
    for(int i=1;i<=ma;i++)
    {
        for(int j=0;j<h[i].size();j++)
            cout<<h[i][j]<<" ";
        cout<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
#define LL long long
using namespace std;
int n,k;
struct Node
{
    int l,r;
    int len;
}x[200005];
int a[200005];

bool cmp(Node a,Node b)
{
    return a.len < b.len;
}
int main()
{
    while(cin >> n >> k)
    {
        int num = 0,tmp;
        int sum = 0;
        a[0] = 0;
        for(int i = 1; i <= n; i++)
        {
            scanf("%d",&a[i]);
            if (a[i]<0)
                k--;
            if (a[i-1]>=0&&a[i]<0 || a[i-1]<0&&a[i]>=0)
                sum++;
        }
        if (k<0)
        {
            printf("-1\n");
            continue;
        }
        int p = 1;
        while(p<=n && a[p]>=0) p++;
        Node FUCK;
        FUCK.len = -1
        for (int i = p; i <= n; i++)
        {
            if (a[i]>=0)
            {
                x[num].l = i;
                while(i<=n && a[i]>=0)
                    i++;
                x[num].r = i;
                if (r==n+1)
                {
                    Fuck = x[num];
                    Fuck.len = x[num].r = x[num].l;
                    continue;
                }
                x[num].len = x[num].r-x[num].l;
                ++num;
            }
        }
        sort(x,x+num,cmp);

        p = 0;
        while(p < num && x[p].len<=k)
        {
            sum-=2;
            k-=x[p].len;
            p++;
        }
        if (FUCK.len!=-1 && k>=Fuck.len)
            sum--;
        printf("%d\n",sum);
    }

}


#include<bits/stdc++.h>
#define LL long long
using namespace std;
char s[1000005];
char *name;
int len;
int mx;
vector<string> v[300005];
bool isalp(char c)
{
    return c>='a'&&c<='z'||c>='A'&&c<='Z';
}
int getnum(int &p)
{
    int num = 0;
    while(p < len && s[p]>='0'&&s[p]<='9')
        num = num*10+s[p++]-'0';
    return num;
}
string getname(int & p)
{
    char *c = new char[1000005];
    int k = 0;
    while(p<len && isalp(s[p]))
    {
        c[k++] = s[p];
        p++;
    }
    c[k] = 0;
    string s(c);
    return c;
}
void solve(int &p,int deep)
{
    if (p>=len)
        return;

    v[deep].push_back(getname(p));
    p++;
    int num = getnum(p);
    p++;
    for (int i = 0 ; i < num; i++)
    {
        solve(p,deep+1);
    }
    mx = max(deep+1,mx);
}
int main()
{
    memset(s,0,sizeof(s));
    while(scanf("%s",s)!=EOF)
    {
        len = strlen(s);
        int p = 0;
        mx = 0;
        while(p<len)
            solve(p,0);
        p = 0;
        printf("%d\n",mx);
        while(p<mx)
        {
            for (int i = 0 ; i < v[p].size(); i++)
            {
                cout << v[p][i];
                printf("%c",i==v[p].size()-1?'\n':' ');
            }
            p++;
        }
        for (int i = 0 ; i <= mx; i++)
        {
            v[i].clear();
        }

    }

}


#include<bits/stdc++.h>
#define LL long long
using namespace std;
char s[1000005];
char *name;
int len;
int mx;
vector<string> v[300005];
bool isalp(char c)
{
    return c>='a'&&c<='z'||c>='A'&&c<='Z';
}
int getnum(int &p)
{
    int num = 0;
    while(p < len && s[p]>='0'&&s[p]<='9')
        num = num*10+s[p++]-'0';
    return num;
}
string getname(int & p)
{
    char *c = new char[1000005];
    int k = 0;
    while(p<len && isalp(s[p]))
    {
        c[k++] = s[p];
        p++;
    }
    c[k] = 0;
    string s(c);
    delete c;
    return s;
}
void solve(int &p,int deep)
{
    if (p>=len)
        return;

    v[deep].push_back(getname(p));
    p++;
    int num = getnum(p);
    p++;
    for (int i = 0 ; i < num; i++)
    {
        solve(p,deep+1);
    }
    mx = max(deep+1,mx);
}
int main()
{
    memset(s,0,sizeof(s));
    while(scanf("%s",s)!=EOF)
    {
        len = strlen(s);
        int p = 0;
        mx = 0;
        while(p<len)
            solve(p,0);
        p = 0;
        printf("%d\n",mx);
        while(p<mx)
        {
            for (int i = 0 ; i < v[p].size(); i++)
            {
                cout << v[p][i];
                printf("%c",i==v[p].size()-1?'\n':' ');
            }
            p++;
        }
        for (int i = 0 ; i <= mx; i++)
        {
            v[i].clear();
        }

    }

}


#include<bits/stdc++.h>
#define LL long long
using namespace std;
char s[1000005];
char *name;
int len;
int mx;
vector<char*> v[300005];
bool isalp(char c)
{
    return c>='a'&&c<='z'||c>='A'&&c<='Z';
}
int getnum(int &p)
{
    int num = 0;
    while(p < len && s[p]>='0'&&s[p]<='9')
        num = num*10+s[p++]-'0';
    return num;
}
char *getname(int & p)
{
    char *c = new char[100];
    int k = 0;
    while(p<len && isalp(s[p]))
    {
        c[k++] = s[p];
        p++;
    }
    c[k] = 0;
    return c;
}
void solve(int &p,int deep)
{
    if (p>=len)
        return;

    char * c = getname(p);
    v[deep].push_back(c);
    p++;
    int num = getnum(p);
    p++;
    for (int i = 0 ; i < num; i++)
    {
        solve(p,deep+1);
    }
    mx = max(deep+1,mx);
}
int main()
{
    memset(s,0,sizeof(s));
    while(scanf("%s",s)!=EOF)
    {
        len = strlen(s);
        int p = 0;
        mx = 0;
        while(p<len)
            solve(p,0);
        p = 0;
        printf("%d\n",mx);
        while(p<mx)
        {
            for (int i = 0 ; i < v[p].size(); i++)
            {
                printf("%s%c",v[p][i],i==v[p].size()-1?'\n':' ');
            }
            p++;
        }
        for (int i = 0 ; i <= mx; i++)
        {
            for (int j = 0 ; j < v[i].size(); j++)
                delete v[i][j];
            v[i].clear();
        }

    }

}


#include<bits/stdc++.h>
#define LL long long
using namespace std;
char s[1000005];
char *name;
int len;
int mx;
vector<char*> v[300005];
bool isalp(char c)
{
    return c>='a'&&c<='z'||c>='A'&&c<='Z';
}
int getnum(int &p)
{
    int num = 0;
    while(p < len && s[p]>='0'&&s[p]<='9')
        num = num*10+s[p++]-'0';
    return num;
}
char *getname(int & p)
{
    char *c = new char[1000005];
    int k = 0;
    while(p<len && isalp(s[p]))
    {
        c[k++] = s[p];
        p++;
    }
    c[k] = 0;
    return c;
}
void solve(int &p,int deep)
{
    if (p>=len)
        return;

    char * c = getname(p);
    v[deep].push_back(c);
    p++;
    int num = getnum(p);
    p++;
    for (int i = 0 ; i < num; i++)
    {
        solve(p,deep+1);
    }
    mx = max(deep+1,mx);
}
int main()
{
    memset(s,0,sizeof(s));
    while(scanf("%s",s)!=EOF)
    {
        len = strlen(s);
        int p = 0;
        mx = 0;
        while(p<len)
            solve(p,0);
        p = 0;
        printf("%d\n",mx);
        while(p<mx)
        {
            for (int i = 0 ; i < v[p].size(); i++)
            {
                printf("%s%c",v[p][i],i==v[p].size()-1?'\n':' ');
            }
            p++;
        }
        for (int i = 0 ; i <= mx; i++)
        {
            for (int j = 0 ; j < v[i].size(); j++)
                delete v[i][j];
            v[i].clear();
        }

    }

}


#include <bits/stdc++.h>
using namespace std;
#define endl           '\n'
#define LL             long long
#define ULL            unsigned long long
#define all(x)         x.begin(), x.end()
#define fill(a, b)     memset(a, b, sizeof a)

const LL Mod = 1000000007;
const int N = 1e6 + 5;

int sz, mx, id;
map <string, int> used;
vector <string> d, Lev[N];
vector <int> n;
LL nn(string &s) {
    LL res = 0;
    for (auto i : s) {
        res = res * 10 + i - '0';
    }
    return res;
}

void f(string &s) {
    string t = "";
    for (int i = 0; s[i]; i++) {
        if (s[i] == ',') {
            if (t[0] >= '0' && t[0] <= '9') {
                n.push_back(nn(t));
            } else d.push_back(t);
            t = "";
        } else t += s[i];
    }
}

void dfs(int lev) {
    if (id >= sz) return;
    mx = max(mx, lev);
    used[d[id]] = true;
    Lev[lev].push_back(d[id]);
    int k = n[id];
    while (k--) {
        ++id;
        dfs(lev + 1);
    }
}

int main() {
    string s; cin >> s;
    s += ',', f(s);
    sz = d.size();
    for (int i = 0; i < sz; i++) {
        if (!used[d[i]]) {
            dfs(1);
            id++;
        }
    }
    printf("%d\n", mx);
    for (int i = 1; i <= mx; i++) {
        if (Lev[i].size()) {
            for (auto u : Lev[i]) cout << u << ' ';
            cout << endl;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endl           '\n'
#define LL             long long
#define ULL            unsigned long long
#define all(x)         x.begin(), x.end()
#define fill(a, b)     memset(a, b, sizeof a)

const LL Mod = 1000000007;
const int N = 1e6 + 5;

int sz, mx, id;
map <string, int> used;
vector <string> d, Lev[N];
vector <int> n;
LL nn(string &s) {
    LL res = 0;
    for (auto i : s) {
        res = res * 10 + i - '0';
    }
    return res;
}

void f(string &s) {
    string t = "";
    for (int i = 0; s[i]; i++) {
        if (s[i] == ',') {
            if (t[0] >= '0' && t[0] <= '9') {
                n.push_back(nn(t));
            } else d.push_back(t);
            t = "";
        } else t += s[i];
    }
}

void dfs(int lev) {
    if (id >= sz) return;
    mx = max(mx, lev);
    used[d[id]] = true;
    Lev[lev].push_back(d[id]);
    int k = n[id];
    while (k--) {
        ++id;
        dfs(lev + 1);
    }
}

int main() {
    string s; cin >> s;
    s += ',', f(s);
    sz = d.size();
    for (int i = 0; i < sz; i++) {
        if (!used[d[i]]) {
            dfs(1);
            id++;
        }
    }
    printf("%d\n", mx);
    for (int i = 1; i < N; i++) {
        if (Lev[i].size()) {
            for (auto u : Lev[i]) cout << u << ' ';
            cout << endl;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
#define endl           '\n'
#define LL             long long
#define ULL            unsigned long long
#define all(x)         x.begin(), x.end()
#define fill(a, b)     memset(a, b, sizeof a)

const LL Mod = 1000000007;
const int N = 1e6 + 5;

int sz, mx, id, ii, used[N];
map <int, string> ID;
vector <string> Lev[N];
vector <LL> n, d;

LL nn(string &s) {
    LL res = 0;
    for (auto i : s) {
        res = res * 10 + i - '0';
    }
    return res;
}

void f(string &s) {
    string t = "";
    for (int i = 0; s[i]; i++) {
        if (s[i] == ',') {
            if (t[0] >= '0' && t[0] <= '9') {
                n.push_back(nn(t));
            } else {
                d.push_back(++ii);
                ID[ii] = t;
            }
            t = "";
        } else t += s[i];
    }
}

void dfs(int lev) {
    if (id >= sz) return;
    mx = max(mx, lev);
    used[d[id]] = true;
    Lev[lev].push_back(ID[d[id]]);
    int k = n[id];
    while (k--) {
        ++id;
        dfs(lev + 1);
    }
}

int main() {
    string s; cin >> s;
    s += ',', f(s);
    sz = d.size();
    for (int i = 0; i < sz; i++) {
        if (!used[d[i]]) {
            dfs(1);
            id++;
        }
    }
    printf("%d\n", mx);
    for (int i = 1; i <= mx; i++) {
        if (Lev[i].size()) {
            for (auto u : Lev[i]) cout << u << ' ';
            cout << endl;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef priority_queue<ll, vector<ll>, greater<ll> > que;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) c.begin(),c.end()
#define inf 0x7fffffff
const int MAX = 200005;
const ll MOD = 1e9+7;
const int maxn = 1e10;

/*******************************/

/*struct node
{
    ll x, y, z;
}a[MAX];
*/

/*ll cmp(node s1, node s2)
{
    if(s1.x != s2.x)
        return s1.x < s2.x;
    return s2.y > s1.y;
}*/

/*ll qpow(ll a, ll n, ll mod) {a %= mod;ll ans = 1LL;
	while(n) {if(n & 1) ans = (ans*a % mod);a = (a*a % mod);n >>= 1;}
	return ans;
}*/

int cnt, level;
string tmp;
vector<string> v, cur[1000005];

void res(int num)
{
    string x = v[cnt++];
    cur[num].pb(x);
    level = max(level, num);

    string y = v[cnt++];
    int n = 0;
    for(int i = 0; i < y.size(); i++)
        n = n*10 + (y[i] - '0');
    for(int i = 0; i < n; i++)
        res(num+1);
}

int main()
{
    string s;
    cin >> s;
    int sz = s.size();
    for(int i = 0; i < sz; i++)
    {
        if(s[i] != ',')
            tmp += s[i];
        if(s[i+1] == ',' || i+1 == sz)
        {
            v.pb(tmp);
            tmp = "";
        }
    }

    while(cnt < v.size())
        res(0);

    printf("%d\n", level+1);

    for(int i = 0; i < level+1; i++)
    {
        for(auto j : cur[i])
            printf("%s ", j.c_str());
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef priority_queue<ll, vector<ll>, greater<ll> > que;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) c.begin(),c.end()
#define inf 0x7fffffff
const int MAX = 200005;
const ll MOD = 1e9+7;
const int maxn = 1e10;

/*******************************/

/*struct node
{
    ll x, y, z;
}a[MAX];
*/

/*ll cmp(node s1, node s2)
{
    if(s1.x != s2.x)
        return s1.x < s2.x;
    return s2.y > s1.y;
}*/

/*ll qpow(ll a, ll n, ll mod) {a %= mod;ll ans = 1LL;
	while(n) {if(n & 1) ans = (ans*a % mod);a = (a*a % mod);n >>= 1;}
	return ans;
}*/

int cnt, level;
string tmp;
vector<string> v, cur[MAX];

void res(int num)
{
    string x = v[cnt++];
    cur[num].pb(x);
    level = max(level, num);

    string y = v[cnt++];
    int n = 0;
    for(int i = 0; i <y.size(); i++)
        n = n*10 + (y[i] - '0');
    for(int i = 0; i < n; i++)
        res(num+1);
}

int main()
{
    string s;
    cin >> s;
    int sz = s.size();
    for(int i = 0; i < sz; i++)
    {
        if(s[i] != ',')
            tmp += s[i];
        if(s[i+1] == ',' || i+1 == sz)
        {
            v.pb(tmp);
            tmp = "";
        }
    }

    while(cnt < v.size())
        res(0);

    printf("%d\n", level+1);

    for(int i = 0; i < level+1; i++)
    {
        for(auto j : cur[i])
            printf("%s ", j.c_str());
        printf("\n");
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef priority_queue<ll, vector<ll>, greater<ll> > que;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) c.begin(),c.end()
#define inf 0x7fffffff
const int MAX = 200005;
const ll MOD = 1e9+7;
const int maxn = 1e10;

/*******************************/

/*struct node
{
    ll x, y, z;
}a[MAX];
*/

/*ll cmp(node s1, node s2)
{
    if(s1.x != s2.x)
        return s1.x < s2.x;
    return s2.y > s1.y;
}*/

/*ll qpow(ll a, ll n, ll mod) {a %= mod;ll ans = 1LL;
	while(n) {if(n & 1) ans = (ans*a % mod);a = (a*a % mod);n >>= 1;}
	return ans;
}*/

int cnt, level;
string tmp;
vector<string> v, cur[MAX];

void res(int num)
{
    string x = v[cnt++];
    cur[num].pb(x);
    level = max(level, num);

    string y = v[cnt++];
    int n = 0;
    for(int i = 0; i <y.size(); i++)
        n = n*10 + (y[i] - '0');
    for(int i = 0; i < n; i++)
        res(num+1);
}

int main()
{
    string s;
    cin >> s;
    int sz = s.size();
    for(int i = 0; i < sz; i++)
    {
        if(s[i] != ',')
            tmp += s[i];
        if(s[i+1] == ',' || i+1 == sz)
        {
            v.pb(tmp);
            tmp = "";
        }
    }

    while(cnt < v.size())
        res(0);

    printf("%d\n", level+1);

    for(int i = 0; i < level+1; i++)
    {
        for(auto j : cur[i])
            printf("%s ", j.c_str());
        puts("");
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
struct comment{
	vector<char>s;
	int level,idx;
};
bool operator<(comment b,comment a){
	return ((b.level<a.level)||(b.level==a.level&&b.idx<a.idx));
}
multiset<comment>x;
char c;
int num,mx=1,idx[333334];
int read(int n,int l){
	if(n==0)return l-1;
	int mx=l;
	comment cur;
	for(int i=0;i<n;i++){
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		cur.level=l;
		cur.idx=idx[l]++;
		x.insert(cur);
		cur.s.clear();
		scanf("%d,",&num);
		mx=max(mx,read(num,l+1));
	}
	return mx;
}
int main(){
	//freopen("in.txt","r",stdin);
	comment cur;
	while(scanf("%c",&c)&&c!='\n'){
		cur.s.push_back(c);
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		scanf("%d,",&num);
		cur.level=1;
		cur.idx=idx[1]++;
		x.insert(cur);
		cur.s.clear();
		mx=max(mx,read(num,2));
	}
	printf("%d\n",mx);
	int l=(*x.begin()).level;
	for(int i=0;i<(*x.begin()).s.size();i++)
		printf("%c",(*x.begin()).s[i]);
	x.erase(x.begin());
	while(x.size()){
		if((*x.begin()).level>l)l=(*x.begin()).level,printf("\n");
		else printf(" ");
		for(int i=0;i<(*x.begin()).s.size();i++)
			printf("%c",(*x.begin()).s[i]);

		x.erase(x.begin());
	}
}


#include<bits/stdc++.h>
using namespace std;
struct comment{
	vector<char>s;
	int level,idx;
};
bool operator<(comment b,comment a){
	return ((b.level<a.level)||(b.level==a.level&&b.idx<a.idx));
}
multiset<comment>x;
char c;
int num,mx=1,idx[333334];
int read(int n,int l){
	if(n==0)return l-1;
	int mx=l;
	comment cur;
	for(int i=0;i<n;i++){
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		cur.level=l;
		cur.idx=idx[l]++;
		x.insert(cur);
		cur.s.clear();
		scanf("%d,",&num);
		mx=max(mx,read(num,l+1));
	}
	return mx;
}
int main(){
	//freopen("in.txt","r",stdin);
	comment cur;
	while(scanf("%c",&c)!= EOF){
		cur.s.push_back(c);
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		scanf("%d,",&num);
		cur.level=1;
		cur.idx=idx[1]++;
		x.insert(cur);
		cur.s.clear();
		mx=max(mx,read(num,2));
	}
	printf("%d\n",mx);
	int l=(*x.begin()).level;
	for(int i=0;i<(*x.begin()).s.size();i++)
		printf("%c",(*x.begin()).s[i]);
	x.erase(x.begin());
	while(x.size()){
		if((*x.begin()).level>l)l=(*x.begin()).level,printf("\n");
		else printf(" ");
		for(int i=0;i<(*x.begin()).s.size();i++)
			printf("%c",(*x.begin()).s[i]);

		x.erase(x.begin());
	}
}


#include<bits/stdc++.h>
using namespace std;
struct comment{
	vector<char>s;
	int level,idx;
};
bool operator<(comment b,comment a){
	return ((b.level<a.level)||(b.level==a.level&&b.idx<a.idx));
}
multiset<comment>x;
char c;
int num,mx=1,idx[333334];
int read(int n,int l){
	if(n==0)return l-1;
	int mx=l;
	comment cur;
	for(int i=0;i<n;i++){
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		cur.level=l;
		cur.idx=idx[l]++;
		x.insert(cur);
		cur.s.clear();
		scanf("%d,",&num);
		mx=max(mx,read(num,l+1));
	}
	return mx;
}
int main(){
	freopen("in.txt","r",stdin);
	comment cur;
	while(scanf("%c",&c)!= EOF){
		cur.s.push_back(c);
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		scanf("%d,",&num);
		cur.level=1;
		cur.idx=idx[1]++;
		x.insert(cur);
		cur.s.clear();
		mx=max(mx,read(num,2));
	}
	printf("%d\n",mx);
	int l=(*x.begin()).level;
	for(int i=0;i<(*x.begin()).s.size();i++)
		printf("%c",(*x.begin()).s[i]);
	x.erase(x.begin());
	while(x.size()){
		if((*x.begin()).level>l)l=(*x.begin()).level,printf("\n");
		else printf(" ");
		for(int i=0;i<(*x.begin()).s.size();i++)
			printf("%c",(*x.begin()).s[i]);

		x.erase(x.begin());
	}
}


#include<bits/stdc++.h>
using namespace std;
struct comment{
	vector<char>s;
	int level,idx;
};
bool operator<(comment b,comment a){
	return ((b.level<a.level)||(b.level==a.level&&b.idx<a.idx));
}
multiset<comment>x;
char c;
int num,mx=1,idx[333334];
int read(int n,int l){
	if(n==0)return l-1;
	int mx=l;
	comment cur;
	for(int i=0;i<n;i++){
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		cur.level=l;
		cur.idx=idx[l]++;
		x.insert(cur);
		cur.s.clear();
		scanf("%d,",&num);
		mx=max(mx,read(num,l+1));
	}
	return mx;
}
int main(){
	//freopen("in.txt","r",stdin);
	comment cur;
	while(scanf("%c",&c)==1){
		cur.s.push_back(c);
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		scanf("%d,",&num);
		cur.level=1;
		cur.idx=idx[1]++;
		x.insert(cur);
		cur.s.clear();
		mx=max(mx,read(num,2));
	}
	printf("%d\n",mx);
	int l=(*x.begin()).level;
	for(int i=0;i<(*x.begin()).s.size();i++)
		printf("%c",(*x.begin()).s[i]);
	x.erase(x.begin());
	while(x.size()){
		if((*x.begin()).level>l)l=(*x.begin()).level,printf("\n");
		else printf(" ");
		for(int i=0;i<(*x.begin()).s.size();i++)
			printf("%c",(*x.begin()).s[i]);
		x.erase(x.begin());
	}
}


#include<bits/stdc++.h>
using namespace std;
struct comment{
	vector<char>s;
	int level,idx;
};
bool operator<(comment b,comment a){
	return ((b.level<a.level)||(b.level==a.level&&b.idx<a.idx));
}
multiset<comment>x;
char c;
int num,mx=1,idx[333334];
int read(int n,int l){
	if(n==0)return l-1;
	int mx=l;
	comment cur;
	for(int i=0;i<n;i++){
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		cur.level=l;
		cur.idx=idx[l]++;
		x.insert(cur);
		cur.s.clear();
		scanf("%d,",&num);
		mx=max(mx,read(num,l+1));
	}
	return mx;
}
int main(){
	freopen("in.txt","r",stdin);
	comment cur;
	while(scanf("%c",&c)!= EOF){
		cur.s.push_back(c);
		while(scanf("%c",&c)&&c!=',')
			cur.s.push_back(c);
		scanf("%d,",&num);
		cur.level=1;
		cur.idx=idx[1]++;
		x.insert(cur);
		cur.s.clear();
		mx=max(mx,read(num,2));
	}
	printf("%d\n",mx);
	int l=(*x.begin()).level;
	while(x.size()){
		if((*x.begin()).level>l)l=(*x.begin()).level,printf("\n");
		for(int i=0;i<(*x.begin()).s.size();i++)
			printf("%c",(*x.begin()).s[i]);
		printf(" ");
		x.erase(x.begin());
	}
}


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

vector<string> v[500000];
int depth = 0;
string input;
int cn=0;

void dfs(int lvl, int n){
   //cout << lvl << " " << n << endl;
    depth = max(depth,lvl);
    for (int i=0;i<n;i++){
       vector<char> s ;
       while (input[cn] != ',')s.push_back(input[cn++]);
       string str(s.begin(),s.end());
       v[lvl].push_back(str);
       cn++;
       int children = 0;
       while (input[cn] != ','){
           children *= 10;
           children += (input[cn++]-'0');
       }
       cn++;
       dfs(lvl+1, children);
    }
}

int main(){
    cin >> input;
    input = input + ',';
    while (cn!= input.length())   dfs(0,1);
    cout << depth << endl;
    for (int i=0;i<depth;i++){
        for (int j=0;j<v[i].size();j++) cout << (v[i])[j] << " ";
        cout << endl;
    }
}


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

vector<string> v[100000];
int depth = 0;
string input;
int cn=0;

void dfs(int lvl, int n){
   //cout << lvl << " " << n << endl;
    depth = max(depth,lvl);
    for (int i=0;i<n;i++){
       string s = "";
       while (input[cn] != ',')s = s + input[cn++];
       v[lvl].push_back(s);
       cn++;
       int children = 0;
       while (input[cn] != ','){
           children *= 10;
           children += (input[cn++]-'0');
       }
       cn++;
       dfs(lvl+1, children);
    }
}

int main(){
    cin >> input;
    input = input + ',';
    while (cn!= input.length())   dfs(0,1);
    cout << depth << endl;
    for (int i=0;i<depth;i++){
        for (int j=0;j<v[i].size();j++) cout << (v[i])[j] << " ";
        cout << endl;
    }
}


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

vector<string> v[500000];
int depth = 0;
string input;
int cn=0;

void dfs(int lvl, int n){
   //cout << lvl << " " << n << endl;
    depth = max(depth,lvl);
    for (int i=0;i<n;i++){
       string s = "";
       while (input[cn] != ',')s = s + input[cn++];
       v[lvl].push_back(s);
       cn++;
       int children = 0;
       while (input[cn] != ','){
           children *= 10;
           children += (input[cn++]-'0');
       }
       cn++;
       dfs(lvl+1, children);
    }
}

int main(){
    cin >> input;
    input = input + ',';
    while (cn!= input.length())   dfs(0,1);
    cout << depth << endl;
    for (int i=0;i<depth;i++){
        for (int j=0;j<v[i].size();j++) cout << (v[i])[j] << " ";
        cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 2100000000;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define pb push_back
#define all(c) (c).begin(),(c).end()
string s,cur;
vector<string> v[10*N];
int i,j,k,mx,id;
void calc(int d){
	mx=max(mx,d);
	cur="";
	while(j<s.size() && s[j]!=',')
		cur+=s[j++];
	v[d].pb(cur);
	i=j=j+1;
	cur="";
	while(j<s.size() && s[j]!=',')
		cur+=s[j++];
	i=j=j+1;
	int k;
	stringstream ss;
	ss<<cur;
	ss>>k;
	for(int t=0; t<k; ++t)
		calc(d+1);
}
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
	#endif
	cin>>s;
	while(i<s.size())
		calc(0);
	cout<<mx+1<<endl;
	for(int i=0; i<mx+1; ++i){
		for(int j=0; j<v[i].size(); ++j)
			printf("%s ", v[i][j].c_str());
		printf("\n");
	}
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 2100000000;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define pb push_back
#define all(c) (c).begin(),(c).end()
string s,cur;
vector<string> v[10*N];
int i,j,k,mx,id;
void calc(int d){
	mx=max(mx,d);
	cur.clear();
	while(j<s.size() && s[j]!=',')
		cur.pb(s[j++]);
	v[d].pb(cur);
	i=j=j+1;
	cur.clear();
	while(j<s.size() && s[j]!=',')
		cur.pb(s[j++]);
	i=j=j+1;
	int k;
	stringstream ss;
	ss<<cur;
	ss>>k;
	for(int t=0; t<k; ++t)
		calc(d+1);
}
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
	#endif
	cin>>s;
	while(i<s.size())
		calc(0);
	printf("%d\n", mx+1);
	for(int i=0; i<mx+1; ++i){
		for(int j=0; j<v[i].size(); ++j)
			printf("%s ", v[i][j].c_str());
		printf("\n");
	}
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 2100000000;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define pb push_back
#define all(c) (c).begin(),(c).end()
string s,cur;
vector<string> v[10*N];
int i,j,k,mx,id;
void calc(int d){
	mx=max(mx,d);
	while(j<s.size() && s[j]!=',')
		++j;
	cur = s.substr(i,j-i);
	v[d].pb(cur);
	i=j=j+1;
	while(j<s.size() && s[j]!=',')
		++j;
	cur = s.substr(i,j-i);
	i=j=j+1;
	int k;
	stringstream ss;
	ss<<cur;
	ss>>k;
	for(int t=0; t<k; ++t)
		calc(d+1);
}
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
	#endif
	cin>>s;
	while(i<s.size())
		calc(0);
	cout<<mx+1<<endl;
	for(int i=0; i<mx+1; ++i){
		for(int j=0; j<v[i].size(); ++j)
			cout<<v[i][j]<<" ";
		cout<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 2100000000;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define pb push_back
#define all(c) (c).begin(),(c).end()
string s,cur;
vector<string> v[10*N];
int i,j,k,mx,id;
void calc(int d){
	mx=max(mx,d);
	cur="";
	while(j<s.size() && s[j]!=',')
		cur+=s[j++];
	v[d].pb(cur);
	i=j=j+1;
	cur="";
	while(j<s.size() && s[j]!=',')
		cur+=s[j++];
	i=j=j+1;
	int k;
	stringstream ss;
	ss<<cur;
	ss>>k;
	for(int t=0; t<k; ++t)
		calc(d+1);
}
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
	#endif
	cin>>s;
	while(i<s.size())
		calc(0);
	cout<<mx+1<<endl;
	for(int i=0; i<mx+1; ++i){
		for(int j=0; j<v[i].size(); ++j)
			cout<<v[i][j]<<" ";
		cout<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x)
#define ll long long
#define mk(x, y) make_pair(x, y)
#define lson l, m, rt<<1
#define mem(a) memset(a, 0, sizeof(a))
#define rson m+1, r, rt<<1|1
#define mem1(a) memset(a, -1, sizeof(a))
#define mem2(a) memset(a, 0x3f, sizeof(a))
#define rep(i, n, a) for(int i = a; i<n; i++)
#define fi first
#define se second
typedef complex <double> cmx;
typedef pair<int, int> pll;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int mod = 1e9+7;
const int inf = 1061109567;
const int dir[][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };
string s;
int len;
vector <string> v[100005];
int maxx = 0;
int dfs(int cnt, int pos)
{
    string str = "";
    int flag = 0;
    maxx = max(maxx, cnt);
    for(int i = pos; i < len; i++) {
        if(s[i] == ',') {
            if(flag == 0) {
                v[cnt].pb(str);

            } else {
                int num = 0;
                for(int j = 0; j < str.size(); j++) {
                    num = num*10+str[j]-'0';
                }
                while(num--) {
                    i = dfs(cnt + 1, i + 1);
                }
                if(cnt != 0) {
                    return i;
                }
            }
            flag ^= 1;
            str = "";
        } else {
            str += s[i];
        }
    }
    return len;
}
int main()
{
    cin>>s;
    len = s.size();
    int flag = 0;
    dfs(0, 0);
    cout<<maxx + 1<<endl;
    for(int i = 0; i <= maxx; i++) {
        for(int j = 0; j < v[i].size(); j++) {
            cout<<v[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x)
#define ll long long
#define mk(x, y) make_pair(x, y)
#define lson l, m, rt<<1
#define mem(a) memset(a, 0, sizeof(a))
#define rson m+1, r, rt<<1|1
#define mem1(a) memset(a, -1, sizeof(a))
#define mem2(a) memset(a, 0x3f, sizeof(a))
#define rep(i, n, a) for(int i = a; i<n; i++)
#define fi first
#define se second
typedef complex <double> cmx;
typedef pair<int, int> pll;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int mod = 1e9+7;
const int inf = 1061109567;
const int dir[][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };
string s;
int len;
vector <string> v[100005];
int maxx = 0;
int dfs(int cnt, int pos)
{
    string str = "";
    int flag = 0;
    maxx = max(maxx, cnt);
    for(int i = pos; i < len; i++) {
        if(s[i] == ',') {
            if(flag == 0) {
                v[cnt].pb(str);
            } else {
                int num = 0;
                for(int j = 0; j < str.size(); j++) {
                    num = num*10+str[j]-'0';
                }
                while(num--) {
                    i = dfs(cnt + 1, i + 1);
                }
                if(cnt != 0)
                    return i;
            }
            flag ^= 1;
            str = "";
        } else {
            str += s[i];
        }
    }
    return pos;
}
int main()
{
    string str = "";
    cin>>s;
    len = s.size();
    int flag = 0;
    dfs(0, 0);
    cout<<maxx + 1<<endl;
    for(int i = 0; i <= maxx; i++) {
        for(int j = 0; j < v[i].size(); j++) {
            cout<<v[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x)
#define ll long long
#define mk(x, y) make_pair(x, y)
#define lson l, m, rt<<1
#define mem(a) memset(a, 0, sizeof(a))
#define rson m+1, r, rt<<1|1
#define mem1(a) memset(a, -1, sizeof(a))
#define mem2(a) memset(a, 0x3f, sizeof(a))
#define rep(i, n, a) for(int i = a; i<n; i++)
#define fi first
#define se second
typedef complex <double> cmx;
typedef pair<int, int> pll;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int mod = 1e9+7;
const int inf = 1061109567;
const int dir[][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };
string s;
int len;
vector <string> v[1000005];
int maxx = 0;
int dfs(int cnt, int pos)
{
    string str = "";
    int flag = 0;
    maxx = max(maxx, cnt);
    for(int i = pos; i < len; i++) {
        if(s[i] == ',') {
            if(flag == 0) {
                v[cnt].pb(str);

            } else {
                int num = 0;
                for(int j = 0; j < str.size(); j++) {
                    num = num*10+str[j]-'0';
                }
                while(num--) {
                    i = dfs(cnt + 1, i + 1);
                }
                if(cnt != 0) {
                    return i;
                }
            }
            flag ^= 1;
            str = "";
        } else {
            str += s[i];
        }
    }
    return len;
}
int main()
{
    cin>>s;
    len = s.size();
    int flag = 0;
    dfs(0, 0);
    cout<<maxx + 1<<endl;
    for(int i = 0; i <= maxx; i++) {
        for(int j = 0; j < v[i].size(); j++) {
            cout<<v[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define present(m,v) (m.find(v)!=m.end())
#define INF 1e18
#define mod 1000000007
#define sz(a) int(a.size())
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i,a,b) for(i=a;i<b;i++)

vector<vector<string> > v;

ll num(string s)
{
    stringstream temp(s);
    ll n;
    temp>>n;
    return n;
}

void read(string st, ll &ind, ll level)
{
    if(level==v.size())
    {
        vector<string> temp;
        v.pb(temp);
    }
    string s,s1;
    ll ind1,n;
    ind1=st.find(",",ind);
    s=st.substr(ind,ind1-ind);
    v[level].pb(s);
    ind=ind1+1;
    if(st.find(",",ind)!=string::npos)
    {
        ind1=st.find(",",ind);
        s1=st.substr(ind,ind1-ind);
        ind=ind1+1;
    }
    else
    {
        s1=st.substr(ind);
        ind=st.size();
    }
    n=num(s1);
    while(n--)
    {
        read(st,ind,level+1);
    }
}

int main()
{
	string st;
	getline(cin,st);
	ll ind=0;
	while(ind!=st.size())
        read(st,ind,0);
    cout<<v.size()<<endl;
    for(ll i=0;i<v.size();i++)
    {
        for(ll j=0;j<v[i].size();j++)
            cout<<v[i][j]<<" ";
        cout<<endl;
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define present(m,v) (m.find(v)!=m.end())
#define INF 1e18
#define mod 1000000007
#define sz(a) int(a.size())
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i,a,b) for(i=a;i<b;i++)

vector<vector<string> > v;

ll num(string s)
{
    stringstream temp(s);
    ll n;
    temp>>n;
    return n;
}

void read(string &st, ll &ind, ll level)
{
    if(level==v.size())
    {
        vector<string> temp;
        v.pb(temp);
    }
    string s,s1;
    ll ind1,n;
    ind1=st.find(",",ind);
    s=st.substr(ind,ind1-ind);
    v[level].pb(s);
    ind=ind1+1;
    if(st.find(",",ind)!=string::npos)
    {
        ind1=st.find(",",ind);
        s1=st.substr(ind,ind1-ind);
        ind=ind1+1;
    }
    else
    {
        s1=st.substr(ind);
        ind=st.size();
    }
    n=num(s1);
    while(n--)
    {
        read(st,ind,level+1);
    }
}

int main()
{
	string st;
	getline(cin,st);
	ll ind=0;
	while(ind!=st.size())
        read(st,ind,0);
    cout<<v.size()<<endl;
    for(ll i=0;i<v.size();i++)
    {
        for(ll j=0;j<v[i].size();j++)
            cout<<v[i][j]<<" ";
        cout<<endl;
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define present(m,v) (m.find(v)!=m.end())
#define INF 1e18
#define mod 1000000007
#define sz(a) int(a.size())
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i,a,b) for(i=a;i<b;i++)

vector<vector<string> > v;

ll num(string &s)
{
    stringstream temp(s);
    ll n;
    temp>>n;
    return n;
}

void read(string &st, ll &ind, ll level)
{
    if(level==v.size())
    {
        vector<string> temp;
        v.pb(temp);
    }
    string s,s1;
    ll ind1,n;
    ind1=st.find(",",ind);
    s=st.substr(ind,ind1-ind);
    v[level].pb(s);
    ind=ind1+1;
    if(st.find(",",ind)!=string::npos)
    {
        ind1=st.find(",",ind);
        s1=st.substr(ind,ind1-ind);
        ind=ind1+1;
    }
    else
    {
        s1=st.substr(ind);
        ind=st.size();
    }
    n=num(s1);
    while(n--)
    {
        read(st,ind,level+1);
    }
}

int main()
{
	string st;
	getline(cin,st);
	ll ind=0;
	while(ind!=st.size())
        read(st,ind,0);
    cout<<v.size()<<endl;
    for(ll i=0;i<v.size();i++)
    {
        for(ll j=0;j<v[i].size();j++)
            cout<<v[i][j]<<" ";
        cout<<endl;
    }
	return 0;
}


#include <bits/stdc++.h>

#define INF 0x3f3f3f3f
#define NINF -0x3f3f3f3f

using namespace std;

typedef pair<string,int> psi;

char line[1000005];
vector<int> lvs[1000005];
vector<psi> wws;

int curIdx = 0;
int maxH = 0;
void solve (int idx, int h)
{
	maxH = max(maxH,h);
	lvs[h].push_back(idx);
	int ch = wws[idx].second;
	curIdx++;

	for (int i = 0; i < ch; i += 1)
	{
		solve(curIdx,h+1);
	}
}

int main (int argc, char const* argv[])
{
	scanf("%s",line);

	string curW;
	int curN;
	int cc =0;

	for (int i = 0; line[i]; i += 1)
	{
		if (line[i] == ',')
		{
			++cc;

			if (cc % 2 == 0)
			{
				wws.push_back(psi(curW,curN));

				curN = 0;
				curW.clear();
			}

			continue;
		}

		if (isdigit(line[i]))
		{
			curN = 10*curN + (line[i]-'0');
		}
		else
		{
			curW += line[i];
		}
	}

	wws.push_back(psi(curW,curN));

	while (curIdx < wws.size())
	{
		solve(curIdx,0);
	}

	printf("%d\n",maxH+1);
	for (int i = 0; i < wws.size(); i += 1)
	{
		if (lvs[i].empty())
			break;

		for (int j = 0; j < lvs[i].size(); j += 1)
		{
			int idx = lvs[i][j];

			if (j == 0)
				printf("%s",wws[idx].first.c_str());
			else
				printf(" %s",wws[idx].first.c_str());
		}

		printf("\n");
	}

	return 0;
}


#include <bits/stdc++.h>

#define INF 0x3f3f3f3f
#define NINF -0x3f3f3f3f

using namespace std;

typedef pair<string,int> psi;

char line[1000005];
vector<int> lvs[1000005];
vector<psi> wws;

int curIdx = 0;
int maxH = 0;
void solve (int idx, int h)
{
	maxH = max(maxH,h);
	lvs[h].push_back(idx);
	int ch = wws[idx].second;
	curIdx++;

	for (int i = 0; i < ch; i += 1)
	{
		solve(curIdx,h+1);
	}
}

int main (int argc, char const* argv[])
{
	scanf("%s",line);

	string curW;
	int curN = 0;
	int cc =0;

	for (int i = 0; line[i]; i += 1)
	{
		if (line[i] == ',')
		{
			++cc;

			if (cc % 2 == 0)
			{
				wws.push_back(psi(curW,curN));

				curN = 0;
				curW.clear();
			}

			continue;
		}

		if (isdigit(line[i]))
		{
			curN = 10*curN + (line[i]-'0');
		}
		else
		{
			curW += line[i];
		}
	}

	wws.push_back(psi(curW,curN));

	while (curIdx < wws.size())
	{
		solve(curIdx,0);
	}

	printf("%d\n",maxH+1);
	for (int i = 0; i < wws.size(); i += 1)
	{
		if (lvs[i].empty())
			break;

		for (int j = 0; j < lvs[i].size(); j += 1)
		{
			int idx = lvs[i][j];

			if (j == 0)
				printf("%s",wws[idx].first.c_str());
			else
				printf(" %s",wws[idx].first.c_str());
		}

		printf("\n");
	}

	return 0;
}


#include <bits/stdc++.h>

#define INF 0x3f3f3f3f
#define NINF -0x3f3f3f3f

using namespace std;

typedef pair<int,int> pii;
typedef pair<string,int> psi;

char line[1000005];
int lvs[1000005];
vector<psi> wws;

int curIdx = 0;
int maxH = 0;
void solve (int idx, int h)
{
	maxH = max(maxH,h);
	lvs[idx] = h;
	int ch = wws[idx].second;
	curIdx++;

	for (int i = 0; i < ch; i += 1)
	{
		solve(curIdx,h+1);
	}
}

int main (int argc, char const* argv[])
{
	scanf("%s",line);

	string curW;
	int curN;
	int cc =0;

	for (int i = 0; line[i]; i += 1)
	{
		if (line[i] == ',')
		{
			++cc;

			if (cc % 2 == 0)
			{
				wws.push_back(psi(curW,curN));

				curN = 0;
				curW.clear();
			}

			continue;
		}

		if (isdigit(line[i]))
		{
			curN = 10*curN + (line[i]-'0');
		}
		else
		{
			curW += line[i];
		}
	}

	wws.push_back(psi(curW,curN));

	while (curIdx < wws.size())
	{
		solve(curIdx,0);
	}

	vector<pii> vv;
	for (int i = 0; i < wws.size(); i += 1)
	{
		vv.push_back(pii(lvs[i],i));
	}

	sort(vv.begin(), vv.end());

	printf("%d\n",maxH+1);
	for (int i = 0, pos = 0; i <= maxH; i += 1)
	{
		bool first = true;
		while (pos < wws.size())
		{
			pii e = vv[pos];

			if (e.first != i)
				break;

			if (first)
				printf("%s",wws[e.second].first.c_str());
			else
				printf(" %s",wws[e.second].first.c_str());

			first = false;
			++pos;
		}

		printf("\n");
	}

	return 0;
}


#include <bits/stdc++.h>

#define INF 0x3f3f3f3f
#define NINF -0x3f3f3f3f

using namespace std;

typedef pair<int,int> pii;
typedef pair<string,int> psi;

char line[1000005];
int lvs[1000005];
vector<psi> wws;

int curIdx = 0;
int maxH = 0;
void solve (int idx, int h)
{
	maxH = max(maxH,h);
	lvs[idx] = h;
	int ch = wws[idx].second;
	curIdx++;

	for (int i = 0; i < ch; i += 1)
	{
		solve(curIdx,h+1);
	}
}

int main (int argc, char const* argv[])
{
	scanf("%s",line);

	string curW;
	int curN = 0;
	int cc =0;

	for (int i = 0; line[i]; i += 1)
	{
		if (line[i] == ',')
		{
			++cc;

			if (cc % 2 == 0)
			{
				wws.push_back(psi(curW,curN));

				curN = 0;
				curW.clear();
			}

			continue;
		}

		if (isdigit(line[i]))
		{
			curN = 10*curN + (line[i]-'0');
		}
		else
		{
			curW += line[i];
		}
	}

	wws.push_back(psi(curW,curN));

	while (curIdx < wws.size())
	{
		solve(curIdx,0);
	}

	vector<pii> vv;
	for (int i = 0; i < wws.size(); i += 1)
	{
		vv.push_back(pii(lvs[i],i));
	}

	sort(vv.begin(), vv.end());

	printf("%d\n",maxH+1);
	for (int i = 0, pos = 0; i <= maxH; i += 1)
	{
		bool first = true;
		while (pos < wws.size())
		{
			pii e = vv[pos];

			if (e.first != i)
				break;

			if (first)
				printf("%s",wws[e.second].first.c_str());
			else
				printf(" %s",wws[e.second].first.c_str());

			first = false;
			++pos;
		}

		printf("\n");
	}

	return 0;
}


#include <bits/stdc++.h>

#define INF 0x3f3f3f3f
#define NINF -0x3f3f3f3f

using namespace std;

typedef pair<string,int> psi;

char line[1000005];
vector<int> lvs[1000005];
vector<psi> wws;

int curIdx = 0;
void solve (int idx, int h)
{
	lvs[h].push_back(idx);
	int ch = wws[idx].second;
	curIdx++;

	for (int i = 0; i < ch; i += 1)
	{
		solve(curIdx,h+1);
	}
}

int main (int argc, char const* argv[])
{
	scanf("%s",line);

	string curW;
	int curN;
	int cc =0;

	for (int i = 0; line[i]; i += 1)
	{
		if (line[i] == ',')
		{
			++cc;

			if (cc % 2 == 0)
			{
				wws.push_back(psi(curW,curN));

				curN = 0;
				curW.clear();
			}

			continue;
		}

		if (isdigit(line[i]))
		{
			curN = 10*curN + (line[i]-'0');
		}
		else
		{
			curW += line[i];
		}
	}

	wws.push_back(psi(curW,curN));

	while (curIdx < wws.size())
	{
		solve(curIdx,0);
	}

	for (int i = 0; i < wws.size(); i += 1)
	{
		if (lvs[i].empty())
			break;

		for (int j = 0; j < lvs[i].size(); j += 1)
		{
			int idx = lvs[i][j];

			if (j == 0)
				printf("%s",wws[idx].first.c_str());
			else
				printf(" %s",wws[idx].first.c_str());
		}

		printf("\n");
	}

	return 0;
}


/*wehj*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <fstream>
#include <cctype>
#include <ctime>
#include <iomanip>
#include <sstream>

#define fi for (int i = 1; i <= n; ++i)
#define fj for (int j = 1; j <= m; ++j)
#define INF 0x3fffffff
#define pau system("pause")
#define printclock printf("Time used = %.2fs\n", (double) clock() / CLOCKS_PER_SEC);
#define eps 1e-5
#define cin std::cin
#define cout std::cout
#define endl std::endl
#define pair std::pair

const double pi = acos(-1.0);
const int max_n = 1e5 + 5;
typedef long long ll;
typedef pair<int, int> pii;

template<class Q> void getint(Q &res, char ch = getchar()) {
    while (!isdigit(ch) && ch != '-')    ch = getchar();
    bool flag = true;
    if ('-' == ch)  flag = false, ch = getchar();
    for (res = 0; isdigit(ch); ch = getchar())  res = res * 10 + ch - 48;
    if (!flag)  res = -res;
}
void putint(int x) {
    int i = 0, a[10];
    bool flag = true;
    if (x < 0) {
        flag = false;
        x = -x;
    } else if (x == 0) {
        a[i++] = 0;
    }
    while (x > 0) {
        a[i++] = x % 10;
        x /= 10;
    }
    if (flag == false)  putchar('-');
    for (int j = i - 1; j >= 0; --j)    putchar(a[j] + 48);
}
int mmax(int a, int b)  {return a > b ? a : b;}
int mmin(int a, int b)  {return a < b ? a : b;}
int gcd(int a, int b)   {while (b) b ^= a ^= b ^= a %= b; return a;}

/*int parent[max_n], rank[max_n];
void ini() {
    for (int i = 1; i < 10001; ++i) {
        parent[i] = i;
        rank[i] = 0;
    }
}
int find(int x) {
    return x == parent[x] ? x : parent[x] = find(parent[x]);
}
void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (rank[x] < rank[y]) {
        parent[x] = y;
    } else {
        parent[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
    }
}*/

//#define LOCAL
std::vector<std::string> vec[1000005];
std::string in, t;
std::stack<int> sta;
int main() {
#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif // LOCAL
    cin >> in;
    int l = in.length(), dep = 1, i = 0;

    while (i < l) {
        //int j = i;
        t.clear();
        while (i < l && in[i] != ',') {
            t += in[i];
            i++;
        }
        vec[sta.size() + 1].push_back(t);
        char t2[50];
        //memset(t2, 0, sizeof(t2));*/
        //char *t2 = (char *)malloc(50);
        //memset(t2, 0, sizeof(t2));
        ++i;
        int j2 = i;
        //cout << i << ' ' << in[i] << endl;
        while (i < l && in[i] != ',') {
            t2[i - j2] = in[i];
            i++;
        }
        ++i;
        t2[i - j2 - 1] = 0;
        int tnum = atoi(t2);
        //cout << t2 << endl;
        //cout << tnum << endl;
        //pau;
        //cout << t2 << ' ' << tnum << endl;
        if (tnum == 0) {
            while (sta.size()) {
                int tt = sta.top();
                tt--;
                sta.pop();
                if (tt > 0) {
                    sta.push(tt);
                    break;
                }
            }
        } else {
            sta.push(tnum);
            dep = mmax(dep, sta.size() + 1);
        }
        free(t2);
    }
    cout << dep << endl;
    for (int i = 1; i <= dep; ++i) {
        for (int j = 0; j < vec[i].size() - 1; ++j)
            cout << vec[i][j] << ' ';
        cout << vec[i][vec[i].size() - 1] << endl;
    }
    return 0;
}


/*3caj*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <fstream>
#include <cctype>
#include <ctime>
#include <iomanip>
#include <sstream>

#define fi for (int i = 1; i <= n; ++i)
#define fj for (int j = 1; j <= m; ++j)
#define INF 0x3fffffff
#define pau system("pause")
#define printclock printf("Time used = %.2fs\n", (double) clock() / CLOCKS_PER_SEC);
#define eps 1e-5
#define cin std::cin
#define cout std::cout
#define endl std::endl
#define pair std::pair

const double pi = acos(-1.0);
const int max_n = 1e5 + 5;
typedef long long ll;
typedef pair<int, int> pii;

template<class Q> void getint(Q &res, char ch = getchar()) {
    while (!isdigit(ch) && ch != '-')    ch = getchar();
    bool flag = true;
    if ('-' == ch)  flag = false, ch = getchar();
    for (res = 0; isdigit(ch); ch = getchar())  res = res * 10 + ch - 48;
    if (!flag)  res = -res;
}
void putint(int x) {
    int i = 0, a[10];
    bool flag = true;
    if (x < 0) {
        flag = false;
        x = -x;
    } else if (x == 0) {
        a[i++] = 0;
    }
    while (x > 0) {
        a[i++] = x % 10;
        x /= 10;
    }
    if (flag == false)  putchar('-');
    for (int j = i - 1; j >= 0; --j)    putchar(a[j] + 48);
}
int mmax(int a, int b)  {return a > b ? a : b;}
int mmin(int a, int b)  {return a < b ? a : b;}
int gcd(int a, int b)   {while (b) b ^= a ^= b ^= a %= b; return a;}

/*int parent[max_n], rank[max_n];
void ini() {
    for (int i = 1; i < 10001; ++i) {
        parent[i] = i;
        rank[i] = 0;
    }
}
int find(int x) {
    return x == parent[x] ? x : parent[x] = find(parent[x]);
}
void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (rank[x] < rank[y]) {
        parent[x] = y;
    } else {
        parent[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
    }
}*/

//#define LOCAL
std::vector<std::string> vec[1000005];
std::string in, t;
std::stack<int> sta;
int main() {
#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif // LOCAL
    cin >> in;
    int l = in.length(), dep = 1, i = 0;

    while (i < l) {
        //int j = i;
        t.clear();
        while (i < l && in[i] != ',') {
            t += in[i];
            i++;
        }
        vec[sta.size() + 1].push_back(t);
        char t2[50];
        //memset(t2, 0, sizeof(t2));*/
        //char *t2 = (char *)malloc(50);
        //memset(t2, 0, sizeof(t2));
        ++i;
        int j2 = i;
        //cout << i << ' ' << in[i] << endl;
        while (i < l && in[i] != ',') {
            t2[i - j2] = in[i];
            i++;
        }
        ++i;
        t2[i - j2 - 1] = 0;
        int tnum = atoi(t2);
        cout << t2 << endl;
        //cout << tnum << endl;
        //pau;
        //cout << t2 << ' ' << tnum << endl;
        if (tnum == 0) {
            while (sta.size()) {
                int tt = sta.top();
                tt--;
                sta.pop();
                if (tt > 0) {
                    sta.push(tt);
                    break;
                }
            }
        } else {
            sta.push(tnum);
            dep = mmax(dep, sta.size() + 1);
        }
        //free(t2);
    }
    cout << dep << endl;
    for (int i = 1; i <= dep; ++i) {
        for (int j = 0; j < vec[i].size() - 1; ++j)
            cout << vec[i][j] << ' ';
        cout << vec[i][vec[i].size() - 1] << endl;
    }
    return 0;
}


//Submit by waj19971112 - ID 1633
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<vector>
using namespace std;
int L, num, i, j, k, l, r, t1, t2, p, tmp, ans, a[500001], f[500001], ll[500001], rr[500001], q[500001];
char S[1000010];
vector <int> son[500001];
int main()
{
	gets(S);
	L = strlen(S);
	S[L++] = ',';
	a[0] = INT_MAX;
	for (i = 0; i < L; i++)
	{
		num++;
		ll[num] = i;
		for (; S[i] != ','; i++);
		rr[num] = i - 1;
		for (i++; S[i] != ','; i++)
			a[num] = a[num] * 10 + S[i] - 48;
		son[p].push_back(num);
		f[num] = p;
		a[p]--;
		p = num;
		tmp++;
		ans = max(ans, tmp);
		while (a[p] == 0)
		{
			p = f[p];
			tmp--;
		}
	}
	printf("%d\n", ans);
	l = r = 1;
	while (ans--)
	{
		t1 = l;
		t2 = r;
		l = r + 1;
		for (i = t1; i <= t2; i++)
			for (j = 0; j < son[q[i]].size(); j++)
			{
				for (k = ll[son[q[i]][j]]; k <= rr[son[q[i]][j]]; k++)
					putchar(S[k]);
				putchar(' ');
				q[++r] = son[q[i]][j];
			}
		puts("");
	}
	return 0;
}


//Submit by waj19971112 - ID 1626
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<vector>
using namespace std;
int L, num, i, j, l, r, t, t1, t2, p, tmp, ans, a[500001], f[500001], q[500001];
char S[1000010], s[500001][101];
vector <int> son[500001];
int main()
{
	gets(S);
	L = strlen(S);
	S[L++] = ',';
	a[0] = INT_MAX;
	for (i = 0; i < L; i++)
	{
		num++;
		t = 0;
		for (; S[i] != ','; i++)
			s[num][t++] = S[i];
		for (i++; S[i] != ','; i++)
			a[num] = a[num] * 10 + S[i] - 48;
		son[p].push_back(num);
		f[num] = p;
		a[p]--;
		p = num;
		tmp++;
		ans = max(ans, tmp);
		while (a[p] == 0)
		{
			p = f[p];
			tmp--;
		}
	}
	printf("%d\n", ans);
	l = r = 1;
	while (ans--)
	{
		t1 = l;
		t2 = r;
		l = r + 1;
		for (i = t1; i <= t2; i++)
			for (j = 0; j < son[q[i]].size(); j++)
			{
				printf("%s ", s[son[q[i]][j]]);
				q[++r] = son[q[i]][j];
			}
		puts("");
	}
	return 0;
}


//Submit by 1160300318 - ID 1528
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <cctype>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fi first
#define se second

typedef long long ll;
typedef double ld;
typedef pair <int, int> pii;

const int maxn = 2e5+50, maxm = 1e5+50;
const int inf = 0x3f3f3f3f, mod = (int)1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;

typedef int arrn[maxn];
typedef ll arrm[maxn];

template<class Q> void gint(Q &ret, int sig = 1, char ch = getchar()) {
	while (!isdigit(ch) && ch != '-') ch = getchar();
	if (ch == '-') sig = -1, ch = getchar();
	for (ret = 0; isdigit(ch); ch = getchar()) ret = ret * 10 + ch - '0';
	ret *= sig;
}
vector<string> v[101010];
vector<string>::iterator it;
string str;
char s[10101];
int d;

bool dfs(int md) {
	int t = scanf("%[A-Za-z]s",s);
	if (t != 1) return 0;
	int c;
	gint(c);
	d = max(d, md);
	str = s;
	v[md].push_back(str);
	for (int i = 1; i <= c; ++i)
		dfs(md+1);
	return 1;
}
int main() {
#ifdef LOCAL
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
#endif

	while (dfs(1));

	cout << d << endl;
	for (int i = 1; i <= d; ++i, puts(""))
			for (it = v[i].begin(); it != v[i].end(); ++it)
				cout << *it << " ";
}


//Submit by waj19971112 - ID 1627
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<vector>
using namespace std;
int L, num, i, j, l, r, t, t1, t2, p, tmp, ans, a[500001], f[500001], q[500001];
char S[1000010], s[500001][201];
vector <int> son[500001];
int main()
{
	gets(S);
	L = strlen(S);
	S[L++] = ',';
	a[0] = INT_MAX;
	for (i = 0; i < L; i++)
	{
		num++;
		t = 0;
		for (; S[i] != ','; i++)
			s[num][t++] = S[i];
		for (i++; S[i] != ','; i++)
			a[num] = a[num] * 10 + S[i] - 48;
		son[p].push_back(num);
		f[num] = p;
		a[p]--;
		p = num;
		tmp++;
		ans = max(ans, tmp);
		while (a[p] == 0)
		{
			p = f[p];
			tmp--;
		}
	}
	printf("%d\n", ans);
	l = r = 1;
	while (ans--)
	{
		t1 = l;
		t2 = r;
		l = r + 1;
		for (i = t1; i <= t2; i++)
			for (j = 0; j < son[q[i]].size(); j++)
			{
				printf("%s ", s[son[q[i]][j]]);
				q[++r] = son[q[i]][j];
			}
		puts("");
	}
	return 0;
}


//Submit by ltf - ID 1600
//litianfeng
#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#define LL long long
#define INF 2147483647
#define maxn 300
#define pb push_back
#define mp make_pair
#define N 1000010
using namespace std;
vector<string>f[N];
string s0,tmp,name[N];
int a[N];

    int sum=0,xx,ans=0,t=0,len,i,j;
void work(int depth)
{
    if (depth>ans) ans=depth;
    int tot=a[t];
    f[depth].pb(name[t]);
    t++;
    for (int i=0;i<tot;i++)
        work(depth+1);
}
int main()
{
    cin>>s0;
    s0=s0+',';
    len=s0.length();i=0;
    while (i<len)
    {
        tmp="";
        for (j=i;j<len;j++)
          if (s0[j]!=',') tmp+=s0[j]; else break;
        i=j+1;
        sum++;
        name[sum]=tmp;

        xx=0;//tmp="";
        for (j=i;j<len;j++)
          if (s0[j]!=',') xx=xx*10+(s0[j]-'0');else break;
        i=j+1;
        a[sum]=xx;
    }
    t=1;
   // for (i=1;i<=sum;i++)
   //     cout<<name[i]<<" "<<a[i]<<endl;
    while (t<=sum)
    work(1);
    printf("%d\n",ans);
    for (i=1;i<=ans;i++)
    {

        for (j=0;j<f[i].size();j++)
        cout<<f[i][j]<<" ";
        printf("\n");
    }
}


/*h661*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <fstream>
#include <cctype>
#include <ctime>
#include <iomanip>
#include <sstream>

#define fi for (int i = 1; i <= n; ++i)
#define fj for (int j = 1; j <= m; ++j)
#define INF 0x3fffffff
#define pau system("pause")
#define printclock printf("Time used = %.2fs\n", (double) clock() / CLOCKS_PER_SEC);
#define eps 1e-5
#define cin std::cin
#define cout std::cout
#define endl std::endl
#define pair std::pair

const double pi = acos(-1.0);
const int max_n = 1e5 + 5;
typedef long long ll;
typedef pair<int, int> pii;

template<class Q> void getint(Q &res, char ch = getchar()) {
    while (!isdigit(ch) && ch != '-')    ch = getchar();
    bool flag = true;
    if ('-' == ch)  flag = false, ch = getchar();
    for (res = 0; isdigit(ch); ch = getchar())  res = res * 10 + ch - 48;
    if (!flag)  res = -res;
}
void putint(int x) {
    int i = 0, a[10];
    bool flag = true;
    if (x < 0) {
        flag = false;
        x = -x;
    } else if (x == 0) {
        a[i++] = 0;
    }
    while (x > 0) {
        a[i++] = x % 10;
        x /= 10;
    }
    if (flag == false)  putchar('-');
    for (int j = i - 1; j >= 0; --j)    putchar(a[j] + 48);
}
int mmax(int a, int b)  {return a > b ? a : b;}
int mmin(int a, int b)  {return a < b ? a : b;}
int gcd(int a, int b)   {while (b) b ^= a ^= b ^= a %= b; return a;}

/*int parent[max_n], rank[max_n];
void ini() {
    for (int i = 1; i < 10001; ++i) {
        parent[i] = i;
        rank[i] = 0;
    }
}
int find(int x) {
    return x == parent[x] ? x : parent[x] = find(parent[x]);
}
void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (rank[x] < rank[y]) {
        parent[x] = y;
    } else {
        parent[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
    }
}*/

//#define LOCAL
std::vector<std::string> vec[1000005];
std::string in, t;
std::stack<int> sta;
int main() {
#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif // LOCAL
    cin >> in;
    int l = in.length(), dep = 1, i = 0;

    while (i < l) {
        //int j = i;
        t.clear();
        while (i < l && in[i] != ',') {
            t += in[i];
            i++;
        }
        vec[sta.size() + 1].push_back(t);
        /*char t2[50];
        memset(t2, 0, sizeof(t2));*/
        char *t2 = (char *)malloc(50);
        memset(t2, 0, sizeof(t2));
        ++i;
        int j2 = i;
        //cout << i << ' ' << in[i] << endl;
        while (i < l && in[i] != ',') {
            t2[i - j2] = in[i];
            i++;
        }
        ++i;
        t2[i - j2] = 0;
        int tnum = atoi(t2);
        //cout << tnum << endl;
        //pau;
        //cout << t2 << ' ' << tnum << endl;
        if (tnum == 0) {
            while (sta.size()) {
                int tt = sta.top();
                tt--;
                sta.pop();
                if (tt > 0) {
                    sta.push(tt);
                    break;
                }
            }
        } else {
            sta.push(tnum);
            dep = mmax(dep, sta.size() + 1);
        }
        free(t2);
    }
    cout << dep << endl;
    for (int i = 1; i <= dep; ++i) {
        for (int j = 0; j < vec[i].size() - 1; ++j)
            cout << vec[i][j] << ' ';
        cout << vec[i][vec[i].size() - 1] << endl;
    }
    return 0;
}


//Submit by 1160300318 - ID 1551
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <cctype>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fi first
#define se second

typedef long long ll;
typedef double ld;
typedef pair <int, int> pii;

const int maxn = 2e5+50, maxm = 1e5+50;
const int inf = 0x3f3f3f3f, mod = (int)1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;

typedef int arrn[maxn];
typedef ll arrm[maxn];

template<class Q> void gint(Q &ret, int sig = 1, char ch = getchar()) {
	while (!isdigit(ch) && ch != '-') ch = getchar();
	if (ch == '-') sig = -1, ch = getchar();
	for (ret = 0; isdigit(ch); ch = getchar()) ret = ret * 10 + ch - '0';
	ret *= sig;
}
vector<string> v[1010100];
vector<string>::iterator it;
string str;
char s[1001001];
int d = 1, c, sz, stk[1010100];

int main() {
#ifdef LOCAL
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
#endif

	while (~scanf("%[A-Za-z]s",s)) {
		gint(c);
		str = s;
		v[1].push_back(str);
		if (c) stk[++sz] = c;
		d = max(d, sz+1);
		while (sz != 0) {
			if (stk[sz] == 0) { sz--; continue; }
			stk[sz] = stk[sz] - 1;
			scanf("%[A-Za-z]s",s);
			gint(c);
			str = s;
			v[sz+1].push_back(str);
			if (c != 0) stk[++sz] = c;
			d = max(d, sz+1);
			if (stk[sz] == 0) sz--;
		}
	}

	cout << d << endl;
	for (int i = 1; i <= d; ++i, puts(""))
			for (it = v[i].begin(); it != v[i].end(); ++it)
				cout << *it << " ";
}


//Submit by hoj_admin - ID 1479
#include <iostream>
using namespace std;
int main()
{
   int a, b;
   while(cin >> a >> b)
      cout << a + b << endl;
   return 0;
}


//Submit by hxttkl - ID 1603
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
#define maxn 1000005
vector <string> mp[maxn];
string s;
int deep=1;
int max_deep=0;
int x;
void dfs(int deep){
    if(x>=s.length())
        return;
    int y;
    max_deep=max(max_deep,deep);
    string ss;
    for(y = x ; s[y]!=','&&s[y]!='\0' ; y++);
    //printf("x %d , y %d\n",x,y);
    int key=0;
    ss=s.substr(x,y-x);
    //cout<<ss<<endl;
    y++;
    int sum=0;
    for(y ; s[y]!=','&&s[y]!='\0' ; y++){
        sum=sum*10+(s[y]-'0');
    }
    y++;
    x=y;
    mp[deep].push_back(ss);
    for(int i = 0 ; i<sum ; i++){
        dfs(deep+1);
    }
    if(deep==1)
        dfs(deep);
}
int main(){
    cin>>s;
    x=0;
    dfs(1);
    printf("%d\n",max_deep);
    for(int i = 1 ; i<=max_deep ; i++){
        for(int j = 0  ; j<mp[i].size();j++){
            cout<<mp[i][j]<<" ";
        }
        cout<<endl;
    }
}


//Submit by 于金鹭 - ID 1614
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <fstream>
#include <cctype>
#include <ctime>
#include <iomanip>
#include <sstream>

#define fi for (int i = 1; i <= n; ++i)
#define fj for (int j = 1; j <= m; ++j)
#define INF 0x3fffffff
#define pau system("pause")
#define printclock printf("Time used = %.2fs\n", (double) clock() / CLOCKS_PER_SEC);
#define eps 1e-5
#define cin std::cin
#define cout std::cout
#define endl std::endl
#define pair std::pair

const double pi = acos(-1.0);
const int max_n = 1e5 + 5;
typedef long long ll;
typedef pair<int, int> pii;

template<class Q> void getint(Q &res, char ch = getchar()) {
    while (!isdigit(ch) && ch != '-')    ch = getchar();
    bool flag = true;
    if ('-' == ch)  flag = false, ch = getchar();
    for (res = 0; isdigit(ch); ch = getchar())  res = res * 10 + ch - 48;
    if (!flag)  res = -res;
}
void putint(int x) {
    int i = 0, a[10];
    bool flag = true;
    if (x < 0) {
        flag = false;
        x = -x;
    } else if (x == 0) {
        a[i++] = 0;
    }
    while (x > 0) {
        a[i++] = x % 10;
        x /= 10;
    }
    if (flag == false)  putchar('-');
    for (int j = i - 1; j >= 0; --j)    putchar(a[j] + 48);
}
int mmax(int a, int b)  {return a > b ? a : b;}
int mmin(int a, int b)  {return a < b ? a : b;}
int gcd(int a, int b)   {while (b) b ^= a ^= b ^= a %= b; return a;}

/*int parent[max_n], rank[max_n];
void ini() {
    for (int i = 1; i < 10001; ++i) {
        parent[i] = i;
        rank[i] = 0;
    }
}
int find(int x) {
    return x == parent[x] ? x : parent[x] = find(parent[x]);
}
void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (rank[x] < rank[y]) {
        parent[x] = y;
    } else {
        parent[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
    }
}*/

//#define LOCAL
std::vector<std::string> vec[1000005];
std::string in, t;
std::stack<int> sta;
int main() {
#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif // LOCAL
    /*t.resize(1000005);*/
    //t += 'a';
    //t += '\0';
    cout << t;
    cin >> in;
    int l = in.length(), dep = 1, i = 0;

    while (i < l) {
        //int j = i;
        t.clear();
        while (i < l && in[i] != ',') {
            t += in[i];
            i++;
        }
        //t[j - i] = '\0';
        //cout << t[0] << ' ' << t[1] << endl;
        //cout << t << endl;
        vec[sta.size() + 1].push_back(t);
        //cout << j << ' ' << i << endl;
        //cout << t.length() << endl;
        //pau;
        char t2[10];
        ++i;
        int j2 = i;
        //cout << i << ' ' << in[i] << endl;
        while (i < l && in[i] != ',') {
            t2[i - j2] = in[i];
            i++;
        }
        ++i;
        t2[i - j2] = 0;
        int tnum = atoi(t2);
        //cout << t2 << ' ' << tnum << endl;
        if (tnum == 0) {
            while (sta.size()) {
                int tt = sta.top();
                tt--;
                sta.pop();
                if (tt > 0) {
                    sta.push(tt);
                    break;
                }
            }
        } else {
            sta.push(tnum);
            dep = mmax(dep, sta.size() + 1);
        }
        if (sta.empty()) {
            continue;
        }
        /*else {
            int tt = sta.top();
            tt--;
            sta.push(tt);
        }*/
    }
    cout << dep << endl;
    for (int i = 1; i <= dep; ++i) {
        for (int j = 0; j < vec[i].size() - 1; ++j)
            cout << vec[i][j] << ' ';
        cout << vec[i][vec[i].size() - 1] << endl;
    }
    return 0;
}


//Submit by 于金鹭 - ID 1651
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <fstream>
#include <cctype>
#include <ctime>
#include <iomanip>
#include <sstream>

#define fi for (int i = 1; i <= n; ++i)
#define fj for (int j = 1; j <= m; ++j)
#define INF 0x3fffffff
#define pau system("pause")
#define printclock printf("Time used = %.2fs\n", (double) clock() / CLOCKS_PER_SEC);
#define eps 1e-5
#define cin std::cin
#define cout std::cout
#define endl std::endl
#define pair std::pair

const double pi = acos(-1.0);
const int max_n = 1e5 + 5;
typedef long long ll;
typedef pair<int, int> pii;

template<class Q> void getint(Q &res, char ch = getchar()) {
    while (!isdigit(ch) && ch != '-')    ch = getchar();
    bool flag = true;
    if ('-' == ch)  flag = false, ch = getchar();
    for (res = 0; isdigit(ch); ch = getchar())  res = res * 10 + ch - 48;
    if (!flag)  res = -res;
}
void putint(int x) {
    int i = 0, a[10];
    bool flag = true;
    if (x < 0) {
        flag = false;
        x = -x;
    } else if (x == 0) {
        a[i++] = 0;
    }
    while (x > 0) {
        a[i++] = x % 10;
        x /= 10;
    }
    if (flag == false)  putchar('-');
    for (int j = i - 1; j >= 0; --j)    putchar(a[j] + 48);
}
int mmax(int a, int b)  {return a > b ? a : b;}
int mmin(int a, int b)  {return a < b ? a : b;}
int gcd(int a, int b)   {while (b) b ^= a ^= b ^= a %= b; return a;}

/*int parent[max_n], rank[max_n];
void ini() {
    for (int i = 1; i < 10001; ++i) {
        parent[i] = i;
        rank[i] = 0;
    }
}
int find(int x) {
    return x == parent[x] ? x : parent[x] = find(parent[x]);
}
void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (rank[x] < rank[y]) {
        parent[x] = y;
    } else {
        parent[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
    }
}*/

//#define LOCAL
std::vector<std::string> vec[10000005];
std::string in, t;
std::stack<int> sta;
int main() {
#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif // LOCAL
    /*t.resize(1000005);*/
    //t += 'a';
    //t += '\0';
    //cout << t;
    cin >> in;
    int l = in.length(), dep = 1, i = 0;

    while (i < l) {
        //int j = i;
        t.clear();
        while (i < l && in[i] != ',') {
            t += in[i];
            i++;
        }
        //t[j - i] = '\0';
        //cout << t[0] << ' ' << t[1] << endl;
        //cout << t << endl;
        vec[sta.size() + 1].push_back(t);
        //cout << j << ' ' << i << endl;
        //cout << t.length() << endl;
        //pau;
        char t2[50];
        ++i;
        int j2 = i;
        //cout << i << ' ' << in[i] << endl;
        while (i < l && in[i] != ',') {
            t2[i - j2] = in[i];
            i++;
        }
        ++i;
        t2[i - j2] = 0;
        int tnum = atoi(t2);
        //cout << t2 << ' ' << tnum << endl;
        if (tnum == 0) {
            while (sta.size()) {
                int tt = sta.top();
                tt--;
                sta.pop();
                if (tt > 0) {
                    sta.push(tt);
                    break;
                }
            }
        } else {
            sta.push(tnum);
            dep = mmax(dep, sta.size() + 1);
        }
        /*if (sta.empty()) {
            continue;
        }*/
        /*else {
            int tt = sta.top();
            tt--;
            sta.push(tt);
        }*/
    }
    cout << dep << endl;
    for (int i = 1; i <= dep; ++i) {
        for (int j = 0; j < vec[i].size() - 1; ++j)
            cout << vec[i][j] << ' ';
        cout << vec[i][vec[i].size() - 1] << endl;
    }
    return 0;
}


//Submit by kqwyf - ID 1543
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<vector>

using namespace std;

vector<char> ans[1000002];
char s[1000005];
int curl,l;
int maxlevel;

void dfs(int level)
{
	if(level>maxlevel) maxlevel=level;
	int k;
	for(curl++;s[curl]!=',';curl++)
		ans[level].push_back(s[curl]);
	ans[level].push_back(' ');
	k=atoi(s+(++curl));
	while(s[curl]!=','&&curl<l) curl++;
	for(int i=0;i<k;i++)
		dfs(level+1);
}

void println(vector<char> s)
{
	for(int i=0;i<s.size()-1;i++)
		printf("%c",s[i]);
	printf("\n");
}

int main()
{
    int i,j;
    scanf("%s",s);
    l=strlen(s);
    maxlevel=0;
    curl=-1;
    while(curl<l) dfs(1);
    printf("%d\n",maxlevel);
    for(i=1;i<=maxlevel;i++)
    	println(ans[i]);
    return 0;
}