#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;

const int MaxN = (int)1e5 + 7;

struct SegmentType
{
	int l,r; double a,b;
};

int n,q,a[MaxN],b[MaxN];
bool flg;
SegmentType ans,seg[MaxN<<2];

void MakeSeg(int x,int l,int r)
{
	seg[x].l = l; seg[x].r = r;
	if(l==r)
	{
		seg[x].a = 1.0*a[l]/b[l];
		seg[x].b = 1.0 - 1.0*a[l]/b[l];
		return;
	}
	int lc = x<<1, mi = (l+r)>>1;
	MakeSeg(lc,l,mi);
	MakeSeg(lc+1,mi+1,r);
	double t1 = (1-seg[lc+1].a) * (1-seg[lc].b);
	double t2 = (1-seg[lc+1].b) * (1-seg[lc].a);
	seg[x].a = seg[lc].a * seg[lc+1].a / (1-t1);
	seg[x].b = seg[lc+1].b * seg[lc].b / (1-t2);
}

void Update(int x,int id,int a,int b)
{
	if(seg[x].l==seg[x].r)
	{
		seg[x].a = 1.0*a/b;
		seg[x].b = 1.0 - 1.0*a/b;
		return;
	}
	int lc = x<<1;
	if(id<=seg[x<<1].r) Update(x<<1,id,a,b);
	else Update((x<<1)+1,id,a,b);
	double t1 = (1-seg[lc+1].a) * (1-seg[lc].b);
	double t2 = (1-seg[lc+1].b) * (1-seg[lc].a);
	seg[x].a = seg[lc].a * seg[lc+1].a / (1-t1);
	seg[x].b = seg[lc+1].b * seg[lc].b / (1-t2);
}

void Calc(int x,int l,int r)
{
	if(l<=seg[x].l && seg[x].r<=r)
	{
		if(flg)
		{
			ans.a = seg[x].a;
			ans.b = seg[x].b;
			flg = false;
			return;
		}
		double t1,t2;
		t1 = (1-seg[x].a) * (1-ans.b);
		t2 = (1-seg[x].b) * (1-ans.a);
		ans.a = ans.a * seg[x].a / (1-t1);
		ans.b = ans.b * seg[x].b / (1-t2);
		return;
	}
	int lc = x<<1;
	if(l<=seg[lc].r) Calc(lc,l,r);
	if(seg[lc].r<r) Calc(lc+1,l,r);
}

int main()
{

	int i,typ,id,l,r;
	scanf("%d%d",&n,&q);
	for(i=1;i<=n;i++)
		scanf("%d%d",a+i,b+i);
	MakeSeg(1,1,n);

	for(i=1;i<=q;i++)
	{
		scanf("%d",&typ);
		if(typ==1)
		{
			scanf("%d%d%d",&id,&l,&r);
			Update(1,id,l,r);
		}
		else
		{
			scanf("%d%d",&l,&r);
			flg = true;
			Calc(1,l,r);
			printf("%lf\n",ans.a);
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=100010;
#define rd(x) scanf("%d",&x)
#define rep(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=x;i>=y;i--)
int n,q;
double p[N];
struct pos{
	int l,r;
	double m,a,b;
}t[N<<2];
/*
m[i]=(1-p[i])/p[i]=1/p[i] -1=b/a -1 = (b-a)/a
A=m[l]*m[l+1]*…*m[r]
B=m[l]+m[l]*m[l+1]+…+m[l]*m[l+1]*…*m[r]
*/
void pushup(int rt){
	t[rt].a=t[rt<<1].a*t[rt<<1|1].a;
	t[rt].b=t[rt<<1].b+t[rt<<1].a*t[rt<<1|1].b;
	return;
}
void build(int rt,int l,int r){
	t[rt].l=l;t[rt].r=r;
	if(l==r){
		t[rt].m=t[rt].a=t[rt].b=p[l];//cout<<rt<<"*"<<l<<" "<<r<<" "<<t[rt].a<<endl;
		return;
	}
	int mid=l+r>>1;
	build(rt<<1,l,mid);
	build(rt<<1|1,mid+1,r);
	pushup(rt);//cout<<rt<<"*"<<l<<" "<<r<<" "<<t[rt].a<<endl;
	return;
}
void update(int rt,int l,int r,int x){
	if(l==r){
		t[rt].m=t[rt].a=t[rt].b=p[l];return;
	}
	int mid=l+r>>1;
	if(x<=mid) update(rt<<1,l,mid,x);
	else update(rt<<1|1,mid+1,r,x);
	pushup(rt);
}
double querya(int rt,int l,int r,int L,int R){
	if(L<=l&&r<=R){
//	cout<<"a: "<<rt<<" "<<l<<" "<<r<<" "<<L<<" "<<R<<" "<<t[rt].a<<endl;
		return t[rt].a;
	}
	int mid=l+r>>1;double ret=1.0;
	if(L<=mid) ret*=querya(rt<<1,l,mid,L,R);
//	cout<<"a: "<<rt<<" "<<l<<" "<<r<<" "<<L<<" "<<R<<" "<<ret<<endl;
	if(R>mid) ret*=querya(rt<<1|1,mid+1,r,L,R);
//	cout<<"a: "<<rt<<" "<<l<<" "<<r<<" "<<L<<" "<<R<<" "<<ret<<endl;
	return ret;
}
double queryb(int rt,int l,int r,int L,int R){
	if(L<=l&&r<=R){
//	cout<<rt<<" "<<l<<" "<<r<<" "<<L<<" "<<R<<" "<<t[rt].b<<endl;
		return t[rt].b;
	}
	int mid=l+r>>1;double ret=0.0;
	if(L<=mid) ret+=queryb(rt<<1,l,mid,L,R);
//	cout<<rt<<" "<<l<<" "<<r<<" "<<L<<" "<<R<<" "<<ret<<endl;
	if(R>mid) ret+=queryb(rt<<1|1,mid+1,r,L,R)*querya(rt<<1,l,mid,L,mid);
//	cout<<rt<<" "<<l<<" "<<r<<" "<<L<<" "<<R<<" "<<ret<<endl;
	return ret;
}
int main(){
	rd(n);rd(q);
	rep(i,1,n){
		int a,b;rd(a),rd(b);
		p[i]=1.0*(b-a)/a;
	}
	build(1,1,n);
	rep(cas,1,q){
		int opt,a,b,id;rd(opt);
		if(opt==1){
			rd(id);rd(a);rd(b);p[id]=1.0*(b-a)/a;
			update(1,1,n,id);
		} else {
			rd(a);rd(b);
			printf("%.10lf\n",1.0/(queryb(1,1,n,a,b)+1.0));
		}
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <sstream>
#include <utility>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>
#include <ctime>
#include <assert.h>
#include <string.h>
#include <limits>
using namespace std;

#define INF 100000000
#define PI 3.1415926535897932384626433832795
#define PI_HALF 1.570796327
#define EPS 1e-9

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair< int, int > PII;
typedef pair< LL, LL > PLL;
typedef vector< int > VI;
typedef vector< LL > VLL;
typedef vector< string > VS;
typedef vector< PII > VPII;
typedef vector< PLL > VPLL;

#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define SZ(c) (int)(c).size()
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort( ALL( c ) )
#define SORT_(c,f) sort( ALL( c ), f )
#define FILL(x,v) memset( x, v, sizeof( x ) );

#define REP(i,n) for ( int i = 0, max_ = (n); i < max_; ++i )
#define REPD(i,n) for ( int i = (n) - 1; i >= 0; --i )
#define FOR(i,a,b) for ( int i = (a), max_ = (b); i < max_; ++i )
#define FORD(i,a,b) for ( int i = (a) - 1, min_ = (b); i >= min_; --i )

LL GCD ( LL a, LL b ) { return b != 0 ? GCD(b, a % b) : a; }
LL LCM ( LL a, LL b ) { return a*(b / GCD(a,b)); }
LL Pow ( LL n, LL e ) { if ( e == 0 ) return 1; if ( e == 1 ) return n; else if ( e & 1 ) { LL t = Pow(n,e/2); return n*t*t; } else { LL t = Pow(n,e/2); return t*t; } }

int v[ 100005 ];

int main ()
{
    map< int, int > cnt;
    set< int > single;

    int N, K;
    scanf( "%d %d", &N, &K );
    REP(i,N) scanf( "%d", &v[ i ] );

    REP(i,K)
    {
        auto it = cnt.find( v[ i ] );
        if ( it == cnt.end() )
        {
            cnt.insert( MP( v[ i ], 1 ) );
            single.insert( v[ i ] );
        }
        else
        {
            if ( it->Y == 0 )
                single.insert( v[ i ] );
            if ( it->Y == 1 )
                single.erase( single.find( v[ i ] ) );
            ++it->Y;
        }
    }

    if ( SZ(single) == 0 )
        printf( "Nothing\n" );
    else
    {
        auto it = single.end();
        --it;
        printf( "%d\n", *it );
    }

    REP(i,N-K)
    {
        int prev = i;
        int next = K + i;

        if ( v[ prev ] != v[ next ] )
        {
            // remove:
            {
                auto it = cnt.find( v[ prev ] );
                if ( it->Y == 1 )
                {
                    single.erase( single.find( v[ prev ] ) );
                }
                else if ( it->Y == 2 )
                {
                    single.insert( v[ prev ] );
                }
                --it->Y;
            }

            // add:
            {
                auto it = cnt.find( v[ next ] );
                if ( it == cnt.end() )
                {
                    cnt.insert( MP( v[ next ], 1 ) );
                    single.insert( v[ next ] );
                }
                else
                {
                    if ( it->Y == 0 )
                        single.insert( v[ i ] );
                    if ( it->Y == 1 )
                        single.erase( single.find( v[ next ] ) );
                    ++it->Y;
                }
            }
        }

        if ( SZ(single) == 0 )
            printf( "Nothing\n" );
        else
        {
            auto it = single.end();
            --it;
            printf( "%d\n", *it );
        }
    }

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <sstream>
#include <utility>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>
#include <ctime>
#include <assert.h>
#include <string.h>
#include <limits>
using namespace std;

#define INF 100000000
#define PI 3.1415926535897932384626433832795
#define PI_HALF 1.570796327
#define EPS 1e-9

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair< int, int > PII;
typedef pair< LL, LL > PLL;
typedef vector< int > VI;
typedef vector< LL > VLL;
typedef vector< string > VS;
typedef vector< PII > VPII;
typedef vector< PLL > VPLL;

#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define SZ(c) (int)(c).size()
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort( ALL( c ) )
#define SORT_(c,f) sort( ALL( c ), f )
#define FILL(x,v) memset( x, v, sizeof( x ) );

#define REP(i,n) for ( int i = 0, max_ = (n); i < max_; ++i )
#define REPD(i,n) for ( int i = (n) - 1; i >= 0; --i )
#define FOR(i,a,b) for ( int i = (a), max_ = (b); i < max_; ++i )
#define FORD(i,a,b) for ( int i = (a) - 1, min_ = (b); i >= min_; --i )

LL GCD ( LL a, LL b ) { return b != 0 ? GCD(b, a % b) : a; }
LL LCM ( LL a, LL b ) { return a*(b / GCD(a,b)); }
LL Pow ( LL n, LL e ) { if ( e == 0 ) return 1; if ( e == 1 ) return n; else if ( e & 1 ) { LL t = Pow(n,e/2); return n*t*t; } else { LL t = Pow(n,e/2); return t*t; } }

int v[ 100005 ];

int main ()
{
    map< int, int > cnt;
    set< int > single;

    int N, K;
    scanf( "%d %d", &N, &K );
    REP(i,N) scanf( "%d", &v[ i ] );

    REP(i,K)
    {
        auto it = cnt.find( v[ i ] );
        if ( it == cnt.end() )
        {
            cnt.insert( MP( v[ i ], 1 ) );
            single.insert( v[ i ] );
        }
        else
        {
            if ( it->Y == 1 )
                single.erase( single.find( v[ i ] ) );
            ++it->Y;
        }
    }

    if ( SZ(single) == 0 )
        printf( "Nothing\n" );
    else
    {
        auto it = single.end();
        --it;
        printf( "%d\n", *it );
    }

    REP(i,N-K)
    {
        int prev = i;
        int next = K + i;

        if ( v[ prev ] != v[ next ] )
        {
            // remove:
            {
                auto it = cnt.find( v[ prev ] );
                if ( it->Y == 1 )
                {
                    single.erase( single.find( v[ prev ] ) );
                }
                else if ( it->Y == 2 )
                {
                    single.insert( v[ prev ] );
                }
                --it->Y;
            }

            // add:
            {
                auto it = cnt.find( v[ next ] );
                if ( it == cnt.end() )
                {
                    cnt.insert( MP( v[ next ], 1 ) );
                    single.insert( v[ next ] );
                }
                else
                {
                    if ( it->Y == 1 )
                        single.erase( single.find( v[ next ] ) );
                    ++it->Y;
                }
            }
        }

        if ( SZ(single) == 0 )
            printf( "Nothing\n" );
        else
        {
            auto it = single.end();
            --it;
            printf( "%d\n", *it );
        }
    }

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <sstream>
#include <utility>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>
#include <ctime>
#include <assert.h>
#include <string.h>
#include <limits>
using namespace std;

#define INF 100000000
#define PI 3.1415926535897932384626433832795
#define PI_HALF 1.570796327
#define EPS 1e-9

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair< int, int > PII;
typedef pair< LL, LL > PLL;
typedef vector< int > VI;
typedef vector< LL > VLL;
typedef vector< string > VS;
typedef vector< PII > VPII;
typedef vector< PLL > VPLL;

#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define SZ(c) (int)(c).size()
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort( ALL( c ) )
#define SORT_(c,f) sort( ALL( c ), f )
#define FILL(x,v) memset( x, v, sizeof( x ) );

#define REP(i,n) for ( int i = 0, max_ = (n); i < max_; ++i )
#define REPD(i,n) for ( int i = (n) - 1; i >= 0; --i )
#define FOR(i,a,b) for ( int i = (a), max_ = (b); i < max_; ++i )
#define FORD(i,a,b) for ( int i = (a) - 1, min_ = (b); i >= min_; --i )

LL GCD ( LL a, LL b ) { return b != 0 ? GCD(b, a % b) : a; }
LL LCM ( LL a, LL b ) { return a*(b / GCD(a,b)); }
LL Pow ( LL n, LL e ) { if ( e == 0 ) return 1; if ( e == 1 ) return n; else if ( e & 1 ) { LL t = Pow(n,e/2); return n*t*t; } else { LL t = Pow(n,e/2); return t*t; } }

int v[ 100005 ];

int main ()
{
    map< int, int > cnt;
    set< int > single;

    int N, K;
    scanf( "%d %d", &N, &K );
    REP(i,N) scanf( "%d", &v[ i ] );

    REP(i,K)
    {
        auto it = cnt.find( v[ i ] );
        if ( it == cnt.end() )
        {
            cnt.insert( MP( v[ i ], 1 ) );
            single.insert( v[ i ] );
        }
        else
        {
            if ( it->Y == 0 )
                single.insert( v[ i ] );
            if ( it->Y == 1 )
                single.erase( single.find( v[ i ] ) );
            ++it->Y;
        }
    }

    if ( SZ(single) == 0 )
        printf( "Nothing\n" );
    else
    {
        auto it = single.end();
        --it;
        printf( "%d\n", *it );
    }

    REP(i,N-K)
    {
        int prev = i;
        int next = K + i;

        if ( v[ prev ] != v[ next ] )
        {
            // remove:
            {
                auto it = cnt.find( v[ prev ] );
                if ( it->Y == 1 )
                {
                    single.erase( single.find( v[ prev ] ) );
                }
                else if ( it->Y == 2 )
                {
                    single.insert( v[ prev ] );
                }
                --it->Y;
            }

            // add:
            {
                auto it = cnt.find( v[ next ] );
                if ( it == cnt.end() )
                {
                    cnt.insert( MP( v[ next ], 1 ) );
                    single.insert( v[ next ] );
                }
                else
                {
                    if ( it->Y == 0 )
                        single.insert( v[ next ] );
                    if ( it->Y == 1 )
                        single.erase( single.find( v[ next ] ) );
                    ++it->Y;
                }
            }
        }

        if ( SZ(single) == 0 )
            printf( "Nothing\n" );
        else
        {
            auto it = single.end();
            --it;
            printf( "%d\n", *it );
        }
    }

    return 0;
}


#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cmath>
#include <cctype>

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <list>
#include <iterator>
#include <functional>

using namespace std;

typedef long long int64;
typedef unsigned long long ull;

int64 labs(int64 a)
{
        return a<0 ? (-a) : a;
}
int64 max(int64 a, int64 b)
{
        return a>b?a:b;
}
int64 min(int64 a, int64 b)
{
        return a<b?a:b;
}
template<typename T> struct Point
{
        T x, y; Point(){} Point(T xx, T yy): x(xx), y(yy){}
};
template<typename T> bool operator <(const Point<T> &p1, const Point<T> &p2)
{
        return p1.x < p2.x || p1.x == p2.x && p1.y < p2.y;
}

#define mp make_pair
#define pb push_back
#define forn(i, n) for(int (i)=0; (i)<(n); (i)++)
#define forr(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define forit(i,c) for((i)=(c).begin(); (i)!=(c).end(); (i)++)
#define all(x) (x).begin(), (x).end()
#define zero(a) memset((a), 0, sizeof(a))

typedef vector<int> vint;
typedef vector<bool> vbool;
typedef vector<int64> vint64;
typedef Point<int> pint;
typedef pair<int, int> pii;

int n, k;
vint v;

set<int> ones;
map<int, int> more;

void AddOne(int val)
{
	if (ones.count(val) > 0)
	{
		ones.erase(val);
		more[val] = 2;
	}
	else if (more.count(val) > 0)
	{
		more[val]++;
	}
	else
	{
		ones.insert(val);
	}
}

void RemoveOne(int val)
{
	if (ones.count(val) > 0)
	{
		ones.erase(val);
	}
	else if (more[val] > 2)
	{
		more[val]--;
	}
	else
	{
		more.erase(val);
		ones.insert(val);
	}
}

bool GetMax(int & val)
{
	if (ones.empty())
		return false;

	val = *(--ones.end());
	return true;
}

void Out()
{
	int val;
	if (GetMax(val))
	{
		cout << val;
	}
	else
	{
		cout << "Nothing";
	}
	cout << endl;
}

int main()
{
	//freopen("readme.txt", "r", stdin);
	cin >> n >> k;

	v.resize(n);
	forn(i, n)
	{
		cin >> v[i];
	}

	forn(i, k)
	{
		AddOne(v[i]);
	}
	Out();

	for(int i = k; i<n; i++)
	{
		RemoveOne(v[i-k]);
		AddOne(v[i]);
		Out();
	}

	return 0;
}
/*
3
10 10 10
10 0 10
10 10 10

*/


//I love natalia

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <functional>

using namespace std;

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    int n, k;
    cin >> n >> k;

    vector <int> A(n);
    for (int i = 0; i < n; i++)
        cin >> A[i];

    map <int, unsigned int> M;
    set <int, greater <int>> S;
    for (int i = 0; i < k-1; i++) {
        M[A[i]]++;

        if (M[A[i]] == 1)
            S.insert(A[i]);
        else
            if (S.find(A[i]) != S.end())
                S.erase(S.find(A[i]));
    }

    for (int i = 0; i < n-k+1; i++) {
        M[A[i+k-1]]++;

        if (M[A[i+k-1]] == 1)
            S.insert(A[i+k-1]);
        else
            if (S.find(A[i+k-1]) != S.end())
                S.erase(S.find(A[i+k-1]));

        if (S.size() > 0)
            cout << *S.begin() << endl;
        else
            cout << "Nothing" << endl;

        M[A[i]]--;

        if (M[A[i]] == 1)
            S.insert(A[i]);
        else
            if (S.find(A[i]) != S.end())
                S.erase(S.find(A[i]));
    }

    return 0;
}


//I love natalia

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <functional>

using namespace std;

map <int, unsigned int> M;
set <int, greater <int>> S;

void doMagic(int x) {
    if (M[x] == 1)
        S.insert(x);
    else {
        set <int, greater <int>>::iterator it;
        if ((it = S.find(x)) != S.end())
            S.erase(it);
    }
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    int n, k;
    cin >> n >> k;

    vector <int> A(n);
    for (int i = 0; i < n; i++)
        cin >> A[i];

    for (int i = 0; i < k-1; i++) {
        M[A[i]]++;

        doMagic(A[i]);
    }

    for (int i = 0; i < n-k+1; i++) {
        M[A[i+k-1]]++;

        doMagic(A[i+k-1]);

        if (S.size() > 0)
            cout << *S.begin() << endl;
        else
            cout << "Nothing" << endl;

        M[A[i]]--;

        doMagic(A[i]);
    }

    return 0;
}


/*
 * Author: iSea
 * Created Time:  2011/3/23 10:52:33
 * File Name: E.cpp
 */
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define PB push_back
#define PII pair<int, int>
#define SZ(x) ((int)((x).size()))
#define OUT(x) printf(#x" %d\n", x)
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)

const int maxn = 100000 + 10;
const int inf = (-1u) >> 1;

set<int> s;
map<int,int> mp;

void insert(int x) {
    if (mp.find(x) != mp.end()) {
        ++mp[x];
    } else if (s.find(x) == s.end()) {
        s.insert(x);
    } else {
        s.erase(x);
        mp[x] = 2;
    }
}

void erase(int x) {
    if (s.find(x) == s.end()) {
        if (--mp[x] == 1) {
            s.insert(x);
        }
    } else {
        s.erase(x);
    }
}

void output() {
    if (s.empty()) {
        puts ("Nothing");
    } else {
        printf ("%d\n", *s.rbegin());
    }
}

int n, k, a[maxn];

int main() {
    while (scanf ("%d%d", &n, &k) != EOF) {
        s.clear(), mp.clear();
        REP(i,k) {
            scanf ("%d", &a[i]);
            insert (a[i]);
        }
        output();
        FOR(i,k,n-1) {
            scanf ("%d", &a[i]);
            erase (a[i-k]);
            insert (a[i]);
            output();
        }
    }
    return 0;
}


/*
 * Author: iSea
 * Created Time:  2011/3/23 10:52:33
 * File Name: E.cpp
 */
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define PB push_back
#define PII pair<int, int>
#define SZ(x) ((int)((x).size()))
#define OUT(x) printf(#x" %d\n", x)
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)

const int maxn = 100000 + 10;
const int inf = (-1u) >> 1;

set<int> s;
map<int,int> mp;

void insert(int x) {
    ++mp[x];
    if (mp[x] == 1) {
        s.insert (x);
    } else {
        s.erase (x);
    }
}

void erase(int x) {
    --mp[x];
    if (mp[x] == 1) {
        s.insert (x);
    } else {
        s.erase (x);
    }
}

void output() {
    if (s.empty()) {
        puts ("Nothing");
    } else {
        printf ("%d\n", *s.rbegin());
    }
}

int n, k, a[maxn];

int main() {
    while (scanf ("%d%d", &n, &k) != EOF) {
        s.clear(), mp.clear();
        REP(i,k) {
            scanf ("%d", &a[i]);
            insert (a[i]);
        }
        output();
        FOR(i,k,n-1) {
            scanf ("%d", &a[i]);
            erase (a[i-k]);
            insert (a[i]);
            output();
        }
    }
    return 0;
}


/*
 * Author: iSea
 * Created Time:  2011/3/23 10:52:33
 * File Name: E.cpp
 */
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>
#include <set>
#include <map>

using namespace std;

#define PB push_back
#define PII pair<int, int>
#define SZ(x) ((int)((x).size()))
#define OUT(x) printf(#x" %d\n", x)
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)

const int maxn = 100000 + 10;
const int inf = (-1u) >> 1;

set<int> s;
map<int,int> mp;

void insert(int x) {
    if (mp.find(x) != mp.end()) {
        ++mp[x];
    } else if (s.find(x) == s.end()) {
        s.insert(x);
    } else {
        s.erase(x);
        mp[x] = 2;
    }
}

void erase(int x) {
    if (s.find(x) == s.end()) {
        if (--mp[x] == 1) {
            s.insert(x);
            mp[x] = 0;
        }
    } else {
        s.erase(x);
    }
}

void output() {
    if (s.empty()) {
        puts ("Nothing");
    } else {
        printf ("%d\n", *s.rbegin());
    }
}

int n, k, a[maxn];

int main() {
    while (scanf ("%d%d", &n, &k) != EOF) {
        s.clear(), mp.clear();
        REP(i,k) {
            scanf ("%d", &a[i]);
            insert (a[i]);
        }
        output();
        FOR(i,k,n-1) {
            scanf ("%d", &a[i]);
            erase (a[i-k]);
            insert (a[i]);
            output();
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <set>
#include <map>

using namespace std;

#define inf 1000*1000*1000
#define eps 1e-9
#define PI 3.1415926535897932385
#define sz(n) ((int)(n).size())
#define sqr(n) ((n)*(n))
#define LEN(n) ((int)(n).length())

#define prev arr[i - k]

int n, k, arr[100100];
set<int, greater<int> > seq;
map<int, int> num;

void solve(){
	cin >> n >> k;
	for(int i = 0; i < k; i++)
	{
		scanf("%d", &arr[i]);
		if (num.find(arr[i]) == num.end())
		{
			num[arr[i]] = 1;
			seq.insert(arr[i]);
		}
		else
		{
			if (seq.find(arr[i]) != seq.end())
				seq.erase(arr[i]);
			num[arr[i]]++;
		}
	}
	if (seq.empty())
		cout << "Nothing" << endl;
	else
		cout << (*seq.begin()) << endl;
	for(int i = k; i < n; i++)
	{
		num[prev]--;
		if (num[prev] == 0)
			seq.erase(prev);
		if (num[prev] == 1)
			seq.insert(prev);
		scanf("%d", &arr[i]);
		if (num.find(arr[i]) == num.end())
		{
			num[arr[i]] = 1;
			seq.insert(arr[i]);
		}
		else
		{
			if (seq.find(arr[i]) != seq.end())
				seq.erase(arr[i]);
			num[arr[i]]++;
		}
		if (seq.empty())
			cout << "Nothing" << endl;
		else
			cout << (*seq.begin()) << endl;
	}
}

int main(){
	solve();
	return 0;
}


#include <iostream>
#include <cstdio>
#include <set>
#include <map>

using namespace std;

#define inf 1000*1000*1000
#define eps 1e-9
#define PI 3.1415926535897932385
#define sz(n) ((int)(n).size())
#define sqr(n) ((n)*(n))
#define LEN(n) ((int)(n).length())

#define prev arr[i - k]

int n, k, arr[100100];
set<int, greater<int> > seq;
map<int, int> num;

void solve(){
        cin >> n >> k;
        for(int i = 0; i < k; i++)
        {
                scanf("%d", &arr[i]);
                if (num.find(arr[i]) == num.end())
                {
                        num[arr[i]] = 1;
                        seq.insert(arr[i]);
                }
                else
                {
                        if (seq.find(arr[i]) != seq.end())
                                seq.erase(arr[i]);
                        num[arr[i]]++;
                }
        }
        if (seq.empty())
                cout << "Nothing" << endl;
        else
                cout << (*seq.begin()) << endl;
        for(int i = k; i < n; i++)
        {
                num[prev]--;
                if (num[prev] == 0)
                        seq.erase(prev);
                if (num[prev] == 1)
                        seq.insert(prev);
                scanf("%d", &arr[i]);
                if (num.find(arr[i]) == num.end() || num[arr[i]] == 0)
                {
                       num[arr[i]] = 1;
                        seq.insert(arr[i]);
                }
                else
                {
                        if (seq.find(arr[i]) != seq.end())
                              seq.erase(arr[i]);
                        num[arr[i]]++;
                }
                if (seq.empty())
                        cout << "Nothing" << endl;
                else
                        cout << (*seq.begin()) << endl;
        }
}

int main(){
        solve();
        return 0;
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>

#include <algorithm>
#include <utility>
#include <cmath>

#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define forv(i, v) forn(i, v.size())
#define fs first
#define sc second
#define pb push_back
#define mp make_pair

typedef long long int64;
typedef long double ld;
int INF = 1e9 + 1;

int n, k, temp;
set<int> st;
map<int, int> m;
queue<int> q;
set<int>::iterator it;
int main()
{
    cin >> n >> k;
    forn(i, k)
    {
        cin >> temp;
        m[temp]++;
        q.push(temp);
        if(m[temp] == 1)
            st.insert(temp);
        else
            st.erase(temp);
    }
    if(st.empty())
        cout << "Nothing";
    else
        cout << *(--st.end());
    cout << endl;
    forn(i, n - k)
    {
        cin >> temp;
        q.push(temp);
        m[temp]++;
        if(--m[q.front()] == 1)
            st.insert(q.front());
        if(m[temp] == 1)
            st.insert(temp);
        if(m[temp] == 2)
            st.erase(temp);
        if(st.empty())
            cout << "Nothing";
        else
            cout << *(--st.end());
        q.pop();
        cout << endl;
    }
    return 0;
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>

#include <algorithm>
#include <utility>
#include <cmath>

#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define forv(i, v) forn(i, v.size())
#define fs first
#define sc second
#define pb push_back
#define mp make_pair

typedef long long int64;
typedef long double ld;
int INF = 1e9 + 1;

int n, k, temp;
set<int> st;
map<int, int> m;
queue<int> q;
set<int>::iterator it;
int main()
{
    cin >> n >> k;
    forn(i, k)
    {
        cin >> temp;
        m[temp]++;
        q.push(temp);
        if(m[temp] == 1)
            st.insert(temp);
        else
            st.erase(temp);
    }
    if(st.empty())
        cout << "Nothing";
    else
        cout << *(--st.end());
    cout << endl;
    forn(i, n - k)
    {
        cin >> temp;
        q.push(temp);
        m[temp]++;
        if(--m[q.front()] == 1)
            st.insert(q.front());
        if(m[q.front()] == 0)
            st.erase(q.front());
        if(m[temp] == 1)
            st.insert(temp);
        if(m[temp] == 2)
            st.erase(temp);
        if(st.empty())
            cout << "Nothing";
        else
            cout << *(--st.end());
        q.pop();
        cout << endl;
    }
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
int a[100010];
int n,k;
map<int ,int>f;
priority_queue<int>q;
int main()
{
    while(scanf("%d%d",&n,&k)!=EOF)
    {
       for(int i=1;i<=n;i++)
       scanf("%d",&a[i]);
       for(int i=1;i<=n;i++)
       {
               f[a[i]]+=1;
               if(f[a[i]]==1)q.push(a[i]);
               if(i>=k)
               {
                       while(!q.empty()&&f[q.top()]>1)q.pop();
                       if(q.empty())printf("Nothing\n");
                       else printf("%d\n",q.top());
                       f[a[i-k+1]]-=1;
                       if(f[a[i-k+1]]==1)q.push(a[i-k+1]);
               }
       }
    }
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
int a[100010];
int n,k;
map<int ,int>f;
priority_queue<int>q;
int main()
{
    while(scanf("%d%d",&n,&k)!=EOF)
    {
       for(int i=1;i<=n;i++)
       scanf("%d",&a[i]);
       for(int i=1;i<=n;i++)
       {
               f[a[i]]+=1;
               if(f[a[i]]==1)q.push(a[i]);
               if(i>=k)
               {
                       while(!q.empty()&&(f[q.top()]>1||f[q.top()]==0))q.pop();
                       if(q.empty())printf("Nothing\n");
                       else printf("%d\n",q.top());
                       f[a[i-k+1]]-=1;
                       if(f[a[i-k+1]]==1)q.push(a[i-k+1]);
               }
       }
    }
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;

int n,m,a[100005];
map<int,int> F;
priority_queue<int> Q;

int main(){

        scanf("%d%d",&n,&m);
        for (int i=1; i<=n; i++)
        {
                scanf("%d", &a[i]);
                F[a[i]] = F[a[i]] + 1;
                if (F[a[i]] == 1) Q.push(a[i]);
                if (i>=m)
                {
                        while (!Q.empty() && F[Q.top()]>1 ) Q.pop();
                        if (Q.empty()) printf("Nothing\n");
                        else printf("%d\n",Q.top());
                        F[a[i-m+1]] = F[a[i-m+1]] - 1;
                        if (F[a[i-m+1]] == 1) Q.push(a[i-m+1]);
                }
        }

        return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include<string.h>
using namespace std;
int n,k;
int visit[100010];
int a[100010];
int minn;
bool flag;
int main()
{
    while(scanf("%d%d",&n,&k)!=EOF)
    {
       // memset(visit,0,sizeof(visit));
       for(int i=1;i<=n;i++)
       scanf("%d",&a[i]);
        for(int i=1;i<=n-k+1;i++)
        {
                flag=false;
                memset(visit,0,sizeof(visit));
                minn=-1000000010;

                map<int,int>M;
               for(int j=i;j<=i+k-1;j++)
               {
               M[a[j]]++;
               }
               map<int,int>::iterator it;
               //int maxn=minn;
         for(it=M.begin();it!=M.end();it++)
         {
            if(it->second==1&&it->first>minn)
            {
                minn=it->first;
                flag=true;

            }
        }
                if(flag==false)printf("Nothing\n");
                else printf("%d\n",minn);
        }
    }
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include<string.h>
using namespace std;
int n,k;
//int visit[100010];
int a[100010];
int minn;
bool flag;
int main()
{
    while(scanf("%d%d",&n,&k)!=EOF)
    {
       // memset(visit,0,sizeof(visit));
       for(int i=1;i<=n;i++)
       scanf("%d",&a[i]);
        for(int i=1;i<=n-k+1;i++)
        {
                flag=false;
                //memset(visit,0,sizeof(visit));
                minn=-1000000010;

                map<int,int>M;
               for(int j=i;j<=i+k-1;j++)
               {
               M[a[j]]++;
               }
               /*map<int,int>::iterator it;
               //int maxn=minn;
         for(it=M.begin();it!=M.end();it++)
         {
            if(it->second==1&&it->first>minn)
            {
                minn=it->first;
                flag=true;

            }
        }*/
        for(int j=i;j<=i+k-1;j++)
        if(M[a[j]]==1&&a[j]>minn)
        {
          minn=a[j];
          flag=true;
        }
                if(flag==false)printf("Nothing\n");
                else printf("%d\n",minn);

      }

    }
    return 0;
}


#include<cstdio>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<iostream>
#include<set>
using namespace std;
#define mp make_pair

map< int, int > M;
set< int > s;
int a[1000*100 + 5];

void push(int t)
{
	if(M[t] == 1)
		s.erase(t);
	if(M[t] == 0)
		s.insert(t);
	M[t]++;
}
void pop(int t)
{
	if(M[t] == 1)
		s.erase(t);
	if(M[t] == 2)
		s.insert(t);
	M[t]--;
}
void out()
{
	if(s.empty())
		printf("Nothing\n");
	else
		printf("%d\n", -*s.begin());
}

int main()
{
#ifdef _DEBUG
	freopen("in.txt", "rt", stdin);
#endif
	int n, i, j, k;

	cin >> n >> k;

	for(i = 0; i < n; ++i)
		scanf("%d", &a[i]);

	for(i = 0; i < k; ++i)
		push(-a[i]);

	out();

	for(i = k; i < n ; ++i)
	{
		pop(-a[i - k]);
		push(-a[i]);

		out();
	}

	return 0;
}


#include<cstdio>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<iostream>
#include<set>
using namespace std;
#define mp make_pair

map< int, int > M;
set< int > s;
int a[1000*100 + 5];

int main()
{
#ifdef _DEBUG
	freopen("in.txt", "rt", stdin);
#endif
	int n, i, j, k;
	cin >> n >> k;
	for(i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for(i = 0; i < k; ++i)
	{
		int t = -a[i];
		M[t] ++;
		if(M[t] == 1)
			s.insert(t);
		if(M[t] == 2)
			s.erase(t);
	}
	printf("%d\n", -*s.begin());
	for(i = k; i < n ; ++i)
	{
		int t = -a[i - k];
		--M[t];
		if(M[t] == 0)
			s.erase(t);
		if(M[t] == 1)
			s.insert(t);
		t = -a[i];
		M[t] ++;
		if(M[t] == 1)
			s.insert(t);
		if(M[t] == 2)
			s.erase(t);
		if(s.empty())
			printf("Nothing\n");
		else
			printf("%d\n", -*s.begin());
	}

	return 0;
}


#include<cstdio>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<iostream>
#include<set>
using namespace std;
#define mp make_pair

map< int, int > M;
set< int > s;
int a[1000*100 + 5];

int main()
{
#ifdef _DEBUG
	freopen("in.txt", "rt", stdin);
#endif
	int n, i, j, k;
	cin >> n >> k;
	for(i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for(i = 0; i < k; ++i)
	{
		int t = -a[i];
		M[t] ++;
		if(M[t] == 1)
			s.insert(t);
		if(M[t] == 2)
			s.erase(t);
	}
		if(s.empty())
			printf("Nothing\n");
else // ONOTOLE ODOBRYAE
	printf("%d\n", -*s.begin());
	for(i = k; i < n ; ++i)
	{
		int t = -a[i - k];
		--M[t];
		if(M[t] == 0)
			s.erase(t);
		if(M[t] == 1)
			s.insert(t);
		t = -a[i];
		M[t] ++;
		if(M[t] == 1)
			s.insert(t);
		if(M[t] == 2)
			s.erase(t);
		if(s.empty())
			printf("Nothing\n");
		else
			printf("%d\n", -*s.begin());
	}

	return 0;
}


#include<iostream>
#include<map>
using namespace std;
int n,k,a[100001],i;
map<int,int> cnt , find_min;
void main()
{
    cin>>n>>k;
    for(int i=0;i<n;i++)
    {
        scanf("%d",a+i);
        if(++cnt[a[i]]==1) ++find_min[a[i]]; else find_min.erase(a[i]);
        if(i<k-1) continue;
        if(--cnt[a[i-k]]==1) find_min[a[i-k]]; else find_min.erase(a[i-k]);
        !find_min.empty()?cout<<'\n'<<(--find_min.end())->first:cout<<"\nNothing";
    }
}


#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <ctime>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <queue>
//#include <complex>
#include <memory.h>
#include <iostream>
#include <stack>

using namespace std;

void ASS(bool b)
{
	if (!b)
	{
		++*(int*)0;
	}
}

#define FOR(i, x) for (int i = 0; i < (int)(x); i++)
#define CL(x) memset(x, 0, sizeof(x))

#pragma comment(linker, "/STACK:106777216")

typedef vector<int> vi;
typedef long long LL;

struct Set
{
	set<int> st;
	map<int, int> cnt;
	void add(int x)
	{
		x = -x;
		if (st.find(x) != st.end())
		{
			st.erase(x);
			cnt[x] += 2;
		}
		else
		{
			if (cnt[x] == 0)
			{
				st.insert(x);
			}
			else
			{
				cnt[x]++;
			}
		}
	}
	void del(int x)
	{
		x = -x;
		if (st.find(x) == st.end())
		{
			ASS(cnt[x] > 0);
			cnt[x]--;
			if (cnt[x] == 1)
			{
				cnt[x]--;
				st.insert(x);
			}
		}
		else
		{
			st.erase(x);
		}
	}
};

int a[1 << 20];

int main()
{
	int n, k;
	cin >> n >> k;
	FOR(i, n)
		cin >> a[i];
	Set st;
	FOR(i, k)
		st.add(a[i]);
	FOR(i, n - k + 1)
	{
		if (st.st.size() == 0)
			printf("Nothing\n");
		else
			printf("%d\n", - *st.st.begin());
		if (i < n - k)
		{
			st.add(a[i + k]);
			st.del(a[i]);
		}
	}
	return 0;
}


#pragma warning( disable : 4996)
#pragma comment(linker, "/STACK:666000000")

#define bublic public

#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <time.h>
#include <vector>
#include <stack>

#define nextLine() {for(int c=getchar(); c!='\n' && c!=EOF; c=getchar());}
#define sqr(a) ((a)*(a))
#define has(mask,i) (((mask) & (1<<(i))) == 0 ? false : true)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

#define TASK "file"

using namespace std;

#define mp(x, y) make_pair(x, y)
#define pb(_o_) push_back(_o_)

typedef long long LL;
typedef unsigned long long ULL;
typedef long double ldb;

typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
#ifndef ONLINE_JUDGE
typedef vector<int> vc;
typedef vector<vc> vvc;
#else
typedef vector<char> vc;
typedef vector<char> vvc;
#endif

typedef list<int> li;

const int inf = (1 << 30) - 1;
const ldb eps = 1e-9;
const ldb pi = fabs(atan2(0.0, -1.0));

#ifndef ONLINE_JUDGE
#define parr(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++)cout<<a[i][j]<<" ";puts("");}puts("");
#else
#define parr(a,n,m) for(int i=0;i<2;i++)i++;
#endif

void ML(const bool v)
{
    if (v)
        return;
    int *ass;
    for (;;)
    {
        ass = new int[2500000];
        for (int i = 0; i < 2500000; i++)
            ass[i] = rand();
    }
}

void TL(const bool v)
{
    if (v)
        return;
    int *ass;
        ass = new int[250];
    for (;;)
    {
        for (int i = 0; i < 250; i++)
            ass[i] = rand();
    }
}

void PE(const bool v)
{
    if (v)
        return;
    puts("ass 1 2 3 4 5 6 fuck");
    exit(0);
}

int n, k;
int a[100500];

void LoAd()
{
    scanf("%d%d", &n, &k);
    for (int i =0 ; i < n; i++)
        scanf("%d", &a[i]);
}

map<int, int> cnt;
set<int> w;

void fix(const int v)
{
    if (1 == cnt[v])
        w.insert(v);
    else
        w.erase(v);
}

void SoLvE()
{
    for (int i = 0; i < k; i++)
    {
        cnt[a[i]]++;
        fix(a[i]);
    }
    for (int i = k; i <= n; i++)
    {
        if (w.empty())
            puts("Nothing");
        else
            printf("%d\n", *w.rbegin());
        cnt[a[i]]++;
        cnt[a[i - k]]--;
        fix(a[i]);
        fix(a[i - k]);
    }
}

int main()
{
    srand( (int) time(NULL));
#ifndef ONLINE_JUDGE
    freopen(TASK".in","r",stdin);   freopen(TASK".out","w",stdout);
#endif
    LoAd();
    SoLvE();
    return 0;
}


#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <math.h>

#define FR(i, a, b)   for(int i = a; i < b; i++)
#define FOR(i, a, b)  for(int i = a; i <= b; i++)
#define LFOR(i, a, b) for(int i = a; i >= b; i--)
#define FRSZ(i, x)    for(int i = 0; i < (int)x.size(); i++)
#define RP(i, n)      for(int i = 0; i < n; i++)
#define repeat        do
#define until(x)      while(!(x))

using namespace std;

typedef long long int64;
typedef unsigned long long qword;
typedef long double ldouble;

int a[100010];

int main()
{
    int n, k;
    scanf("%d%d", &n, &k);
    map<int, int> aa;
    set<int> bb;
    for(int i = 1; i <= n; i++)
        scanf("%d", &a[i]);
    for(int i = 1; i <= n; i++)
    {
        if(aa.find(a[i]) == aa.end())
            aa[a[i]] = 1;
        else
            aa[a[i]]++;
        if(aa[a[i]] > 1)
            bb.erase(-a[i]);
        else
            bb.insert(-a[i]);
        if(i > k)
        {
            int h = i - k;
            aa[a[h]]--;
            if(aa[a[h]] == 0)
                bb.erase(-a[h]);
            else if(aa[a[h]] == 1)
                bb.insert(-a[h]);
        }
        if(i >= k)
        {
            if(bb.begin() == bb.end())
                printf("Nothing\n");
            else
                printf("%d\n", -(*bb.begin()));
        }
    }
}


#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <stdio.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define L(s) (int)((s).size())
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define ll long long
#define VI vector<int>
#define mp make_pair
#define pii pair<int,int>
#define x first
#define y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

int a[100001];

int main()
{
	//#define LocalHost

	#ifdef LocalHost
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    int n,k;

    cin >> n >> k;

    rep(i,n) cin >> a[i];
    set<int> was;
    map<int,int> cnt;

    rep(i,k-1)
    {
        if(cnt.count(a[i]))
            was.erase(-a[i]);
        else
            was.insert(-a[i]);

        cnt[a[i]]++;
    }

    for(int j = k-1; j < n; ++j)
    {
        cnt[a[j]]++;

        if(cnt[a[j]]!=1)
            was.erase(-a[j]);
        else
            was.insert(-a[j]);

        if(was.size())
        {
            cout << -1*(*was.begin()) << endl;
            was.erase(was.begin());
        }
        else
        {
            cout << "Nothing" << endl;
        }

        cnt[a[j-k+1]] --;

        if(cnt[a[j-k+1]] == 1)
            was.insert(-a[j-k+1]);
        else
            was.erase(-a[j-k+1]);
    }

	return 0;
}


#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <stdio.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define L(s) (int)((s).size())
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define ll long long
#define VI vector<int>
#define mp make_pair
#define pii pair<int,int>
#define x first
#define y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

int a[100001];

int main()
{
	//#define LocalHost

	#ifdef LocalHost
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    int n,k;

    cin >> n >> k;

    rep(i,n) cin >> a[i];
    set<int> can, was;
    map<int,int> cnt;

    rep(i,k-1)
    {
        if(cnt.count(a[i]))
            can.erase(-a[i]);
        else
            can.insert(-a[i]);

        cnt[a[i]]++;
    }

    for(int j = k-1; j < n; ++j)
    {
        cnt[a[j]]++;

        if(cnt[a[j]]!=1)
            can.erase(-a[j]);
        else
            can.insert(-a[j]);

        if(can.size())
        {
            cout << -1*(*can.begin()) << endl;
            //was.insert(*can.begin());
            //can.erase(can.begin());
        }
        else
        {
            cout << "Nothing" << endl;
        }

        cnt[a[j-k+1]] --;

        if(cnt[a[j-k+1]] == 1)
        {
            //if(!was.count(a[j-k+1]))
            can.insert(-a[j-k+1]);
        }
        else
            can.erase(-a[j-k+1]);
    }

	return 0;
}


#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <stdio.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define L(s) (int)((s).size())
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define ll long long
#define VI vector<int>
#define mp make_pair
#define pii pair<int,int>
#define x first
#define y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

int a[100001];

int main()
{
	//#define LocalHost

	#ifdef LocalHost
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    int n,k;

    cin >> n >> k;

    rep(i,n) cin >> a[i];
    set<int> can, was;
    map<int,int> cnt;

    rep(i,k-1)
    {
        if(cnt.count(a[i]))
            can.erase(-a[i]);
        else
            can.insert(-a[i]);

        cnt[a[i]]++;
    }

    for(int j = k-1; j < n; ++j)
    {
        cnt[a[j]]++;

        if(cnt[a[j]]!=1)
            can.erase(-a[j]);
        else
            can.insert(-a[j]);

        if(can.size())
        {
            cout << -1*(*can.begin()) << endl;
            was.insert(*can.begin());
            can.erase(can.begin());
        }
        else
        {
            cout << "Nothing" << endl;
        }

        cnt[a[j-k+1]] --;

        if(cnt[a[j-k+1]] == 1)
        {
            if(!was.count(a[j-k+1])) can.insert(-a[j-k+1]);
        }
        else
            can.erase(-a[j-k+1]);
    }

	return 0;
}


#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <stdio.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define L(s) (int)((s).size())
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define ll long long
#define VI vector<int>
#define mp make_pair
#define pii pair<int,int>
#define x first
#define y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

int a[100001];

int main()
{
	//#define LocalHost

	#ifdef LocalHost
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    int n,k;

    cin >> n >> k;

    rep(i,n) cin >> a[i];
    set<int> can;
    map<int,int> cnt;

    rep(i,k-1)
    {
        if(cnt.count(a[i]))
            can.erase(-a[i]);
        else
            can.insert(-a[i]);

        cnt[a[i]]++;
    }

    for(int j = k-1; j < n; ++j)
    {
        cnt[a[j]]++;

        if(cnt[a[j]]!=1)
            can.erase(-a[j]);
        else
            can.insert(-a[j]);

        if(can.size())
        {
            cout << -1*(*can.begin()) << endl;
        }
        else
        {
            cout << "Nothing" << endl;
        }

        cnt[a[j-k+1]] --;

        if(cnt[a[j-k+1]] == 1)
        {
            can.insert(-a[j-k+1]);
        }
        else
            can.erase(-a[j-k+1]);
    }

	return 0;
}


#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
#include <cmath>
#include <sstream>
#include <map>
#include <set>
#include <numeric>
#include <stdio.h>

using namespace std;

#define pb push_back
#define INF 1000000001
#define L(s) (int)((s).size())
#define FOR(i,a,b) for (int _n(b), i(a); i < _n; i++)
#define rep(i,n) FOR(i,0,n)
#define ford(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define CL(a,v) memset((a),(v),sizeof(a))
#define ll long long
#define VI vector<int>
#define mp make_pair
#define pii pair<int,int>
#define x first
#define y second
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))

int a[100001];

int main()
{
	//#define LocalHost

	#ifdef LocalHost
        freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
	#endif

    int n,k;

    cin >> n >> k;

    rep(i,n) cin >> a[i];
    set<int> was;
    map<int,int> cnt;

    rep(i,k-1)
    {
        if(cnt.count(a[i]))
            was.erase(a[i]);
        else
            was.insert(a[i]);

        cnt[a[i]]++;
    }

    for(int j = k-1; j < n; ++j)
    {
        cnt[a[j]]++;

        if(cnt[a[j]]!=1)
            was.erase(a[j]);
        else
            was.insert(a[j]);

        if(was.size())
        {
            cout << (*was.begin()) << endl;
            was.erase(was.begin());
        }
        else
        {
            cout << "Nothing" << endl;
        }

        cnt[a[j-k+1]] --;

        if(cnt[a[j-k+1]] == 1)
            was.insert(a[j-k+1]);
        else
            was.erase(a[j-k+1]);
    }

	return 0;
}


#pragma warning (disable : 4996)
#include <stdio.h>
#include <vector>
#include <map>
#include <set>
using namespace std;
const int Size = 100005;
int n, k, ar[Size];
int main()
{
	scanf("%d%d", &n, &k);

	for (int i = 0; i < n; i++)
		scanf("%d", &ar[i]);

	for (int h = 0; h < n-k+1; h++)
	{

		vector<int> g;
		g.resize(Size, 0);

		set<int> B;

		for (int i = h; i <= h + k - 1; i++)
		{
			g[ar[i]]++;
			if (g[ar[i]] == 1)
			{
				B.insert(ar[i]);
				continue;
			}

			if (g[ar[i]] > 1 && B.find(ar[i]) != B.end())
			{
				B.erase(ar[i]);
			}
		}

		if (B.empty())
			printf("Nothing\n");
		else
		{
			int t = *--B.end();

			printf("%d\n", t);
		}

	}
	return 0;
}


#pragma warning (disable : 4996)
#include <stdio.h>
#include <vector>
#include <map>
#include <set>
using namespace std;
const int Size = 100005;
int n, k, ar[Size];
int main()
{
	scanf("%d%d", &n, &k);

	for (int i = 0; i < n; i++)
		scanf("%d", &ar[i]);

	for (int h = 0; h < n-k+1; h++)
	{

		map<int, int> g;

		set<int> B;

		for (int i = h; i <= h + k - 1; i++)
		{
			g[ar[i]]++;
			if (g[ar[i]] == 1)
			{
				B.insert(ar[i]);
				continue;
			}

			if (g[ar[i]] > 1 && B.find(ar[i]) != B.end())
			{
				B.erase(ar[i]);
			}
		}

		if (B.empty())
			printf("Nothing\n");
		else
		{
			int t = *--B.end();

			printf("%d\n", t);
		}

	}
	return 0;
}


#pragma comment (linker, "/STACK:16777216")
#pragma warning (disable : 4996)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <string.h>
#include <memory.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long LL;
const int Size = 100005;
int n, k, ar[Size];
int main()
{
	scanf("%d%d", &n, &k);

	for (int i = 1; i <= n; i++)
		scanf("%d", &ar[i]);

	map<LL, LL> A1;
	set<LL> B1;

	LL pos1 = 1, pos2 = k;

	for (LL i = 1; i <= n; i++)
	{

		if (i >= pos1 && i <= pos2)
		{
			A1[ar[i]]++;
			if (A1[ar[i]] == 1)
				B1.insert(ar[i]);
			else
			{
				if (A1[ar[i]] > 1 && B1.find(ar[i]) != B1.end())
					B1.erase(ar[i]);
			}
		}

		if (i == pos2)
		{
			if (B1.empty())
				printf("Nothing\n");
			else
			{
				LL t = *--B1.end();
				printf("%I64d\n", t);
			}

			if (!B1.empty() && A1[ar[pos1]] == 1 && B1.find(ar[pos1]) != B1.end())
			{
				B1.erase(ar[pos1]);
			}

			if (A1[ar[pos1]] > 0)
				A1[ar[pos1]]--;

			if (A1[ar[pos1]] == 1)
				B1.insert(ar[pos1]);

			pos1++;
			pos2++;
		}
	}
	return 0;
}


#pragma comment (linker, "/STACK:16777216")
#pragma warning (disable : 4996)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <string.h>
#include <memory.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long LL;
const int Size = 100005;
int n, k, ar[Size];
int main()
{
	scanf("%d%d", &n, &k);

	for (int i = 0; i < n; i++)
		scanf("%d", &ar[i]);

	map<int, int> g;

	set<int> B;
	for (int h = 0; h < n-k+1; h++)
	{
		g.clear();
		B.clear();

		for (int i = h; i <= h + k - 1; i++)
		{
			g[ar[i]]++;
			if (g[ar[i]] == 1)
			{
				B.insert(ar[i]);
				continue;
			}

			if (g[ar[i]] > 1 && B.find(ar[i]) != B.end())
			{
				B.erase(ar[i]);
			}
		}

		if (B.empty())
			printf("Nothing\n");
		else
		{
			int t = *--B.end();

			printf("%d\n", t);
		}

	}
	return 0;
}


#include <algorithm>
#include <cstdio>
#include <map>
using namespace std;
const int inf =100009;
const int MN =-(1e9+1);
#define le x+x
#define ri x+x+1
#define mid (l+r)/2
int sgt[inf*4];
int nxt[inf];
int num[inf];
int idx[inf];
map<int,int>m;
map<int,int>occ;
void build(int x,int l,int r)
{
    sgt[x]=MN;
    if (l==r)
    {
        idx[l]=x;
        return;
    }
    build(le,l,mid);
    build(ri,mid+1,r);
}
void update(int x,int v)
{
    x=idx[x];
    sgt[x]=v;
    x=x>>1;
    while(x){
    sgt[x]=max(sgt[le],sgt[ri]);
    x=x>>1;
    }
}
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for (int i=0;i<n;++i)
    scanf("%d",&num[i]),nxt[i]=-1;
    build(1,0,n-1);
    for (int i=0;i<k;++i)
    {
        occ[num[i]]++;
        if (m.find(num[i])!=m.end())
        {
            int s=m[num[i]];
            nxt[s]=i;
            update(s,MN);
        }
        else
            update(i,num[i]);
        m[num[i]]=i;
    }
    for (int i=0;i<n-k+1;++i)
    {
        if (sgt[1]==MN)
        printf("Nothing\n");
        else
        printf("%d\n",sgt[1]);
        --occ[num[i]];
        update(i,MN);
        if (occ[num[i]]==1)
        {
            update(nxt[i],num[i]);
        }
        if (occ[num[i+k]]>0)
        {
            int s=m[num[i+k]];
            nxt[s]=i+k;
            update(s,MN);
        }
        else
            update(i+k,num[i+k]);
        m[num[i+k]]=i+k;
        occ[num[i+k]]++;
    }
}


#include <algorithm>
#include <cstdio>
#include <map>
using namespace std;
const int inf =100009;
const int MN =-(1e9+1);
#define le x+x
#define ri x+x+1
#define mid (l+r)/2
int sgt[inf*4];
int next[inf];
int num[inf];
int idx[inf];
map<int,int>m;
map<int,int>occ;
void build(int x,int l,int r)
{
    sgt[x]=MN;
    if (l==r)
    {
        idx[l]=x;
        return;
    }
    build(le,l,mid);
    build(ri,mid+1,r);
}
void update(int x,int v)
{
    x=idx[x];
    sgt[x]=v;
    x=x>>1;
    while(x){
    sgt[x]=max(sgt[le],sgt[ri]);
    x=x>>1;
    }
}
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for (int i=0;i<n;++i)
    scanf("%d",&num[i]),next[i]=-1;
    build(1,0,n-1);
    for (int i=0;i<k;++i)
    {
        occ[num[i]]++;
        if (m.find(num[i])!=m.end())
        {
            int s=m[num[i]];
            next[s]=i;
            update(s,MN);
        }
        else
            update(i,num[i]);
        m[num[i]]=i;
    }
    for (int i=0;i<n-k+1;++i)
    {
        if (sgt[1]==MN)
        printf("Nothing\n");
        else
        printf("%d\n",sgt[1]);
        --occ[num[i]];
        update(i,MN);
        if (occ[num[i]]==1)
        {
            update(next[i],num[i]);
        }
        if (occ[num[i+k]]>0)
        {
            int s=m[num[i+k]];
            next[s]=i+k;
            update(s,MN);
        }
        else
            update(i+k,num[i+k]);
        m[num[i+k]]=i+k;
        occ[num[i+k]]++;
    }
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

set<int> urep;
map<int,int> rep;
int a[100010];
int main()
{
	int n,k,t;
	cin>>n>>k;
	for(int i=1;i<=n;i++) scanf("%d",a+i);
	for(int i=1;i<=n;i++)
	{
		t=a[i];
		if(urep.find(t)==urep.end())
		{
			if(!rep[t]) urep.insert(t);
			else rep[t]++;
		}
		else
		{
			urep.erase(t);
			rep[t]=1;
		}
		if(i>=k)
		{
			if(urep.empty()) puts("Nothing");
			else printf("%d\n",*urep.rbegin());
			t=a[i-k+1];
			if(urep.find(t)!=urep.end()) urep.erase(t);
			else
			{
				rep[t]--;
				if(!rep[t]) urep.insert(t);
			}
		}
	}
	return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>

using namespace std;

#define forn(i,n) for(int i = 0; i < (n); ++i)
#define forr(i,n) for(int i = (n)-1; i >= 0; i--)
#define forn1(i,n) for(int i = 1; i <= (n); ++i)
#define forr1(i,n) for(int i = (n); i >= 1; i--)
#define forit(it,x) for(it = (x).begin(); it != (x).end(); ++it)

typedef long long int64;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<int64> vi64;
typedef vector<bool> vb;
typedef vector< vi > vvi;
typedef vector< vc > vvc;
typedef vector< vb > vvb;
typedef pair<int,int> pii;
typedef vector < pii > vpii;
typedef map<int,string> mis;
typedef map<string,int> msi;
typedef map<int,int> mii;
typedef vector<string> vs;
typedef pair< pii,int> ppi;

#define pb push_back
#define mp make_pair
#define sz size()
#define fr first
#define sc second
#define all(x) x.begin(),x.end()
inline int f(char c){return c - '0';}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("ReadMe.txt","r",stdin);
#endif
	int n,k;
	cin >> n >> k;
	vi a(n);
	forn(i,n)
		cin >> a[i];

	map<int,int> cnt;
	forn(i,k)
	{
		cnt[a[i]]++;
	}

	mii::iterator it;
	int ma = -1;
	set<int,greater<int> > good;
	forit(it,cnt)
	{
		if(it->sc == 1)
		{
			good.insert(it->fr);
		}
	}

	if(good.sz == 0)
		cout << "Nothing" << endl;
	else
		cout << *good.begin() << endl;

	for(int i = k; i < n; ++i)
	{
		cnt[a[i]]++;
		cnt[a[i-k]]--;

		if(cnt[a[i]] != 1)
		{
			good.erase(a[i]);
		}
		else
		{
			good.insert(a[i]);
		}

		if(cnt[a[i-k]] != 1)
		{
			good.erase(a[i-k]);
		}
		else
		{
			good.insert(a[i-k]);
		}

		if(good.sz == 0)
			cout << "Nothing" << endl;
		else
			cout << *good.begin() << endl;

	}

	return 0;
}


#include <iostream>
#include <map>
#include <set>
using namespace std;

int n, k, a[100001];
map<int, int> cnt;
set<int> uniq;

int ans()
{
    set<int>::iterator it = uniq.end();
    return *--it;
}

int main()
{
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; ++i)
        scanf("%d", a + i);
    for (int i = 0; i < n; ++i)
    {
        if (i < k)
        {
            ++cnt[a[i]];
            if (i == k - 1)
                for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it)
                    if (it->second == 1)
                        uniq.insert(it->first);
        }
        else
        {
            ++cnt[a[i]];
            int q = --cnt[a[i-k]];
            if (cnt[a[i]] == 1)
                uniq.insert(a[i]);
            else if (cnt[a[i]] == 2)
                uniq.erase(a[i]);
            if (cnt[a[i-k]] == 1)
                uniq.insert(a[i-k]);
            else if (cnt[a[i-k]] == 0)
                uniq.erase(a[i-k]);
        }
        if (i >= k - 1)
            if (uniq.size())
                printf("%d\n", ans());
            else puts("Nothing");
    }
    return 0;
}


#include <iostream>
#include <map>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
int main () {
	int n, k, x;
	map <int , int> mp;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		x = a[i];
		if (i < k) {
			mp[x] ++;
		}
		if (i == k - 1) {
			int maxn = -1000000000;
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					maxn = max(maxn, i->first);
				}
			}
			if (maxn != -1000000000) {
				l[z] = maxn;
				z++;
			}else {
				l[z] = -1;
				z++;
			}
		}
		if (i >= k) {
			mp[a[i - k]]--;
			mp[x]++;
			int maxn = -1000000000;
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					maxn = max(maxn, i->first);
				}
			}
			if (maxn != -1000000000) {
				l[z] = maxn;
				z++;
			}else {
				l[z] = -1;
				z++;
			}
		}
	}

	for (int i = 0; i < z; i++) {
		if (l[i] != -1) {
			cout << l[i] << endl;
		}else {
			cout << "Nothing" <<endl;
		}
	}
	return 0;
}


#include <iostream>
#include <map>
#include <set>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
set <int> st;
int main () {
	//freopen ("input.txt", "r", stdin);
	int n, k, x;
	map <int , int> mp;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i] = -a[i];
	}

	for (int i = 0; i < n; i++) {
		x = a[i];
		if (i < k) {
			mp[x] ++;
		}
		if (i == k - 1) {
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					st.insert(i ->first);
				}
			}
			if (st.size() == 0) {
				cout << "Nothing" <<endl;
			}else {
				cout << -(*(st.begin())) << endl;
			}
		}
		if (i >= k) {
			mp[a[i - k]]--;
			mp[x]++;
			if (mp[x] == 1) {
				st.insert(x);
			}else {
				st.erase(x);
			}
			if (mp[a[i - k]] != 1) {
				st.erase(a[i - k]);
			}else {
				if (st.find(a[i - k]) == st.end()) {
					st.insert(a[i - k]);
				}
			}
			if (st.size() == 0) {
				cout << "Nothing" <<endl;
			}else {
				cout << -(*(st.begin())) << endl;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <map>
#include <set>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
set <int> st;
int main () {
	int n, k, x;
	map <int , int> mp;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		x = a[i];
		if (i < k) {
			mp[x] ++;
		}
		if (i == k - 1) {
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					st.insert(i ->first);
				}
			}
			if (st.size() == 0) {
				cout << "Nothing" <<endl;
			}else {
				cout << (*st.begin()) << endl;
			}
		}
		if (i >= k) {
			mp[a[i - k]]--;
			mp[x]++;
			if (mp[x] == 1) {
				st.insert(a[x]);
			}else {
				st.erase(a[x]);
			}
			if (mp[a[i - k]] != 1) {
				st.erase(a[i - k]);
			}else {
				if (st.find(a[i - k]) == st.end()) {
					st.insert(a[i - k]);
				}
			}
			if (st.size() == 0) {
				cout << "Nothing" <<endl;
			}else {
				cout << (*st.begin()) << endl;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <map>
#include <set>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
set <int> st;
int main () {
    //freopen ("input.txt", "r", stdin);
    int n, k, x;
    map <int , int> mp;

    cin >> n >> k;

    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    for (int i = 0; i < n; i++) {
        x = a[i];
        if (i < k) {
            mp[x] ++;
        }
        if (i == k - 1) {
            for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
                if (i ->second == 1) {
                    st.insert(i ->first);
                }
            }
            if (st.size() == 0) {
                cout << "Nothing" <<endl;
            }else {
                cout << (*st.begin()) << endl;
            }
        }
        if (i >= k) {
            mp[a[i - k]]--;
            mp[x]++;
            if (mp[x] == 1) {
                st.insert(x);
            }else {
                st.erase(x);
            }
            if (mp[a[i - k]] != 1) {
                st.erase(a[i - k]);
            }else {
                if (st.find(a[i - k]) == st.end()) {
                    st.insert(a[i - k]);
                }
            }
            if (st.size() == 0) {
                cout << "Nothing" <<endl;
            }else {
                cout << (*st.begin()) << endl;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <map>
#include <set>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
set <int> st;
int main () {
	freopen ("input.txt", "r", stdin);
	int n, k, x;
	map <int , int> mp;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		x = a[i];
		if (i < k) {
			mp[x] ++;
		}
		if (i == k - 1) {
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					st.insert(i ->first);
				}
			}
			if (st.size() == 0) {
				cout << "Nothing" <<endl;
			}else {
				cout << (*st.begin()) << endl;
			}
		}
		if (i >= k) {
			mp[a[i - k]]--;
			mp[x]++;
			if (mp[x] == 1) {
				st.insert(x);
			}else {
				st.erase(x);
			}
			if (mp[a[i - k]] != 1) {
				st.erase(a[i - k]);
			}else {
				if (st.find(a[i - k]) == st.end()) {
					st.insert(a[i - k]);
				}
			}
			if (st.size() == 0) {
				cout << "Nothing" <<endl;
			}else {
				cout << (*st.begin()) << endl;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <map>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
int main () {
	int n, k, x;
	map <int , int> mp;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		x = a[i];
		if (i < k) {
			mp[x] ++;
		}
		if (i == k - 1) {
			int maxn = -1000000000;
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					maxn = max(maxn, i->first);
				}
			}
			if (maxn != -1000000000) {
				l[z] = maxn;
				z++;
			}else {
				l[z] = -1;
				z++;
			}
		}
		if (i >= k) {
			mp[a[i - k]]--;
			mp[x]++;
			int maxn = -10000000000;
			for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					maxn = max(maxn, i->first);
				}
			}
			if (maxn != -10000000000) {
				l[z] = maxn;
				z++;
			}else {
				l[z] = -1;
				z++;
			}
		}
	}

	for (int i = 0; i < z; i++) {
		if (l[i] != -1) {
			cout << l[i] << endl;
		}else {
			cout << "Nothing" <<endl;
		}
	}
	return 0;
}


#include <iostream>
#include <map>
#include <set>

using namespace std;

int l[1000000], z = 0;
int a[1000000];
set <int> st;
int main () {
    int n, k, x;
    map <int , int> mp;

    cin >> n >> k;

    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    for (int i = 0; i < n; i++) {
        x = a[i];
        if (i < k) {
            mp[x] ++;
        }
        if (i == k - 1) {
            for (map <int, int>::iterator i = mp.begin(); i != mp.end(); i++) {
                if (i ->second == 1) {
                    st.insert(i ->first);
                }
            }
            if (st.size() == 0) {
                cout << "Nothing" <<endl;
            }else {
                cout << (*st.begin()) << endl;
            }
        }
        if (i >= k) {
            mp[a[i - k]]--;
            mp[x]++;
            if (mp[x] == 1) {
                st.insert(a[x]);
            }else {
                st.erase(a[x]);
            }
            if (mp[a[i - k]] != 1) {
                st.erase(a[i - k]);
            }else {
                st.insert(a[i - k]);
            }
            if (st.size() == 0) {
                cout << "Nothing" <<endl;
            }else {
                cout << (*st.begin()) << endl;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <map>

using namespace std;

int l[1000000], z = 0;
long long a[1000000];
int main () {
	long long n, k, x;
	map <long long , long long> mp;

	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		x = a[i];
		if (i < k) {
			mp[x] ++;
		}
		if (i == k - 1) {
			long long maxn = -10000000000;
			for (map <long long, long long>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					maxn = max(maxn, i->first);
				}
			}
			if (maxn != -10000000000) {
				l[z] = maxn;
				z++;
			}else {
				l[z] = -1;
				z++;
			}
		}
		if (i >= k) {
			mp[a[i - k]]--;
			mp[x]++;
			long long maxn = -10000000000;
			for (map <long long, long long>::iterator i = mp.begin(); i != mp.end(); i++) {
				if (i ->second == 1) {
					maxn = max(maxn, i->first);
				}
			}
			if (maxn != -10000000000) {
				l[z] = maxn;
				z++;
			}else {
				l[z] = -1;
				z++;
			}
		}
	}

	for (int i = 0; i < z; i++) {
		if (l[i] != -1) {
			cout << l[i] << endl;
		}else {
			cout << "Nothing" <<endl;
		}
	}
	return 0;
}


//#include "stdafx.h"
#include <cstdio>
#include <set>
#include <map>

using namespace std;

int m[100000+1];

int main()
{
//	freopen ("input.txt","r",stdin);
//	freopen ("output.txt","w",stdout);
	int n,k;
	scanf("%d%d",&n,&k);
	map<int,int> mp;
	for (int i=0;i<k;++i)
	{
		int cur;
		scanf("%d",&cur);
		m[i]=cur;
		if (!mp.insert(make_pair(cur,1)).second) ++mp[cur];
	}
	set<int> q;
	set<int>::reverse_iterator it=q.rbegin();
	for (map<int,int>::iterator jt=mp.begin();jt!=mp.end();++jt)
		if (jt->second==1) q.insert(jt->first);
	q.empty() ? printf("Nothing\n") : printf("%d\n",*it);
	for (int i=k;i<n;++i)
	{
		int cur;
		scanf("%d",&cur);
		m[i]=cur;
		if (!mp.insert(make_pair(cur,1)).second) ++mp[cur];
		if (mp[cur]==1) q.insert(cur);
		else
			q.erase(cur);
		--mp[m[i-k]];
		if (mp[m[i-k]]==1) q.insert(m[i-k]);
		else
			q.erase(m[i-k]);
		q.empty() ? printf("Nothing\n") : printf("%d\n",*it);
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define MAXN 100010
using namespace std;
struct node {
    int cnt, val;
};
node tree[MAXN << 2];
int a[MAXN], b[MAXN];
inline void PushUp(int rt) {
    tree[rt].val = max(tree[rt << 1].val, tree[rt << 1 | 1].val);
}
void Update(int x, int val, int L, int R, int rt) {
    if (L == R) {
        tree[rt].cnt += val;
        if (tree[rt].cnt == 1)
            tree[rt].val = L;
        else
            tree[rt].val = 0;
    } else {
        int mid = (L + R) >> 1;
        if (x <= mid)
            Update(x, val, L, mid, rt << 1);
        else
            Update(x, val, mid + 1, R, rt << 1 | 1);
        PushUp(rt);
    }
}
int main() {
    int n, k, i, t;
    while (~scanf("%d%d", &n, &k)) {
        memset(tree, 0, sizeof(tree));
        for (i = 0; i < n; i++) {
            scanf("%d", &a[i]);
            b[i] = a[i];
        }
        sort(b, b + n);
        for (i = 0; i < n; i++)
            a[i] = lower_bound(b, b + n, a[i]) - b + 1;
        for (i = 0; i < k; i++)
            Update(a[i], 1, 1, n, 1);
        t = tree[1].val;
        if (t)
            printf("%d\n", b[t - 1]);
        else
            puts("Nothing");
        for (i = k; i < n; i++) {
            Update(a[i - k], -1, 1, n, 1);
            Update(a[i], 1, 1, n, 1);
            t = tree[1].val;
            if (t)
                printf("%d\n", b[t - 1]);
            else
                puts("Nothing");
        }
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define MAXN 100010
using namespace std;
struct node {
    int cnt, val;
};
node tree[MAXN];
int a[MAXN], b[MAXN];
inline void PushUp(int rt) {
    tree[rt].val = max(tree[rt << 1].val, tree[rt << 1 | 1].val);
}
void Update(int x, int val, int L, int R, int rt) {
    if (L == R) {
        tree[rt].cnt += val;
        if (tree[rt].cnt == 1)
            tree[rt].val = L;
        else
            tree[rt].val = 0;
    } else {
        int mid = (L + R) >> 1;
        if (x <= mid)
            Update(x, val, L, mid, rt << 1);
        else
            Update(x, val, mid + 1, R, rt << 1 | 1);
        PushUp(rt);
    }
}
int main() {
    int n, k, i, t;
    while (~scanf("%d%d", &n, &k)) {
        memset(tree, 0, sizeof(tree));
        for (i = 0; i < n; i++) {
            scanf("%d", &a[i]);
            b[i] = a[i];
        }
        sort(b, b + n);
        for (i = 0; i < n; i++)
            a[i] = lower_bound(b, b + n, a[i]) - b + 1;
        for (i = 0; i < k; i++)
            Update(a[i], 1, 1, n, 1);
        t = tree[1].val;
        if (t)
            printf("%d\n", b[t - 1]);
        else
            puts("Nothing");
        for (i = k; i < n; i++) {
            Update(a[i - k], -1, 1, n, 1);
            Update(a[i], 1, 1, n, 1);
            t = tree[1].val;
            if (t)
                printf("%d\n", b[t - 1]);
            else
                puts("Nothing");
        }
    }
    return 0;
}


import heapq
inf=10**9
n,k=map(int,input().split())
a,d=[],{}
for i in range(n):
    a.append(-int(input()))
    d[a[-1]]=0
for i in range(k):d[a[i]]+=1
h=[inf]
for x in d:
    if d[x]==1:
        h.append(x)
heapq.heapify(h)
d[inf]=1
print (-h[0] if h[0]<inf else 'Nothing')
for x,y in zip(a,a[k:]):
    d[x]-=1
    d[y]+=1
    if d[x]==1: heapq.heappush(h,x)
    if d[y]==1: heapq.heappush(h,y)
    while d[h[0]]!=1: heapq.heappop(h)
    print (-h[0] if h[0]<inf else 'Nothing')


from heapq import *
from collections import *

n, k = map(int, input().split())
a, queue = deque([int(input()) for i in range(n)]), []
mem = Counter(list(a)[:k])

for i in range(k):
    if mem[a[i]] == 1:
        queue.append(-a[i])

heapify(queue)

for i in range(n - k + 1):
    ans = 'Nothing'
    while queue:
        tem = -nsmallest(1, queue)[0]
        if mem[tem] == 1:
            ans = tem
            break
        heappop(queue)

    print(ans)
    if mem[a[0]] > 0:
        mem[a[0]] -= 1
        if mem[a[0]] == 1:
            heappush(queue, -a[0])

    try:
        mem[a[k]] += 1
        if mem[a[k]] == 1:
            heappush(queue, -a[k])
    except:
        continue

    a.popleft()


from heapq import *
from collections import *
from sys import stdin, stdout

n, k = map(int, stdin.readline().split())
a = deque([int(stdin.readline()) for i in range(n)])
mem = Counter(list(a)[:k])
queue = [-a[i] for i in range(k) if mem[a[i]] == 1]

heapify(queue)
arr, hmem = [], Counter(queue)

for i in range(n - k + 1):
    ans = 'Nothing'
    while queue:
        tem = -nsmallest(1, queue)[0]
        if mem[tem] == 1:
            ans = str(tem)
            break
        hmem[heappop(queue)] = 0

    arr.append(ans)

    mem[a[0]] = max(mem[a[0]] - 1, 0)
    if mem[a[0]] == 1 and not hmem[-a[0]]:
        heappush(queue, -a[0])
        hmem[-a[0]] = 1

    try:
        mem[a[k]] += 1
        if mem[a[k]] == 1 and not hmem[-a[k]]:
            heappush(queue, -a[k])
            hmem[-a[k]] = 1
    except:
        continue

    a.popleft()

stdout.write('\n'.join(arr))


from heapq import *
from collections import *
from sys import stdin, stdout

n, k = map(int, stdin.readline().split())
a, queue = deque([int(stdin.readline()) for i in range(n)]), []
mem = Counter(list(a)[:k])

for i in range(k):
    if mem[a[i]] == 1:
        queue.append(-a[i])

heapify(queue)
arr = []

for i in range(n - k + 1):
    ans = 'Nothing'
    while queue:
        tem = -nsmallest(1, queue)[0]
        if mem[tem] == 1:
            ans = str(tem)
            break
        heappop(queue)

    arr.append(ans)

    if mem[a[0]] > 0:
        mem[a[0]] -= 1
        if mem[a[0]] == 1:
            heappush(queue, -a[0])

    try:
        mem[a[k]] += 1
        if mem[a[k]] == 1:
            heappush(queue, -a[k])
    except:
        continue

    a.popleft()

stdout.write('\n'.join(arr))


from heapq import *
from collections import *
from sys import stdin, stdout

n, k = map(int, stdin.readline().split())
a = deque([int(stdin.readline()) for i in range(n)])
mem = Counter(list(a)[:k])
queue = [-a[i] for i in range(k) if mem[a[i]]]

heapify(queue)
arr = []

for i in range(n - k + 1):
    ans = 'Nothing'
    while queue:
        tem = -nsmallest(1, queue)[0]
        if mem[tem] == 1:
            ans = str(tem)
            break
        heappop(queue)

    arr.append(ans)

    if mem[a[0]] > 0:
        mem[a[0]] -= 1
        if mem[a[0]] == 1:
            heappush(queue, -a[0])

    try:
        mem[a[k]] += 1
        if mem[a[k]] == 1:
            heappush(queue, -a[k])
    except:
        continue

    a.popleft()

stdout.write('\n'.join(arr))


from heapq import *
from collections import *

n, k = map(int, input().split())
a, queue = deque([int(input()) for i in range(n)]), []
mem = Counter(list(a)[:k])

for i in range(k):
    if mem[a[i]] == 1:
        queue.append(-a[i])

heapify(queue)

for i in range(n - k + 1):
    ans = 'Nothing'
    while queue:
        tem = -queue[0]
        if mem[tem] == 1:
            ans = tem
            break
        heappop(queue)

    print(ans)
    if mem[a[0]] > 0:
        mem[a[0]] -= 1
        if mem[a[0]] == 1:
            heappush(queue, -a[0])

    try:
        mem[a[k]] += 1
        if mem[a[k]] == 1:
            heappush(queue, -a[k])
    except:
        continue

    a.popleft()


from heapq import *
from collections import *

n, k = map(int, input().split())
a, queue = deque([int(input()) for i in range(n)]), []
mem = Counter(list(a)[:k])

for i in range(k):
    if mem[a[i]] == 1:
        queue.append(-a[i])

heapify(queue)
arr = []
for i in range(n - k + 1):
    ans = 'Nothing'
    while queue:
        tem = -nsmallest(1, queue)[0]
        if mem[tem] == 1:
            ans = str(tem)
            break
        heappop(queue)

    arr.append(ans)
    if mem[a[0]] > 0:
        mem[a[0]] -= 1
        if mem[a[0]] == 1:
            heappush(queue, -a[0])

    try:
        mem[a[k]] += 1
        if mem[a[k]] == 1:
            heappush(queue, -a[k])
    except:
        continue

    a.popleft()

print('\n'.join(arr))


import sys,math as mt
import heapq as hp
import collections as cc
import bisect as bi
input=sys.stdin.buffer.readline
I=lambda:list(map(int,input().split()))
n,k=I()
a=[]
f=cc.defaultdict(int)
for i in range(n):
	a.append(-(int(input())))
for i in range(k):
	f[a[i]]+=1
h=[mt.inf]
for i in f:
	if f[i]==1:
		h.append(i)
hp.heapify(h)
f[mt.inf]=1
print(-h[0] if h[0]<mt.inf else "Nothing")

for x,y in zip(a,a[k:]):
    f[x]-=1
    f[y]+=1
    if f[x]==1: hp.heappush(h,x)
    if f[y]==1: hp.heappush(h,y)
    #print(x,y,h)
    while f[h[0]]!=1: hp.heappop(h)
    print (-h[0] if h[0]<mt.inf else 'Nothing')


from collections import defaultdict
from bisect import bisect_left
n, k = map(int, input().split())
t = [int(input()) for i in range(n)]
p = defaultdict(int)
for i in range(k): p[t[i]] += 1
r = sorted(i for i, j in p.items() if j == 1)
q = [0] * (n - k + 1)
q[0] = str(r[-1]) if r else 'Nothing'
for i in range(n - k):
    a, b = t[i], t[i + k]
    if a == b: q[i + 1] = q[i]
    else:
        p[b] += 1
        if p[b] == 1: r.insert(bisect_left(r, b), b)
        elif p[b] == 2: r.pop(bisect_left(r, b))
        p[a] -= 1
        if p[a] == 1: r.insert(bisect_left(r, a), a)
        elif p[a] == 0: r.pop(bisect_left(r, a))
        q[i + 1] = str(r[-1]) if r else 'Nothing'
print('\n'.join(q))


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
s, d = [], Counter(p[2:2 + k])
t = sorted(q for q in d if d[q] == 1)
def sub(q):
    if d[q] == 1: t.pop(bisect(t, q) - 1)
def add(q):
    if d[q] == 1: insort(t, q)
def get(): s.append(str(t[-1]) if t else 'Nothing')
get()
for a, b in zip(p[2:], p[2 + k:]):
    if a != b:
        sub(a), sub(b)
        d[b] += 1
        d[a] -= 1
        add(a), add(b)
    get()
print('\n'.join(s))


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
d = Counter(p[2:2 + k])
t = sorted(q for q in d if d[q] < 2)
g = lambda: print(t[-1] if t else 'Nothing')
g()
for a, b in zip(p[2:], p[2 + k:]):
    for q in [a, b]:
        if d[q] == 1: t.pop(bisect(t, q) - 1)
    d[b] += 1
    d[a] -= 1
    for q in [a, b]:
        if d[q] == 1: insort(t, q)
    g()


import sys
from bisect import bisect, insort
from collections import Counter

p = sys.stdin.read().split()
n, k = p[0], p[1]
l = 2 + k

d = Counter(p[2:l])
t = sorted(q for q, k in d.items() if k == 1)

sub = lambda q: t.pop(bisect(t, q) - 1)
add = lambda q: insort(t, q)
get = lambda: str(t[-1]) if t else 'Nothing'

s = [get()] + [0] * (n - k)
for i in range(n - k):
    a, b = p[l + i - k], p[l + i]
    if a != b:
        d[b] += 1
        d[a] -= 1
        if d[b] == 1: add(b)
        elif d[b] == 2: sub(b)
        if d[a] == 1: add(a)
        elif d[a] == 0: sub(a)
    s[i + 1] = get()
print('\n'.join(s))


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
d = Counter(p[2:2 + k])
t = sorted(q for q in d if d[k] < 2)
g = lambda: print(t[-1] if t else 'Nothing')
g()
for a, b in zip(p[2:], p[2 + k:]):
    for q in [a, b]:
        if d[q] == 1: t.pop(bisect(t, q) - 1)
    d[b] += 1
    d[a] -= 1
    for q in [a, b]:
        if d[q] == 1: insort(t, q)
    g()


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
s, d = [], Counter(p[2:2 + k])
t = sorted(q for q in d if d[q] == 1)
g = lambda: s.append(str(t[-1]) if t else 'Nothing')
g()
for a, b in zip(p[2:], p[2 + k:]):
    if a != b:
        if d[a] == 1: t.pop(bisect(t, a) - 1)
        if d[b] == 1: t.pop(bisect(t, b) - 1)
        d[b] += 1
        d[a] -= 1
        if d[a] == 1: insort(t, a)
        if d[b] == 1: insort(t, b)
    g()
stdout.write('\n'.join(s))


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
d = Counter(p[2:2 + k])
t = sorted(q for q in d if d[q] < 2)
g = lambda: print(t[-1] if t else 'Nothing')
g()
for a, b in zip(p[2:], p[2 + k:]):
    if a == b:
        g()
        continue
    for q in [a, b]:
        if d[q] == 1: t.pop(bisect(t, q) - 1)
    d[b] += 1
    d[a] -= 1
    for q in [a, b]:
        if d[q] == 1: insort(t, q)
    g()


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
d = Counter(p[2:2 + k])
t = sorted(q for q in d if d[q] == 1)
g = lambda: print(t[-1] if t else 'Nothing')
g()
for a, b in zip(p[2:], p[2 + k:]):
    if a != b:
        if d[a] == 1: t.pop(bisect(t, a) - 1)
        if d[b] == 1: t.pop(bisect(t, b) - 1)
        d[b] += 1
        d[a] -= 1
        if d[a] == 1: insort(t, a)
        if d[b] == 1: insort(t, b)
    g()


import sys
from bisect import bisect, insort
from collections import Counter

p = list(map(int, sys.stdin.read().split()))
n, k = p[0], p[1]
l = 2 + k

d = Counter(p[2:l])
t = sorted(q for q, k in d.items() if k == 1)

sub = lambda q: t.pop(bisect(t, q) - 1)
add = lambda q: insort(t, q)
get = lambda: str(t[-1]) if t else 'Nothing'

s = [get()] + [0] * (n - k)
for i in range(n - k):
    a, b = p[l + i - k], p[l + i]
    if a != b:
        d[b] += 1
        d[a] -= 1
        if d[b] == 1: add(b)
        elif d[b] == 2: sub(b)
        if d[a] == 1: add(a)
        elif d[a] == 0: sub(a)
    s[i + 1] = get()
print('\n'.join(s))


from sys import *
from bisect import *
from collections import *
p = list(map(int, stdin.read().split()))
n, k = p[0], p[1]
d = Counter(p[2:2 + k])
t = sorted(q for q in d if d[k] < 2)
g = lambda: print(t[-1] if t else 'Nothing')
g()
for a, b in zip(p[2:], p[2 + k:]):
    if a != b:
        for q in [a, b]:
            if d[q] == 1: t.pop(bisect(t, q) - 1)
        d[b] += 1
        d[a] -= 1
        for q in [a, b]:
            if d[q] == 1: insort(t, q)
    g()


from collections import defaultdict
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

class TreeNode(object):
    def __init__(self, val):
        self.val = val
        self.left = None
        self.right = None
        self.height = 1

# AVL tree class which supports insertion,
# deletion operations
class AVL_Tree(object):

    def insert(self, root, key):

        # Step 1 - Perform normal BST
        if not root:
            return TreeNode(key)
        elif key < root.val:
            root.left = self.insert(root.left, key)
        else:
            root.right = self.insert(root.right, key)

            # Step 2 - Update the height of the
        # ancestor node
        root.height = 1 + max(self.getHeight(root.left),
                              self.getHeight(root.right))

        # Step 3 - Get the balance factor
        balance = self.getBalance(root)

        # Step 4 - If the node is unbalanced,
        # then try out the 4 cases
        # Case 1 - Left Left
        if balance > 1 and key < root.left.val:
            return self.rightRotate(root)

            # Case 2 - Right Right
        if balance < -1 and key > root.right.val:
            return self.leftRotate(root)

            # Case 3 - Left Right
        if balance > 1 and key > root.left.val:
            root.left = self.leftRotate(root.left)
            return self.rightRotate(root)

            # Case 4 - Right Left
        if balance < -1 and key < root.right.val:
            root.right = self.rightRotate(root.right)
            return self.leftRotate(root)

        return root

        # Recursive function to delete a node with

    # given key from subtree with given root.
    # It returns root of the modified subtree.
    def delete(self, root, key):

        # Step 1 - Perform standard BST delete
        if not root:
            return root

        elif key < root.val:
            root.left = self.delete(root.left, key)

        elif key > root.val:
            root.right = self.delete(root.right, key)

        else:
            if root.left is None:
                temp = root.right
                root = None
                return temp

            elif root.right is None:
                temp = root.left
                root = None
                return temp

            temp = self.getMinValueNode(root.right)
            root.val = temp.val
            root.right = self.delete(root.right,
                                     temp.val)

            # If the tree has only one node,
        # simply return it
        if root is None:
            return root

            # Step 2 - Update the height of the
        # ancestor node
        root.height = 1 + max(self.getHeight(root.left),
                              self.getHeight(root.right))

        # Step 3 - Get the balance factor
        balance = self.getBalance(root)

        # Step 4 - If the node is unbalanced,
        # then try out the 4 cases
        # Case 1 - Left Left
        if balance > 1 and self.getBalance(root.left) >= 0:
            return self.rightRotate(root)

            # Case 2 - Right Right
        if balance < -1 and self.getBalance(root.right) <= 0:
            return self.leftRotate(root)

            # Case 3 - Left Right
        if balance > 1 and self.getBalance(root.left) < 0:
            root.left = self.leftRotate(root.left)
            return self.rightRotate(root)

            # Case 4 - Right Left
        if balance < -1 and self.getBalance(root.right) > 0:
            root.right = self.rightRotate(root.right)
            return self.leftRotate(root)

        return root

    def leftRotate(self, z):

        y = z.right
        T2 = y.left

        # Perform rotation
        y.left = z
        z.right = T2

        # Update heights
        z.height = 1 + max(self.getHeight(z.left),
                           self.getHeight(z.right))
        y.height = 1 + max(self.getHeight(y.left),
                           self.getHeight(y.right))

        # Return the new root
        return y

    def rightRotate(self, z):

        y = z.left
        T3 = y.right

        # Perform rotation
        y.right = z
        z.left = T3

        # Update heights
        z.height = 1 + max(self.getHeight(z.left),
                           self.getHeight(z.right))
        y.height = 1 + max(self.getHeight(y.left),
                           self.getHeight(y.right))

        # Return the new root
        return y

    def getHeight(self, root):
        if not root:
            return 0

        return root.height

    def getBalance(self, root):
        if not root:
            return 0

        return self.getHeight(root.left) - self.getHeight(root.right)

    def getMinValueNode(self, root):
        if root is None or root.left is None:
            return root

        return self.getMinValueNode(root.left)
    def getMaxValueNode(self, root):
        if root is None or root.right is None:
            return root

        return self.getMaxValueNode(root.right)

d=defaultdict(lambda:0)

n,k=map(int,input().split())
a=[]
for j in range(n):
    a.append(int(input()))
for j in range(k):
    d[a[j]]+=1
myTree = AVL_Tree()
root = None
for j in range(k):
    if d[a[j]]==1:
        root=myTree.insert(root, a[j])
p=myTree.getMaxValueNode(root)
if p==None:
    q="Nothing"
    print(q)
else:
    q=str(p.val)
    print(q)
j=k
while(j<n):
    f=0
    if d[a[j-k]]==1:
        root = myTree.delete(root, a[j-k])
        f=1
    elif d[a[j-k]]==2:
        root = myTree.insert(root, a[j-k])
        f=1

    d[a[j-k]]-=1
    d[a[j]]+=1
    if d[a[j]]==1:
        root = myTree.insert(root, a[j])
        f=1
    elif d[a[j]]==2:
        root = myTree.delete(root, a[j])
        f=1
    if f==1:
        p = myTree.getMaxValueNode(root)
        if p == None:
            q="Nothing"
            print(q)
        else:
            q=str(p.val)
            print(q)
    else:
        print(q)
    j+=1


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
h = []
d = {}
for i,x in enumerate(a):
    d[x]=d.get(x,0)+1
    heappush(h,-x)
    if i>=k:
        d[a[i-k]]-=1
        heappush(h,-a[i-k])
    if i>=k-1:
        while h and d[-h[0]]!=1: heappop(h)
        print -h[0] if h else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = dict(enumerate(sorted(a,reverse=True)))
d = dict((v,k) for k,v in q.iteritems())
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1: heappush(h,v)
    d[x]+=1
    if d[x]==1: heappush(h,x)
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'


from heapq import *
I=10**9+1
n,k = map(int,raw_input().split())
a = [-input() for _ in xrange(n)]
d = {}
for x in a[:k]: d[x]=d.get(x,0)+1
h = [I]+[i for i,v in d.iteritems() if v==1]
heapify(h)
d[I]=1
print -h[0] if h[0]<I else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]=d.get(x,0)+1
    if d[x]==1: heappush(h,x)
    elif h[0]==x: heappop(h)
    if d[v]==1: heappush(h,v)
    elif h[0]==v: heappop(h)
    while d[h[0]]!=1: heappop(h)
    print -h[0] if h[0]<I else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = sorted(a,reverse=True)
d = dict((v,k) for k,v in enumerate(q))
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1: heappush(h,v)
    d[x]+=1
    if d[x]==1: heappush(h,x)
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'


from heapq import *
I=10**9+1
n,k = map(int,raw_input().split())
a = [-input() for _ in xrange(n)]
d = dict((x,0) for x in a)
for x in a[:k]: d[x]+=1
h = [I]+[i for i,v in d.iteritems() if v==1]
heapify(h)
d[I]=1
print -h[0] if h[0]<I else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]+=1
    if d[x]==1: heappush(h,x)
    if d[v]==1: heappush(h,v)
    while d[h[0]]!=1: heappop(h)
    print -h[0] if h[0]<I else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = sorted(a,reverse=True)
d = dict((v,k) for k,v in enumerate(q))
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]+=1
    if d[x]==1: heappush(h,x)
    elif h and h[0]==x: heappop(h)
    if d[v]==1: heappush(h,v)
    elif h and h[0]==v: heappop(h)
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = sorted(a,reverse=True)
d = dict((v,k) for k,v in enumerate(q))
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
def wr():
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1: heappush(h,v)
    d[x]+=1
    if d[x]==1: heappush(h,x)
    wr()


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = sorted(a,reverse=True)
d = dict((v,k) for k,v in enumerate(q))
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]+=1
    if d[x]==1: heappush(h,x)
    elif h[0]==x: heappop(h)
    if d[v]==1: heappush(h,v)
    elif h[0]==v: heappop(h)
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = sorted(a,reverse=True)
d = dict((v,k) for k,v in enumerate(q))
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1:
        if h and d[h[0]]!=1: heapreplace(h,v)
        else: heappush(h,v)
    d[x]+=1
    if d[x]==1:
        if h and d[h[0]]!=1: heapreplace(h,x)
        else: heappush(h,x)
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'


from heapq import *
I=10**9+1
n,k = map(int,raw_input().split())
a = [-input() for _ in xrange(n)]
d = dict((x,0) for x in a)
for x in a[:k]: d[x]+=1
h = [I]+[i for i,v in d.iteritems() if v==1]
heapify(h)
d[I]=1
print -h[0] if h[0]<I else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]+=1
    if d[x]==1: heappush(h,x)
    elif h[0]==x: heappop(h)
    if d[v]==1: heappush(h,v)
    elif h[0]==v: heappop(h)
    while d[h[0]]!=1: heappop(h)
    print -h[0] if h[0]<I else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = dict(enumerate(sorted(a,reverse=True)))
d = dict((v,k) for k,v in q.iteritems())
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1: heappush(h,v)
    d[x]+=1
    if d[x]==1: heappush(h,x)
    try:
        while d[h[0]]!=1: heappop(h)
        print q[h[0]]
    except:
        print 'Nothing'


from heapq import *
I=10**9+1
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
d = {}
for x in a[:k]: d[x]=d.get(x,0)+1
h = [I]+[-i for i,v in d.iteritems() if v==1]
heapify(h)
d[I]=1
print -h[0] if h[0]<I else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]=d.get(x,0)+1
    if d[x]==1: heappush(h,x)
    elif h[0]==x: heappop(h)
    if d[v]==1: heappush(h,v)
    elif h[0]==v: heappop(h)
    while d[h[0]]!=1: heappop(h)
    print q[h[0]] if h[0]<I else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
q = sorted(a,reverse=True)
d = dict((v,k) for k,v in enumerate(q))
a = [d[x] for x in a]
d = [0]*n
for x in a[:k]: d[x]+=1
h = [i for i,v in enumerate(d) if v==1]
heapify(h)
print q[h[0]] if h else 'Nothing'
def z(x):
    if d[x]==1:
        if h and d[h[0]]!=1: heapreplace(h,x)
        else: heappush(h,x)
for v,x in zip(a,a[k:]):
    d[v]-=1
    d[x]+=1
    z(v)
    z(x)
    while h and d[h[0]]!=1: heappop(h)
    print q[h[0]] if h else 'Nothing'


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
d = {}
for x in a[:k]: d[x]=d.get(x,0)+1
h = [-j for j,v in d.iteritems() if v==1]
heapify(h)
def wr():
    while h and d[-h[0]]!=1: heappop(h)
    print -h[0] if h else 'Nothing'
wr()
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1: heappush(h,-v)
    d[x]=d.get(x,0)+1
    if d[x]==1: heappush(h,-x)
    wr()


from heapq import *
n,k = map(int,raw_input().split())
a = [input() for _ in xrange(n)]
d = {}
for x in a[:k]: d[x]=d.get(x,0)+1
h = [-j for j,v in d.iteritems() if v==1]
heapify(h)
print -h[0] if h else 'Nothing'
for v,x in zip(a,a[k:]):
    d[v]-=1
    if d[v]==1: heappush(h,-v)
    d[x]=d.get(x,0)+1
    if d[x]==1: heappush(h,-x)
    while h and d[-h[0]]!=1: heappop(h)
    print -h[0] if h else 'Nothing'