{$S+,R+}
	Uses 
		testlib;
        Const
        	Size = 100;
	Var 
		N, M, K : LongInt;
		Map : Array [0..Size - 1, 0..Size - 1 ] Of LongInt;
		OutWay : String;
		CntAns, CntOut : LongInt;

Procedure Init();
	Var I, V, X, Y : LongInt;
Begin
	FillChar(Map,SizeOf(Map),0);
	M := inf.ReadLongInt;
	N := inf.ReadLongInt;
	K := inf.ReadLongInt;
	V := inf.ReadLongInt;
	For I := 1 To V Do Begin
		X := inf.ReadLongInt;
		Y := inf.ReadLongInt;
		Map[X, Y] := 1;
	End;
	CntAns := ans.ReadLongInt;
	CntOut := ouf.ReadLongInt;
	ouf.NextLine;
	OutWay := ouf.ReadString;
End;

Procedure Check();
	Var I, J, Cnt, PosX, PosY, Len : LongInt;
Begin
	If (Not ouf.SeekEoF) Then
		Quit(_PE, 'Too many information in output file.');
	If (CntAns < CntOut) Then
		Quit(_WA, 'Jury can crash less shop-windows.');
	If (CntAns > CntOut) Then
		Quit(_WA, 'Contestent can''t crash less shop-windows than Jury.');
	PosX := 1;
	PosY := 1;
	Cnt :=0;
	Len := Length(OutWay);
	For I := 1 To Len Do Begin
		Case (OutWay[I]) Of
			'U' : Inc(PosY);
			'D' : Dec(PosY);
			'R' : Inc(PosX);
			'L' : Dec(PosX);
		End;
//		WriteLn(PosX,' ',PosY,' ', OutWay[I]);
		If ((PosX < 1) Or (PosX > M - K + 1) Or (PosY < 1) Or (PosY > N)) Then
			Quit(_WA, 'Bad output way');
	        For J :=1 To K Do Begin
	        	Inc(Cnt, Map[PosX + J - 2, PosY - 1 ]);
			Map[PosX + J - 2, PosY - 1] := 0;
	       	End;
	End;
	If ((PosX <> M - K + 1) Or (PosY <> N)) Then
		Quit(_WA, 'Bad way : shop-window isn''t in the other corner.');
	If (Cnt <> CntAns) Then Begin
		WriteLn(Cnt, ' ',CntAns);
		Quit(_WA, 'Bad output way : contestant crash too many shop-windows.');
	End;	
	Quit(_OK, '');
End;


Begin
	Init();
	Check();
End.
