You found a mysterious function f. The function takes two strings s1 and s2. These strings must consist only of lowercase English letters, and must be the same length.The output of the function f is another string of the same length. The i-th character of the output is equal to the minimum of the i-th character of s1 and the i-th character of s2.For example, f("ab", "ba") = "aa", and f("nzwzl", "zizez") = "niwel".You found two strings x and y of the same length and consisting of only lowercase English letters. Find any string z such that f(x, z) = y, or print -1 if no such string z exists.

The first line of input contains the string x. The second line of input contains the string y. Both x and y consist only of lowercase English letters, x and y have same length and this length is between 1 and 100.

If there is no string z such that f(x, z) = y, print -1. Otherwise, print a string z such that f(x, z) = y. If there are multiple possible answers, print any of them. The string z should be the same length as x and y and consist only of lowercase English letters.

NoteThe first case is from the statement.Another solution for the second case is "zizez"There is no solution for the third case. That is, there is no z such that f("ab", z) =  "ba".

program vk;
var a,b,c:string;
    i:byte;
    flag:boolean;
begin
   readln(a);
   read(c);
   flag:=true;
   for i:= 1 to length(a) do
   begin
      if a[i]< c[i] then
      begin
         flag:=false;
         break;
      end;
   end;
   if flag then
   begin
      write(c);
   end
   else
   begin
      write(-1);
   end;
end.

var a,s,d,f : integer;
z,x,c,v: string;
begin
  readln (z);
  read (x);

    for a:=1 to length(x) do
    if ord(x[a])>ord(z[a]) then begin
                                  write (-1);
                                  exit;
                                end;

                                for a:=1 to length(x) do
                                 write (x[a]);

end.

Var
    s1, s2, s3: String;

Begin
    Readln(s1);
    Readln(s2);
    For Var i := 1 to Length(s1) do
        If s2[i] > s1[i] then Begin
            Write(-1);
            Exit
        End
        Else If s1[i] = s2[i] then
            s3 += s1[i]
        Else
            s3 += s2[i];
    Write(s3)
End.

var
  s1, s2, s3, s5: string;
  i, j, k: integer;

begin
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
  begin
    if s1[i] = s2[i] then
      s3 := s3 + 'z';
    if s1[i] > s2[i] then
      s3 := s3 + s2[i];
    if s1[i] < s2[i] then begin
      writeln('-1');
      exit();
    end;
  end;
  writeln(s3);

end.

   const nn=600000; nnn=2000;eps=0.00000001;  besk1=200000008;
   label 1,2;
    type   { real=double;}  {string=ansistring;}
    mas=array [0..nn] of int64;   point=record x,y,z:real;end;
    zap=record p1,p2,p3 :int64;end; zap1=^zap;
    mass=array[-100000..nn] of int64;mass1=^mass;
    var ot,qq,pos,t,l,nm,n,s1,s2,m,s,imax,smin,cen,dl,t2,i1,p,prost,besk:int64;
    k,step,ii,i,j:longint;
     oot,yt,yyot,aaa,bbb,ccc:extended;
     sss:array[-10..100000] of char;
     sssnew:array[-10..100000] of char;
     x,y,dd,dist,a,b:array[-100000..2000000] of int64;
     dda,ddb:array[-10..1200,-10..1200] of int64;
     ss1,ss2:string;
    ss:string;ch:char;
    zan:array[-100..2000000] of boolean;
    maxpr:array[0..nn] of string;
    st2:array[0..nnn] of string;
     v0,v1,s0,t0:real;
     zv:point;
     zz,aa,bb,cc,sumsq,sq,xx,yy:array[-100000..nn] of extended;
     xm,ym,yot:extended;
       flag,flag1:boolean;
    function al(x,y:extended):extended; var t0,t1,p,s0,s1:extended;
 begin
     if (x>0)and(y>=0) then p:=arctan(y/x);
     if x<0 then p:=pi+arctan(y/x);
     if(x>0)and(y<0) then p:=2*pi+arctan(y/x);
     if x=0 then if (y>=0) then p:=pi/2 else p:=3*pi/2;
     al:=p/pi*180;
 end;
  function min(x,y:int64):int64;begin min:=x;if y<x then min:=y; end;
  function max(x,y:int64):int64;begin max:=x;if y>x then max:=y; end;

  function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

  function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
  tt:zap; tt1:zap1;
begin
  if a<b then begin r:=a;a:=b;b:=r; end;
  x2:=1;x1:=0;y2:=0;y1:=1;
  while b>0 do
    begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
          a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;

    end;
    d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt;
   evkl:=tt1;
end;

 function col(ss1:string):int64;
var n,i,j,ot:longint;
 begin
    n:=length(ss1);    ot:=0;
    for i:=1 to n-1 do if (ss1[i]='V')and(ss1[i+1]='K')
    then inc(ot);
     col:=ot;
 end;

begin
  {  assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
    readln(ss1);n:=length(ss1);
    readln(ss2);n:=length(ss1);

    flag:=true;
    for i:=1 to n do if ss1[i]<ss2[i] then flag:=false;
    if not flag then begin writeln(-1); goto 1; end;
    writeln(ss2);

   1:          close(output);
end.

const fi='';
    fo='';
var f:text;
    x,y,z:string;
procedure input;
begin
    assign(f,fi);reset(F);
    readln(f,x);
    read(F,y);
    close(F);
end;
function min(a,b:string):string;
begin
    if (a<b) then exit(A);
    exit(b);
end;
procedure process;
var  i:byte;
begin
    for i:=1 to length(X) do z:=z+min(x[i],y[i]);
    assign(f,fo);rewrite(F);
    for i:=1 to length(y) do
            if (z[i]<y[i]) then
            begin
                write(f,-1);
                close(F);
                halt;
            end;
    write(f,z);
    close(F);
end;

begin
    input;
    process;
end.

var a,a1,ta,d,tb,b,b1,tf,e,du,i,j,k,n,m,cr,r,h,t,du1,max:Longint;
var count:Qword;
type d2a=array[1..1000000] of Longint;
var ar:array[1..200000] of longint;
var sa:array[1..1000] of string;
var gr,er:d2a;
var super:Qword;
var s,s1,x:ansistring;
var cha,chara:char;
var f1,f2:text;
begin
        readln(s);
        readln(s1);
        for i:=1 to length(s) do
        begin
                iF(s[i]<s1[i]) then
                begin
                        writeln(-1);
                        halt;
                end;
        end;
        writeln(s1);

end.

var x,y,z:string;
    f,i:longint;
begin
    readln(x);
    readln(y);
    for i:=1 to length(x) do
        begin
            if ord(x[i])<ord(y[i]) then f:=-1;
        end;
    if f=-1 then writeln(f) else writeln(y);
end.

var
  x, z, y: string;
  n, i, k, l: integer;

begin
  readln(x);
  readln(z);
  for i := 1 to length(x) do
  begin
    if (ord(x[i]) >= ord(z[i])) then
      y := y + z[i];
    if (ord(x[i]) < ord(z[i])) then
    begin
      y := '-1';
      break;
    end;
  end;
  writeln(y);
end.

var
  s1,s2,s3 : string;
  i : longint;
begin
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do
    begin
      if s1[i]=s2[i] then s3:=s3+s1[i] else
      if s1[i]<s2[i] then begin writeln(-1); halt; end else
      s3:=s3+s2[i];
    end;
  writeln(s3);
end.

var x,y:ansistring; i:longint;
begin
  readln(x); readln(y);
  for i:=1 to length(x) do
    if x[i]<y[i] then
    begin write(-1); halt end;
  write(y)
end.

var
  x,y:string;
  n,i:longint;
  ok:boolean;

begin
  readln(x);
  readln(y);
  n:=length(x);
  ok:=true;
  for i:=1 to n do
    if x[i]<y[i]
      then ok:=false;
  if ok
    then writeln(y)
    else writeln(-1)
end.

program HelloWorld;
var x,y,z:string;
    ch:char;
    i,l,test,a:integer;
begin
readln(x);
readln(z);
{x:='ab';
z:='ba';}
y:=x;
test:=1;
l:=length(x);
for i:=1 to l do
begin
if (x[i]=z[i]) then
begin
a:=ord(x[i]);
a:=a+1;
if a>122 then
a:=122;
ch:=chr(a);
y[i]:=ch;
{writeln(ord(x[i]));
writeln(a);
writeln(ch);}
end
else
begin
        if (x[i]>z[i]) then
        y[i]:=z[i]
        else
        begin
        writeln('-1');
        test:=0;
        break;
        end;
        end;

    end;
    if test=1 then
    writeln(y);
end.

var x,y,z:string;i:integer; f:boolean;
begin
        readln(x);
        readln(z);
        f:=true;
        y:='';
        for i:=1 to length(x) do
        begin
                if ord(x[i])=ord(z[i]) then
                begin
                        if chr(ord(z[i])+1)='{' then y:=y+'z'
                        else y:=y+chr(ord(z[i])+1);
                end;
                if ord(x[i]) > ord(z[i]) then y:=y+z[i];
                if ord(x[i]) < ord(z[i]) then
                begin
                        f:=false; break;
                end;
        end;
        if f=true then write(y) else write(-1);
end.

var
 s,s1,s2:ansistring;
 c,c1,c2:char;
 i,j,n,m,k,sc:longint;
function min(a,b:char):char;
begin
 if a<b then min:=a else min:=b;
end;
begin
 readln(s1);
 readln(s2);
 for i:=1 to length(s1) do
 begin
  if s1[i]=s2[i] then begin s:=s+s1[i]; continue; end;
  if s1[i]<s2[i] then begin writeln(-1); halt; end;
  s:=s+min(s1[i],s2[i]);
 end;
 writeln(s);
end.

program yan;
  var s,s1,s2:string; i,j,x,y,n,m:integer;
begin
  readln(s);
  readln(s1);
  for i:=1 to length(s) do
    if s[i]<s1[i] then
      begin
        write(-1); exit;
      end;
  write(s1);
end.

program ideone;
var
  x,y:string;
  i:longint;
  c:boolean;
begin
    readln(x);
    readln(y);
    c:=true;
    for i:=1 to length(x) do
    	if x[i]<y[i] then
    		c:=false;
    if c then write(y)
    else write(-1);
end.

var s1,s2,s3:string;
    i:longint;
begin
readln(s1);
readln(s3);
s2:='';
for i:=1 to length(s1) do
   begin
           if s1[i]<  s3[i] then
             begin
               write(-1);
               exit;
             end;
   end;
write(s3);
end.

var a,b,c:ansistring;
i:longint;
begin
//assign(input,'yjzdys.in');reset(input);
//assign(output,'yjzdys.out');rewrite(output);
readln(a);readln(b);
for i:=1 to length(a) do
  begin
  if a[i]<b[i] then
    begin writeln(-1);close(input);close(output);halt;end;
  if a[i]=b[i] then c:=c+a[i];
  if a[i]>b[i] then c:=c+b[i];
  end;
writeln(c);
close(input);close(output);
end.

var s,ss:string;
i:Longint;
begin
//assign(input,'yjzdys.in');reset(input);
//assign(output,'yjzdys.out');rewrite(output);
readln(s);
readln(ss);
for i:=1 to length(s) do
  if s[i]<ss[i] then
    begin
    writeln(-1);
    close(input);close(output);
    halt;
    end;
for i:=1 to length(s) do
  if s[i]=ss[i] then
    begin
    if ss[i]='z' then
      write(ss[i])
    else
      write(succ(ss[i]))
    end
  else
    write(ss[i]);
close(input);close(output);
end.

var x,y,z:string;
i:longint;

begin
//assign(input,'yjzdys.in');reset(input);
//assign(output,'yjzdys.out');rewrite(output);
readln(x);readln(y);
for i:=1 to length(x) do
  if y[i]>x[i] then
    begin
    writeln(-1);
    close(input);close(output);halt;
    end
  else z:=z+y[i];
writeln(z);

close(input);close(output);
end.

var
        x,y,ans:string;
        i:integer;
begin
readln(x);
readln(y);
setlength(ans, length(x));
for i:=1 to length(x) do
        if x[i]<y[i] then
                begin
                writeln(-1);
                halt;
                end
                else
                ans[i]:=y[i];
writeln(ans);
end.

program z2;
var
    x,y,z:string;
    n,i:integer;
    f:boolean;
begin
    readln(x);
    readln(y);
    z:='';
    n:=length(y);
    f:=true;
    for i:=1 to n do begin
        if ord(x[i])<ord(y[i]) then f:=false else begin
            if ord(x[i])=ord(y[i]) then z:=z+'z';
            if ord(x[i])>ord(y[i]) then z:=z+y[i];
        end;
        if f=false then break;
    end;
    if f=false then write(-1) else write(z);
end.

var
  a,b,i,n,k,j,m,p:longint;
  t,s,x:string;
  was:array[1..111111]of boolean;
begin
  readln(s);
  readln(t);

  for i:=1 to length(s) do
  begin
    if (s[i]<t[i]) then begin writeln(-1);halt;end;
    if (s[i]=t[i]) then x:=x+chr(ord(s[i])) else
    if t[i]>s[i] then x:=x+s[i] else x:=x+t[i];
  end;

  writeln(x);
end.

var
   x,y,z:string;
   f:boolean;
   i,j,ans:longint;
begin
   readln (x);
   readln (y);
   f:=true;
   z:='';
   for i:=1 to length(x) do
   begin
      if (x[i]=y[i])then
{         if y[i]<>'z' then}
            z:=z+x[i]
{         else z[i]:='y'}
      else
      begin
         if y[i]<x[i] then z:=z+y[i] else begin f:=false;  break; end;
      end;
   end;
   if f then write (z) else write(-1);
end.

var s1,s2:ansistring;
        i:longint;
begin
        REadln(s1);
        readln(s2);
        for i:=1 to length(s1) do
        Begin
                if s1[i]<s2[i] then
                Begin
                        WRiteln(-1);
                        exit;
                End;
        end;
        write(s2);
end.

var x,y:ansistring; i:longint;
begin
  readln(x); readln(y);
  for i:=1 to length(x) do
    if x[i]<y[i] then
    begin write(-1); halt end;
  write(y);
end.

var
  x,y:string;
  n,i:longint;
  ok:boolean;

begin
  readln(x);
  readln(y);
  n:=length(x);
  ok:=true;
  for i:=1 to n do
    if x[i]<y[i]
      then ok:=false;
  if ok
    then writeln(y)
    else writeln(-1)
end.

var
 a,b:array[1..1000] of longint;
 d:char;
 p:boolean;
 n,i,j,l,m,max:Longint;
begin
 n:=0;
  while (true) do
   begin
    read(d);
    inc(n);
    if (ord(d)>=ord('a')) and (ord(d)<=ord('z')) then a[n]:=ord(d) else break;
   end;
  dec(n);
  readln;
  p:=true;
 for i:=1 to n do
  begin
   read(d);
   b[i]:=ord(d);
   if (b[i]>a[i]) then p:=false;
  end;
 if p=false then begin writeln(-1); exit; end;
 for i:=1 to n do
  write(chr(b[i]));

end.

var x, y: string;
    i: longint;

begin
    readln(x);
    readln(y);
    for i := 1 to length(x) do
        if x[i] < y[i] then begin
            write(-1);
            exit;
        end;
    write(y);
end.

var
p:char;

s,ss:string;
kol,j,i:longint;
bol:boolean;
a:array[-10000..100000]of char;

begin
bol:=true;
readln(s);
readln(ss);
bol:=true;
for i:=1 to length(s) do begin
    if ord(s[i])<ord(ss[i]) then bol:=false;
    if ord(s[i])=ord(ss[i]) then a[i]:='z';
    if ord(s[i])>ord(ss[i]) then a[i]:=ss[i];
end;
if bol=false then writeln(-1)
else begin
    for i:=1 to length(s) do write(a[i]);
end;
end.

uses math;
const
	fi = '';
	fo = '';
	maxn = 100001;
var x,y,z:string; i,j,n:longint; check:boolean;
	f1,f2:text;
begin
	assign(f1,fi); reset(f1);
	assign(f2,fo); rewrite(f2);
	readln(f1,x);
	readln(f1,y);
	n:=length(x);
	check:=true;
	for i:=1 to n do
	begin
		if x[i]=y[i] then z:=z+'z'
		else
			if x[i]<y[i] then check:=false
			else z:=z+y[i];
	end;
	if check then writeln(f2,z) else writeln(f2,-1);
	close(f1); close(f2);
end.

var x,y,z:ansistring;
    n,i:integer;
    kt:boolean;

  begin
   readln(x);
   readln(z);
   kt:=true;y:=x;n:=length(x);
   //neu x[i]=z[i] thi y[i]=chr(ord(x[i])+1) hoac neu x[i]<>z[i] thi y[i]=z[i];
  for i:=1 to n do
       if x[i]=z[i] then
           y[i]:=x[i]
        else
        if x[i]>z[i] then
           y[i]:=z[i]
        else
         begin
          kt:=false;
          break;
         end;
    if not kt then write(-1)
    else write(y);
end.

program B;

var wronglet : boolean;
	i : integer;
	x, z : string;
BEGIN
	readln(x);
	readln(z);
	for i := 1 to length(x) do
	if (ord(x[i])<ord(z[i])) then wronglet := true;
	if wronglet then writeln('-1')
	else writeln(z);
END.

var
x,y,z:string;
a:char;
i,j,k:longint;
begin
readln(x);
readln(y);
z:='';
for i:=1 to length(x) do begin
 if (y[i]<x[i]) then begin
  z:= z + y[i];
  end
 else if (y[i]>x[i]) then begin
  writeln('-1');
  exit;
 end
 else if (y[i]=x[i]) then begin
  z:= z + 'z';
  end;
end;

write(z);
writeln;
end.

var
 x,y,z :string;
 i : longint;

begin
	readln(x);
	readln(y);
	z:='';
	for i:= 1 to length(x) do begin
		z:=z+' ';
		if(x[i]<y[i])then begin
			writeln(-1);
			exit;
		end
		else if(x[i]>y[i])then begin
			z[i]:=y[i];
		end
		else begin
			z[i]:=x[i];
		end;
	end;
	writeln(z);
end.

var
sss:array[1..100000]of char;
s,s1:string;
i:longint;
bol:boolean;
begin
bol:=true;
readln(s);
readln(s1);
for i:=1 to length(s) do begin
    if s[i]=s1[i] then begin
        sss[i]:='z';
    end
    else begin
    if s[i]<s1[i] then bol:=false;
        sss[i]:=s1[i];
    end;

end;

if bol then for i:=1 to length(s) do write(sss[i])
else
writeln(-1);
end.

var x,z,y:string;
a,b,c,i:integer;
begin

  readln(x);
  readln(z);
  y:='';
  for i:=1 to length(x) do begin
    a:=ord(x[i]); b:=ord(z[i]);
    if a=b then c:=a;
    if a>b then c:=b;
    if a<b then c:=-1;
    if (c<ord('a'))or(c>ord('z')) then begin
      y:='-1';
      break;
      end else y:=y+chr(c);

  end;
  writeln(y);

end.

program S801B;
var
s1, s2 : string;
i, j, k : integer;

function y(x, z: string ) : string;
var
temp : string;
begin
temp:='';
for i:=1 to length(x) do
   begin
     if ((x[i])=z[i]) then
       begin
         temp:=temp+x[i];
       end
       else if (x[i]>z[i]) then
       begin
         temp:=temp+z[i];
       end
       else
       begin
           temp:='-1';
           Break;
       end;

   end;
 y:=temp;

end;

begin
readln(s1);
readln(s2);

writeln(y(s1,s2));

readln;
end.

const   fi='';
var
        x,y,z:string;

procedure solve;
var i,n,t:int32;
begin
        randomize;
        n:= length(x);
        for i:= 1 to n do
        begin
                if x[i]<z[i] then
                begin
                        write(-1); exit;
                end;
                t:= ord(x[i])+random(122-ord(x[i]));
                if x[i]>z[i] then y:= y+z[i]
                else y:= y+chr(t);
        end;
        write(y);
end;
begin
        assign(input,fi); reset(input);
        readln(x);
        read(z);
        solve;
        close(input);
end.

var
st1,st2,st3:string;
i,sz,usl,per:byte;

begin
readln(st1);
readln(st2);
sz:=length(st1);
usl:=0;
st3:='';
 for i:=1 to sz do
  if st2[i]>st1[i] then inc(usl);

if usl>0 then write(-1) else
 begin
 for i:=1 to sz do
   begin
   if st1[i]>st2[i] then
     st3:=st3+st2[i];

   if st1[i]=st2[i] then
     begin
     per:=ord(st1[i]);
      if per=122 then st3:=st3+chr(per) else
       begin
        inc(per);
        st3:=st3+chr(per);
       end;
     per:=0;
    end;
    end;
    end;
  write(st3);
  end.

program ideone;

var x,z:string; i:integer; zz:boolean;
begin
readln(x);
readln(z);
zz:=true;
while (i<=length(x)) AND (zz=true) do
	begin
	if ord(z[i])>ord(x[i]) then zz:=false;
	inc(i);
	end;
if zz=false then writeln('-1')
else writeln(z);
end.

var s1,s2,s3:string;
    n,i:longint;
begin
//assign(input,'b.inp');reset(input);
//assign(output,'b.out');rewrite(output);
readln(s1);
readln(s3);
n:=length(S1);
for i:=1 to n do s2:=s2+'+';
For i:=1 to n do
    begin
        if s3[i]=s1[i] then
                begin
                      s2[i]:='z';
                      continue;
                end;
        if s3[i]>s1[i] then
                begin
                     writeln(-1);
                     halt;
                end;
        s2[i]:=s3[i];
    end;
writeln(s2);
end.

var x,y:ansistring; i:longint;
begin
  readln(x); readln(y);
  for i:=1 to length(x) do
    if x[i]<y[i] then
    begin write(-1); halt end;
  write(y)
end.

var
 s1,s3:ansistring;
 i:longint;
begin
 readln(s1);
 readln(s3);
 for i:=1 to length(s1) do
  if s1[i]<s3[i] then
   begin
    write(-1);
    halt;
   end;
 write(s3);
end.

uses math;
const inp='key.inp'; out='key.out';

var   x,y,res:ansistring;

procedure main; var i:longint; begin
    //assign(input,inp);assign(output,out);reset(input);rewrite(output);
    readln(x); readln(y);
    i:=1;
    while i<=length(x) do begin
        if (min(ord(x[i]),ord(y[i]))=ord(x[i]))and(x[i]<>y[i]) then begin
            writeln('-1'); halt;
        end else inc(i);
    end;
    i:=1; res:='';
    while i<=length(x) do begin
        if min(ord(x[i]),ord(y[i]))=ord(y[i]) then res:=res+y[i]
        else res:=res+x[i];
        inc(i);
    end;
    writeln(res);
end;

begin
    main;
end.

var a,b,c,d,i,z:integer;
a1,a2,a3,a4:string;
begin
readln(a1);
readln(a2);
c:=length(A1);
for i:=1 to c do begin
if a2[i]>A1[i] then begin
writeln(-1);
z:=1;
break;
end;
end;
if z=0 then begin
a3:=a2;
writeln(A3);
end;
end.

var i:longint;
    a,b,c:string;
begin
readln(a);readln(c);
for i:=1 to length(a) do if a[i]<c[i] then begin writeln(-1);halt;end else b:=b+c[i];
writeln(b);
end.

var n,m,i,j:longint;
    a,b,c:string;
begin
readln(a);readln(c);
for i:=1 to length(a) do begin
  if a[i]<c[i] then begin writeln(-1);halt;end;
  if a[i]=c[i] then b:=b+a[i];
  if a[i]>c[i] then b:=b+c[i];
end;
writeln(b);
end.

var	s,t:string;
	i:integer;
	bool:boolean;
begin
	readln(s);
	readln(t);
	bool:=false;
	for i:=1 to length(s) do
		if t[i]>s[i] then
		begin
			bool:=true;
			break;
		end;
	if bool=false then writeln(t) else writeln(-1);
end.

var  s,s1: ansistring;
i,j,l: longint;
b: boolean;

begin
readln(s);
readln(s1);
l:=length(s);
for i:=1 to l do
  if s1[i]>s[i] then b:=true;
if b=true then write(-1) else write(s1);
readln;
end.

program VALUED_KEYS;
const fi='';
      fo='';
var s1,s2:string;

procedure nhap;
var f:text;
begin
 assign(f,fi);
 reset(f);
  readln(f,s1);
  readln(f,s2);
 close(f);
end;

procedure xuat(kq:string);
var g:text;
begin
 assign(g,fo);
 rewrite(g);
  writeln(g,kq);
 close(g);
 halt;
end;

procedure xuli;
var i:byte;
    kq:string;
begin
 kq:='';
 for i:=1 to length(s1) do
        if s2[i]>s1[i] then xuat('-1')
        else
                if s2[i]<s1[i] then kq:=kq+s2[i]
                else kq:=kq+'z';
 xuat(kq);
end;

BEGIN
 nhap;
 xuli;
END.

const
fi='';
fo='';
var
x,y:string;
//free:array[1..100] of boolean;
procedure enter;
var f:text;
i:longint;
begin
    assign(f,fi);
    reset(f);
    readln(f,x);
    readln(f,y);
    close(f);
end;
function min(a,b:char):char;
begin
    if a>b then min:=b else min:=a;
end;
procedure solve;
var f:text;
z:string;
kq:char;
k,i:longint;
begin
    assign(f,fo);
    rewrite(f);
    z:='';
    k:=length(x);
    for i:=1 to k do
     begin
         if x[i]<y[i] then
          begin
              write(f,'-1');
              close(f);
              exit;
          end;
         kq:=min(x[i],y[i]);
        if kq<>'z' then
         if kq=x[i] then kq:=chr(ord(x[i])+1);
         z:=z+kq;
     end;
     write(f,z);
     close(f);
end;
begin
    enter;
    solve;
end.

var s1,s2,a:ansistring; n,i:longint;  check:boolean;
begin
	//assign(input,'c2.inp'); reset(input);
	//assign(output,'c2.out'); rewrite(output);
	readln(s1);
	readln(s2);
	n:=length(s1);
	for i:=1 to n do
	begin
                randomize;
                if ord(s1[i])=ord(s2[i]) then a:=a+chr(random(122-ord(s1[i]))+ord(s1[i]))
		else
			if ord(s1[i])>ord(s2[i]) then a:=a+s2[i]
			else a:=a+chr(123);
	end;
	check:=false;
	for i:=1 to n do
		if (ord(a[i])>122) then check:=true;
	if check then write(-1) else write(a);
end.

var
x,z,y:string;
i,n,k:longint;
check:boolean;
begin
readln(x);
readln(y);
n:=1;

check:=false;
for i:=1 to length(x) do begin
  if ord(x[i]) < ord(y[i]) then begin
    check:=true;
    break;
    end
  else z:= z + y[i];
end;
if check then writeln(-1) else writeln(z);
end.

var
x,z,y:string;
i,n,k:longint;
check:boolean;
begin
readln(x);
readln(y);
n:=1;

check:=false;
 if length(x) = 1 then writeln(y) else
begin
for i:=1 to length(x) do begin
    if ((2*i-1) <= length(x) ) then
  if (x[2*i-1] <> y[2*i-1]) then check:=true;
  if check then break;
end;
if check then writeln(-1) else writeln(y);
end;
end.

program vk;
var a,b,c:string;
    i:byte;
    flag:boolean;
begin
   readln(a);
   read(c);
   flag:=true;
   for i:= 1 to length(a) do
   begin
      if i mod 2=1 then
      begin
         if a[i]<> c[i] then
         begin
            flag:=false;
            break;
         end;
      end;
   end;
   if flag then
   begin
      write(c);
   end
   else
   begin
      write(-1);
   end;
end.

var a,s,d,f : integer;
z,x,c,v: string;
begin
  readln (z);
  read (x);

    for a:=1 to length(x) do
    if ord(x[a])>ord(z[a]) then begin
                                  write (-1);
                                  exit;
                                end;

                                for a:=1 to length(x) do
                                if x[a]=z[a] then write (chr(ord(x[a])+1)) else
                                 write (x[a]);

end.

Var
    s1, s2: String;

Begin
    Readln(s1);
    Readln(s2);
    For Var i := 1 to Length(s1) do
        If s2[i] > s1[i] then Begin
            Write(-1);
            Exit
        End
        Else If s1[i] = s2[i] then
            Write(s1[i])
        Else
            Write(s2[i])
End.

var s:string;
    i,rez,f:longint;
begin
    readln(s);
    s:=' '+s+' ';
    for i:=2 to length(s)-1 do
        begin
            if (s[i]='K')and(s[i-1]='V') then
                inc(rez);
        end;

    for i:=3 to length(s) do if (s[i]='V')and(s[i-1]='V')and(s[i-2]='V') then f:=1;
    for i:=3 to length(s) do if (s[i]='V')and(s[i-1]='V')and(s[i-2]='V') then f:=1;
    if (s[2]=s[3])and(s[2] = 'K') then f:=1;
    if (s[length(s)-1]=s[length(s)-2])and(s[length(s)-2] = 'V') then f:=1;
    writeln(rez+f);
end.

var
  x, z, y: string;
  n, i, k, l: integer;

begin
  readln(x);
  readln(z);
  for i := 1 to length(x) do
  begin
    if (ord(x[i]) > ord(z[i])) then
      y := y + z[i];
    if (ord(x[i]) = ord(z[i])) then
      y := y + chr(ord(z[i]) + 1);
    if (ord(x[i]) < ord(z[i])) then
    begin
      y := '-1';
      break;
    end;
  end;
  writeln(y);
end.

program HelloWorld;
var x,y,z:string;
    ch:char;
    i,l,test,a:integer;
begin
readln(x);
readln(z);
{x:='ab';
z:='ba';}
y:=x;
test:=1;
l:=length(x);
for i:=1 to l do
begin
if (x[i]=z[i]) then
begin
a:=ord(x[i]);
a:=a+1;
ch:=chr(a);
y[i]:=ch;
{writeln(ord(x[i]));
writeln(a);
writeln(ch);}
end
else
begin
        if (x[i]>z[i]) then
        y[i]:=z[i]
        else
        begin
        writeln('-1');
        test:=0;
        end;
        end;

    end;
    if test=1 then
    writeln(y);
end.

program HelloWorld;
var x,y,z:string;
    ch:char;
    i,l,test,a:integer;
begin
readln(x);
readln(z);
{x:='ab';
z:='ba';}
y:=x;
test:=1;
l:=length(x);
for i:=1 to l do
begin
if (x[i]=z[i]) then
begin
a:=ord(x[i]);
a:=a+1;
ch:=chr(a);
y[i]:=ch;
{writeln(ord(x[i]));
writeln(a);
writeln(ch);}
end
else
begin
        if (x[i]>z[i]) then
        y[i]:=z[i]
        else
        begin
        writeln('-1');
        break;
        test:=0;
        end;
        end;

    end;
    if test=1 then
    writeln(y);
end.

program HelloWorld;
var x,y,z:string;
    ch:char;
    i,l,test,a:integer;
begin
readln(x);
readln(z);
{x:='ab';
z:='ba';}
y:=x;
test:=1;
l:=length(x);
for i:=1 to l do
begin
if (x[i]=z[i]) then
begin
a:=ord(x[i]);
a:=a+1;
ch:=chr(a);
y[i]:=ch;
{writeln(ord(x[i]));
writeln(a);
writeln(ch);}
end
else
begin
        if (x[i]>z[i]) then
        y[i]:=z[i]
        else
        begin
        writeln('-1');
        test:=0;
        break;
        end;
        end;

    end;
    if test=1 then
    writeln(y);
end.

//fpc 3.0.0

program HelloWorld;
var x,y,z:string;
    ch:char;
    i,l,test,a:integer;
begin
readln(x);
readln(z);
{x:='ab';
z:='aa';}
y:=x;
test:=1;
l:=length(x);
for i:=1 to l do
begin
if (x[i]=z[i]) then
begin
a:=ord(x[i]);
a:=a+1;
ch:=chr(a);
y[i]:=ch;
{writeln(ord(x[i]));
writeln(a);
writeln(ch);}
end
else
begin
        if (x[i]>z[i]) then
        y[i]:=z[i]
        else
        begin
        y:=('-1');
        test:=0;
        end;
        end;

    end;

    writeln(y);
end.

program HelloWorld;
var x,y,z:string;
    ch:char;
    i,l,test,a:integer;
begin
readln(x);
readln(z);
{x:='ab';
z:='ba';}
y:=x;
test:=1;
test:=0;
l:=length(x);
for i:=1 to l do
begin
if (x[i]=z[i]) then
begin
a:=ord(x[i]);
a:=a+1;
ch:=chr(a);
y[i]:=ch;
{writeln(ord(x[i]));
writeln(a);
writeln(ch);}
end
else
begin
        if (x[i]>z[i]) then
        y[i]:=z[i]
        else
        begin
        writeln('-1');
        test:=0;
        end;
        end;

    end;
    if test=1 then
    writeln(y);
end.

var a,b:string;
c:array[1..255]of char;
i:longint;
begin
//(input,'yjzdys.in');reset(input);
//assign(output,'yjzdys.out');rewrite(output);
readln(a);
readln(b);
for i:=1 to length(a) do
  if a[i]<>b[i] then
    c[i]:=b[i]
  else
    c[i]:='z';
for i:=1 to length(a) do
  write(c[i]);
close(input);
close(output);
end.

var x,y:string;
i:longint;
a:array[1..100]of char;
begin
//assign(input,'yjzdys.in');reset(input);
//assign(output,'yjzdys.out');rewrite(output);
readln(x);
readln(y);
if x<y then writeln('-1')
else
  begin
  for i:=1 to length(y) do
    if x[i]<>y[i] then  a[i]:=y[i]
    else
      begin
      if y[i]<>'z' then a[i]:=succ(y[i])
      else a[i]:=pred(y[i]);
      end;
  for i:=1 to length(y) do write(a[i]);
  end;
close(input);close(output);
end.

var
  a,b,i,n,k,j,m,p:longint;
  t,s,x:string;
  was:array[1..111111]of boolean;
begin
  readln(s);
  readln(t);

  for i:=1 to length(s) do
  begin
    if ((s[i]=t[i]) and (s[i]='z')) or (s[i]<t[i]) then begin writeln(-1);halt;end;
    if (s[i]=t[i]) then x:=x+chr(ord(s[i])+1) else
    if t[i]>s[i] then x:=x+s[i] else x:=x+t[i];
  end;

  writeln(x);
end.

uses math;
const
	fi = '';
	fo = '';
	maxn = 100001;
var x,y,z:string; i,j,n:longint;
	f1,f2:text;
begin
	assign(f1,fi); reset(f1);
	assign(f2,fo); rewrite(f2);
	readln(f1,x);
	readln(f1,y);
	n:=length(x);
	for i:=1 to n do
	begin
		if x[i]=y[i] then z:=z+'z'
		else z:=z+y[i];
	end;
	writeln(f2,z);
	close(f1); close(f2);
end.

var
x,y,z:string;
a:char;
i,j,k:longint;
begin
readln(x);
readln(y);
z:='';
for i:=1 to length(x) do begin
 if (y[i]<x[i]) then begin
  z:= z + y[i];
  end
 else if (y[i]>x[i]) then begin
  writeln('-1');
  exit;
 end
 else if (y[i]=x[i]) then begin
  z:= z + chr(ord(y[i])+1);
  end;
end;

write(z);
writeln;
end.

var
 x,y,z :string;
 i : longint;

begin
	readln(x);
	readln(y);
	z:='';
	for i:= 1 to length(x) do begin
		z:=z+' ';
		if(x[i]<y[i])then begin
			writeln(-1);
			exit;
		end
		else if(x[i]>y[i])then begin
			z[i]:=y[i];
		end
		else begin
			z[i]:=chr(ord(x[i])+1);
		end;
	end;
	writeln(z);
end.

var
 x,y,z :string;
 i : longint;

begin
	readln(x);
	readln(y);
	z:='';
	for i:= 1 to length(x) do begin
		z:=z+' ';
		if(x[i]<y[i])then begin
			writeln(-1);
			exit;
		end
		else if(x[i]>y[i])then begin
			z[i]:=y[i];
		end
		else begin
			z[i]:=chr(ord(x[i])+1);
		end;
		if(z[i]<'a')or(z[i]>'z')then begin
			writeln(-1);
			exit;
		end;
	end;
	writeln(z);
end.

var x,z,y:string;
a,b,c,i:integer;
begin

  readln(x);
  readln(z);
  y:='';
  for i:=1 to length(x) do begin
    a:=ord(x[i]); b:=ord(z[i]);
    if a=b then c:=a+1;
    if a>b then c:=b;
    if a<b then c:=-1;
    if (c<ord('a'))or(c>ord('z')) then begin
      y:='-1';
      break;
      end else y:=y+chr(c);

  end;
  writeln(y);

end.

const inp='key.inp'; out='key.out';

var   x,y,res:ansistring;

procedure main; var i:longint; begin
    //assign(input,inp);assign(output,out);reset(input);rewrite(output);
    readln(x); readln(y);
    i:=1;
    while i<=length(x) do begin
        if x[i]<>y[i] then begin
            writeln('-1'); halt;
        end else inc(i,2);
    end;
    i:=1; res:='';
    while i<=length(x) do begin
        if i mod 2 <> 0 then res:=res+'y'
        else res:=res+y[i];
        inc(i);
    end;
    writeln(res);
end;

begin
    main;
end.

const
fi='';
fo='';
var
x,y:string;
//free:array[1..100] of boolean;
procedure enter;
var f:text;
i:longint;
begin
    assign(f,fi);
    reset(f);
    readln(f,x);
    readln(f,y);
    close(f);
end;
function min(a,b:char):char;
begin
    if a>b then min:=b else min:=a;
end;
procedure solve;
var f:text;
z:string;
kq:char;
k,i:longint;
begin
    assign(f,fo);
    rewrite(f);
    z:='';
    k:=length(x);
    for i:=1 to k do
     begin
         if x[i]<y[i] then
          begin
              write(f,'-1');
              close(f);
              exit;
          end;
         kq:=min(x[i],y[i]);
         if kq=x[i] then kq:=chr(ord(x[i])+1);
         z:=z+kq;
     end;
     write(f,z);
     close(f);
end;
begin
    enter;
    solve;
end.

var s1,s2,a:string; n,i:longint;  check:boolean;
begin
	//assign(input,'c2.inp'); reset(input);
	//assign(output,'c2.out'); rewrite(output);
	readln(s1);
	readln(s2);
	n:=length(s1);
	for i:=1 to n do
	begin
		if s1[i]=s2[i] then a:=a+chr(ord(s1[i])+1)
		else
			if s1[i]>s2[i] then a:=a+s2[i]
			else a:=a+chr(123);
	end;
	check:=false;
	for i:=1 to n do
		if (ord(a[i])<97) or (ord(a[i])>122) then check:=true;
	if check then write(-1) else write(a);
end.

var s1,s2,a:string; n,i:longint;  check:boolean;
begin
	//assign(input,'c2.inp'); reset(input);
	//assign(output,'c2.out'); rewrite(output);
	readln(s1);
	readln(s2);
	n:=length(s1);
	for i:=1 to n do
	begin
		if ord(s1[i])=ord(s2[i]) then a:=a+chr(ord(s1[i])+1)
		else
			if ord(s1[i])>ord(s2[i]) then a:=a+s2[i]
			else a:=a+chr(123);
	end;
	check:=false;
	for i:=1 to n do
		if (ord(a[i])>122) then check:=true;
	if check then write(-1) else write(a);
end.

var s1,s2,a:string; n,i:longint;  check:boolean;
begin
	//assign(input,'c2.inp'); reset(input);
	//assign(output,'c2.out'); rewrite(output);
	readln(s1);
	readln(s2);
	n:=length(s1);
	for i:=1 to n do
	begin
		if ord(s1[i])=ord(s2[i]) then a:=a+chr(ord(s1[i])+1)
		else
			if ord(s1[i])>ord(s2[i]) then a:=a+s2[i]
			else a:=a+chr(123);
	end;
	check:=false;
	for i:=1 to n do
		if (ord(a[i])>122) then check:=true;
        if s2=a then check:=true;
	if check then write(-1) else write(a);
end.

var
x,z,y:string;
i,n,k:longint;
check:boolean;
begin
readln(x);
readln(y);
n:=1;

check:=false;
for i:=1 to length(x) do begin
  if (x[2*n-1] <> y[2*n-1]) then check:=true;
  if check then break;
   if ((2*i) <=length(x)) and ((2*i-1) <= length(x)) then
      z:=z+x[2*i-1]+y[2*i];
   if (2*i <= length(x)) and ( (2*i-1) > length(x)) then
      z:=z+y[2*i];
   if (2*i > length(x)) and ( (2*i-1) <=length(x)) then
      z:=z+x[2*i-1];
end;
if check then writeln(-1) else writeln(z);
end.


Kavi has $$$2n$$$ points lying on the $$$OX$$$ axis, $$$i$$$-th of which is located at $$$x = i$$$.Kavi considers all ways to split these $$$2n$$$ points into $$$n$$$ pairs. Among those, he is interested in good pairings, which are defined as follows:Consider $$$n$$$ segments with ends at the points in correspondent pairs. The pairing is called good, if for every $$$2$$$ different segments $$$A$$$ and $$$B$$$ among those, at least one of the following holds:  One of the segments $$$A$$$ and $$$B$$$ lies completely inside the other.  $$$A$$$ and $$$B$$$ have the same length. Consider the following example:  $$$A$$$ is a good pairing since the red segment lies completely inside the blue segment.$$$B$$$ is a good pairing since the red and the blue segment have the same length.$$$C$$$ is not a good pairing since none of the red or blue segments lies inside the other, neither do they have the same size.Kavi is interested in the number of good pairings, so he wants you to find it for him. As the result can be large, find this number modulo $$$998244353$$$.Two pairings are called different, if some two points are in one pair in some pairing and in different pairs in another.

The single line of the input contains a single integer $$$n$$$ $$$(1\le n \le 10^6)$$$.

Print the number of good pairings modulo $$$998244353$$$.

NoteThe good pairings for the second example are:   In the third example, the good pairings are:

   const eps=1e-14;
   besk=4000000000000000000; label 55,5,4,1,3,2,44,22;
   type
   mas=array[-20000..1704060+1] of int64;
   integer=longint;   zap=record  p1,p2,p3:int64; end;
   zap1=^zap;   extended=double;
   var  razm,poss,mm,tip,ppos1,oldtt,ps,pos1,pos2,pred,color,buk,cur,init,res,oldpos,i1,j1,mask,stepp,n2,i,j,k,l,step,k1,mesto:longint;
   sss:array[-1..1000] of string;
   ss4,oldss,smin,ss3,ss,ss1,ss2:string;
   newaans,aans:zap;
   otr1,otr0,d0,d1,d2,vx,vy,ddist,tttt:extended;
   pqqq:zap;
   gam,al0,otal,al1,al2,acc, disk,prop,bet,al:extended; fl1,fl2,fl:boolean;
   dr3,dr1,dr2,pt,ott1,ott2:zap;
   pos,time,ost,zz,x:array[-1000..4100000] of int64;
   stroka,sss1,sss2:array[-10..1200000] of char;
   v3,v1,v2,pointx,pointy,vel,tt0,radius,ote,ddl,dl1,dl2:extended;
   dd1,ddpos:array[-2..14,-200..65400] of int64;
   ver:array[-1..2000] of extended;
   kolpotom,pospotom,zx,zy,z,kol,xxx,yyy,invfact,y,ansx,ansy,ugol,xx,yy:array[-1000..4100000] of int64;
   mright,pol,dx,dy:array[-100..1850000] of int64;
   norm,il,jl,ig,jg,iw,jw,ib,jb,ie,je,ott,posx,posy,p,mnog,ii,jj,ttt,delta,tt1,tt2,sum,left,right,koll,newt,osn,oldot,num,oldt,ll,rr,znmax,aa,ot,t11,t01,t10,t00,opld,nap,t4,kk,dl,iii,jjj,aaa,bbb,ccc,bb,p0,t,xmax,xmin,ymax,ymin,newpos,newdl,len,pp3,ans1,ans2,modul,t0,t1,t2,dloch,koldel,mmax,stepen,pq,pp1,pp2,period, dolg,ot1,ot2,oldgr,predsum,pmin,tmin,kool,number,imin,qq,n,m,numpos,down,imax,t3,qq1,qq2,q1,q2,w,p3,p4,pmax,pmax2,p1,p2,hh,pos0,pp,maxot,tmax,nn,n1,q:int64; flag1:boolean;
   b1,a1,b,c,a,zzz,fact,stan,a2,invx,invy,place,str,b2,z1,sum1,sum0,d:mas; flag2,flag:boolean;  pl:longint;
   kkol,i2,j2,ans,tt,sdvig,start,finish,izb, oldmax,newmax,posmax,zapas,razn,oldll,oldrr,ppp,minx,miny,maxx,maxy,kolplus,kolminus,razr,jmax,gr,grr,ener,dob,cc,ugg,r,ug:int64;
   prost,zzan,zann:array[-10..2001001] of boolean;
   newzan,zan:array[-1000000..4000000] of boolean;
   zanx,marked:array[-1000000..4100000] of boolean;
   dmin,dd,ddnew,dleft,dnomer:array[-10..1600,-10..1500] of extended;
   ochh,newochh:array[0..4000000] of longint;
   first,last,kolnenul,next1,next0,prev1,prev0,newoch,och,lx,a3,b3,predok:array[-20000..4500000] of int64;
   ddsum,ddd:array[-400..265200,-1..10] of int64;
   sumgor,pole,newpole:array[-100..2300,-100..2300] of char;
   newpolest,polest:array[-100..2300,-100..2300] of int64;
   polest1:array[-1..11,-10..230,-10..230] of int64;

   ssan,ssans,bufer:array[-1000..1000000] of char;
   cosa,sina,cosb,sinb,rx,ry,px,py,h1,h2,h,l1,l2,otmax,v:int64;
   obmen,ch:char;
   mmat:array[0..200001,0..9,0..9] of int64;
   flagg,fflag,ok,flagg1:boolean;
   koled,oldx,oldy,numx,numy,xleft,xright,s,newplace,newstr,next,prev,aold:array[-1000..4200002] of int64;

   function srav(i,j:longint):boolean; label 44;
   begin
      if (a[i]<a[j]) then begin srav:=true; goto 44;  end;
      if a[i]>a[j] then begin  srav:=false; goto 44;   end;
      if a[i]=a[j] then if a1[i]<a1[j] then srav:=true else srav:=false;
      if (a[i]=a[j])and(a1[i]=a1[j]) then  if a2[i]<a2[j] then srav:=true else srav:=false;
       44:
   end;

  procedure sl (k,l,m:integer);
  begin
    i:=l;j:=m; flag:=true; step:=0;while flag do begin
    if (srav(i,j)) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];b3[l+step]:=a3[i];end;
    inc(step);inc(i);
    end;
    if (not srav(i,j)) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j];b3[l+step]:=a3[j];end;
    inc(step);inc(j);end;
    if  ((i>=l+k) or (j>=m+k)) then flag:=false;
    end;
    if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];b2[l+step]:=a2[j]; b3[l+step]:=a3[j];
    inc(step);inc(j);until (j>=m+k);
    if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];b2[l+step]:=a2[i];  b3[l+step]:=a3[i];inc(step);inc(i);until (i>=l+k);
  end;

  procedure sort(var c:mas);
  begin
  k:=1; repeat
  l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
  for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i];a2[i]:=b2[i];a3[i]:=b3[i]; end;
  until (k>=n);
  end;

   function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
   function max (a,b:int64):int64; begin max:=b;if a>b then max:=a;  end;
   function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
    tt:zap; tt1:zap1;  fl:boolean;
       begin
           fl:=false;
           if a<b then begin r:=a;a:=b;b:=r; fl:=true; end;
           x2:=1;x1:=0;y2:=0;y1:=1;
           while b>0 do
           begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
           a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;
           end;
          if not fl then begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt; end else
          begin d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=y;tt.p3:=x; tt1:=@tt; end;
          evkl:=tt1;
       end;
      function phi(a,b:double):double; label 222;var p:double;
        begin
           if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
           if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
           if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
           if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
           if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
           222: phi:=p;
        end;

          function nod(a,b:int64):int64; var p,t:int64;
             begin
             a:=abs(a); b:=abs(b);
             if (a>0)and(b>0) then
             begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
             p:=a;
             end else if a=0 then p:=b else p:=a;
             nod:=p;
          end;

         function arccos(tt:extended):extended;
             begin
               if abs(tt)>1-1e-13 then
               if tt>0 then  arccos:=0 else arccos:=pi;
               if tt=0 then arccos:=pi/2 else
               if abs(tt)<=1-1e-13 then if tt>=0 then arccos:=arctan(sqrt(1-tt*tt)/tt)
                else arccos:=pi+arctan(sqrt(1-tt*tt)/tt);
             end;

        function degg(a,k,modul:int64):int64; var p:int64;    label 4;
              begin
               if k<=0 then degg:=1
                else if odd(k) then degg:=(degg(a,k-1,modul)*a) mod modul  else
                begin  p:=degg(a,k div 2,modul);  degg:=(p*p) mod modul;    end;
              end;

function zaprmax(left,right:longint):int64;
  begin
   if left>=right then zaprmax:=y[left] else
    begin
     if not odd(left) and odd(right) then zaprmax:=zaprmax(left shr 1,right shr 1) else
      begin
       if odd(left) then zaprmax:=max(zaprmax(left+1,right),y[left]);
       if not odd(right) then zaprmax:=max(zaprmax(left,right-1),y[right]);
      end;
    end;
  end;

    procedure udal(ii:longint);
    begin  next[prev[ii]]:=next[ii];prev[next[ii]]:=prev[ii];  end;

     function pprost(pp:int64):boolean;
       var i,j,t:longint; tt:extended; fl:boolean;
     begin
        tt:=pp;
        tt:=sqrt(tt);
        fl:=true;
        for i:=2 to round(tt) do if pp mod i=0 then  fl:=false;
        pprost:=fl;
     end;

    function gl(c:char):boolean;
       begin
       if (c='a')or (c='o')or(c='e')or(c='i')or(c='u') then gl:=true else gl:=false;
       end;
{        function slog(d1,d2:zap):zap1;
        var t,tt,p,q:int64; ans:zap;
     begin
        p:=d1.x*d2.y+d1.y*d2.x;
        q:=d1.y*d2.y;
        t:=nod(p,q);
        p:=p div t; q:=q div t;
        ans.x:=p mod modul;ans.y:=q mod modul;
        slog:=@ans;
     end;

    function umn(d1,d2:zap):zap1;
     var t,tt,p,q:int64; ans:zap;
     begin
      p:=d1.x*d2.x;
      q:=d1.y*d2.y;
      t:=nod(p,q);
      p:=p div t; q:=q div t;
      ans.x:=p mod modul;ans.y:=q mod modul;
      umn:=@ans;
     end;

      function sravfr(d1,d2:zap):boolean;
        begin
         if  d1.x*d2.y<d2.x*d1.y then sravfr:=true else sravfr:=false;
        end;
          }
    function bincoef(ii,jj:longint):int64;
        var t1,t2,t3,p1,p2,p3,ot:int64;
     begin
         if ii>=jj then
         begin
           p1:=fact[ii];
           p2:=fact[jj];
           p3:=fact[ii-jj];
           t2:=degg(p2,modul-2,modul);
           t3:=degg(p3,modul-2,modul);
           ot:=((p1*t2) mod modul*t3) mod modul;
           bincoef:=ot;
         end  else bincoef:=0;
      end;

        function bincoef1(ii,jj:longint):int64;
         var t1,t2,t3,p1,p2,p3,ot:int64;
   begin
       if ii>=jj then
       begin
       p1:=fact[ii];
       p2:=invfact[jj];
       p3:=invfact[ii-jj];
       ot:=((p1*p2) mod modul*p3) mod modul;
        bincoef1:=ot;
        end  else bincoef1:=0;
   end;

        procedure pech;
      var j,i:longint;
        begin
           for i:=1 to p do begin for j:=1 to p do if zan[i] then write('*') else write('.'); writeln;  end;
           writeln;
           {writeln('ot= ',ot); }
        end;

begin

   {  assign (input,'D:\Projects\input.txt');reset(input);
     assign (output,'D:\Projects\output.txt'); rewrite(output);
    }
     gr:=1000500; modul:=998244353;
     for step:=1 to gr do
       begin
         t:=gr div step;
         for i:=1 to t do inc(x[i*step]);

       end;

    d[1]:=1; pp:=1;  sum:=1;
    for i:=2 to gr do
      begin
          d[i]:=(sum+x[i]) mod modul;
          sum:=(sum+d[i]) mod modul;

      end;

  {  for i:=1 to 200 do writeln(i,' = ',d[i]);
   }
    read(p);
    writeln(d[p]);
    goto 1;

   {  dd[0,0]:=1; gr:=350;
    for i:=0 to gr do for j:=0 to gr do
      for k:=1 to 6 do begin dd[i+1,j+k]:=dd[i+1,j+k]+dd[i,j]/6;   end;

     for i:=0 to 20 do begin write('shag= ',i:2,' '); for j:=0 to 30 do write(dd[i,j]:0:6,' '); writeln;     end;

     writeln;
     for i:=0 to gr do for j:=0 to gr do ver[i]:=ver[i]+dd[j,i];

     for i:=1 to 200 do writeln(i:3,' ',ver[i]:0:10,' ',ver[i]-ver[i-1]:0:7);
    }

   1:  close (output);

end.