Karlsson has visited Lillebror again. They found a box of chocolates and a big whipped cream cake at Lillebror's place. Karlsson immediately suggested to divide the sweets fairly between Lillebror and himself. Specifically, to play together a game he has just invented with the chocolates. The winner will get the cake as a reward.The box of chocolates has the form of a hexagon. It contains 19 cells for the chocolates, some of which contain a chocolate. The players move in turns. During one move it is allowed to eat one or several chocolates that lay in the neighboring cells on one line, parallel to one of the box's sides. The picture below shows the examples of allowed moves and of an unacceptable one. The player who cannot make a move loses. Karlsson makes the first move as he is Lillebror's guest and not vice versa. The players play optimally. Determine who will get the cake.

The input data contains 5 lines, containing 19 words consisting of one symbol. The word "O" means that the cell contains a chocolate and a "." stands for an empty cell. It is guaranteed that the box contains at least one chocolate. See the examples for better understanding.

If Karlsson gets the cake, print "Karlsson" (without the quotes), otherwise print "Lillebror" (yet again without the quotes).

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils;
Var
   a:Array[1..5] of Integer=(3,4,5,4,3);
   a1:Array[1..5,1..5] of Integer=((0,3,7,0,0),(1,4,8,12,0),(2,5,9,13,16),(6,10,14,17,0),(11,15,18,0,0));
   a2:Array[1..5,1..5] of Integer=((2,6,11,0,0),(1,5,10,15,0),(0,4,9,14,18),(3,8,13,17,0),(7,12,16,0,0));
   a3:Array[1..5,1..5] of Integer=((0,1,2,0,0),(3,4,5,6,0),(7,8,9,10,11),(12,13,14,15,0),(16,17,18,0,0));
   g,p:Array[0..2000000] of Integer;
   t:Array[0..20] of Integer;
   s:String;
   i,j,r,l:Integer;
Function Solve(r:Integer):Integer;
Var
   i,i1,i2,w:Integer;
Begin
   If g[r]<>-1 Then Begin
      Solve:=g[r];
      Exit;
   End;
   For i:=1 To 5 Do Begin
      For i1:=1 To a[i] Do Begin
         w:=r;
         For i2:=i1 To a[i] Do Begin
            If w or t[a1[i,i2]]<>w Then Break;
            w:=w-t[a1[i,i2]];
            Solve(w);
         End;
      End;
   End;
   For i:=1 To 5 Do Begin
      For i1:=1 To a[i] Do Begin
         w:=r;
         For i2:=i1 To a[i] Do Begin
            If w or t[a2[i,i2]]<>w Then Break;
            w:=w-t[a2[i,i2]];
            Solve(w);
         End;
      End;
   End;
   For i:=1 To 5 Do Begin
      For i1:=1 To a[i] Do Begin
         w:=r;
         For i2:=i1 To a[i] Do Begin
            If w or t[a3[i,i2]]<>w Then Break;
            w:=w-t[a3[i,i2]];
            Solve(w);
         End;
      End;
   End;
   For i:=1 To 5 Do Begin
      For i1:=1 To a[i] Do Begin
         w:=r;
         For i2:=i1 To a[i] Do Begin
            If w or t[a1[i,i2]]<>w Then Break;
            w:=w-t[a1[i,i2]];
            p[g[w]]:=r;
         End;
      End;
   End;
   For i:=1 To 5 Do Begin
      For i1:=1 To a[i] Do Begin
         w:=r;
         For i2:=i1 To a[i] Do Begin
            If w or t[a2[i,i2]]<>w Then Break;
            w:=w-t[a2[i,i2]];
            p[g[w]]:=r;
         End;
      End;
   End;
   For i:=1 To 5 Do Begin
      For i1:=1 To a[i] Do Begin
         w:=r;
         For i2:=i1 To a[i] Do Begin
            If w or t[a3[i,i2]]<>w Then Break;
            w:=w-t[a3[i,i2]];
            p[g[w]]:=r;
         End;
      End;
   End;
   For i:=0 To 1000 Do
      If p[i]<>r Then Begin
         g[r]:=i;
         Break;
      End;
   Solve:=g[r];
End;
Begin
   t[0]:=1;
   For i:=1 To 20 Do t[i]:=2*t[i-1];
   r:=0;
   l:=-1;
   For i:=1 To 5 Do Begin
      ReadLn(s);
      For j:=1 To length(s) Do Begin
         If s[j]='.' Then l:=l+1;
         If s[j]='O' Then Begin
            l:=l+1;
            r:=r+t[l];
         End;
      End;
   End;
   g[0]:=0;
   For i:=1 To t[20] Do g[i]:=-1;
   If Solve(r)<>0 Then Write('Karlsson')
                  Else Write('Lillebror');
End.


Professor Phunsuk Wangdu has performed some experiments on rays. The setup for n rays is as follows.There is a rectangular box having exactly n holes on the opposite faces. All rays enter from the holes of the first side and exit from the holes of the other side of the box. Exactly one ray can enter or exit from each hole. The holes are in a straight line. Professor Wangdu is showing his experiment to his students. He shows that there are cases, when all the rays are intersected by every other ray. A curious student asked the professor: "Sir, there are some groups of rays such that all rays in that group intersect every other ray in that group. Can we determine the number of rays in the largest of such groups?".Professor Wangdu now is in trouble and knowing your intellect he asks you to help him.

The first line contains n (1≤n≤10^6), the number of rays. The second line contains n distinct integers. The i-th integer xi (1≤xi≤n) shows that the xi-th ray enters from the i-th hole. Similarly, third line contains n distinct integers. The i-th integer yi (1≤yi≤n) shows that the yi-th ray exits from the i-th hole. All rays are numbered from 1 to n.

Output contains the only integer which is the number of rays in the largest group of rays all of which intersect each other.

For the first test case, the figure is shown above. The output of the first test case is 3, since the rays number 1, 4 and 3 are the ones which are intersected by each other one i.e. 1 is intersected by 4 and 3, 3 is intersected by 4 and 1, and 4 is intersected by 1 and 3. Hence every ray in this group is intersected by each other one. There does not exist any group containing more than 3 rays satisfying the above-mentioned constraint.

program Project2;

{$APPTYPE CONSOLE}
label 1;
var a,b,c,n,i,j,t:integer;
    x,y,k: array [0..1000000] of integer;

begin
read(n);
for i:= 1 to n do
 begin
 read(a);
 x[a]:=i;
 end;
for i:= 1 to n do
 begin
 read(a);
 y[i]:=x[a];
 end;
k[0]:=0;
k[1]:=y[1];
 t:=1;
for i:= 2 to n do
 begin
 for j:= t downto 0 do
   if ((k[j]>y[i]) or (j=0)) then
    if ((y[i]>k[j+1]) or (j=t)) then
  begin
  k[j+1]:=y[i];
  if j=t then t:=t+1;
  goto 1;
  end;
  1:
 end;
 c:=0;
write(t);
read(i);
end.


There are n knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood.Merlin, the wizard predicted to King Arthur that the next month will turn out to be particularly fortunate if the regular polygon can be found. On all vertices of the polygon knights in a good mood should be located. Otherwise, the next month will bring misfortunes.A convex polygon is regular if all its sides have same length and all his angles are equal. In this problem we consider only regular polygons with at least 3 vertices, i. e. only nondegenerated.On a picture below some examples of such polygons are present. Green points mean knights in a good mood. Red points mean ones in a bad mood. King Arthur knows the knights' moods. Help him find out if the next month will be fortunate or not.

The first line contains number n, which is the number of knights at the round table (3≤n≤10^5). The second line contains space-separated moods of all the n knights in the order of passing them around the table. "1" means that the knight is in a good mood an "0" means that he is in a bad mood.

Print "YES" without the quotes if the following month will turn out to be lucky. Otherwise, print "NO".

{$R+ Q+ I+}
{$APPTYPE CONSOLE}
uses
  SysUtils;
function min(x,y : integer) : integer;
begin
    if x>=y then min := y
    else min := x;
end;
var
   n,i,k,j: integer;
   f,t : boolean;
   a : array [1..100000] of integer;
   c : array [0..1] of integer;
begin
     read(n);
     for i := 1 to n do begin
         read(a[i]);
         inc(c[a[i]]);
     end;
     if c[1] = n then begin
        write('YES');
        halt;
     end;
     for i := 1 to n div 3 - 1 do begin
         if n mod (i+1) <> 0 then continue;
         f := false;
         for j := 1 to i+1 do begin
             k := j;
             t := false;
             while k <= n do begin
                   if a[k] = 0 then begin
                      t := true;
                      break;
                   end;
                   k := k + i + 1;
             end;
             if t = false then begin
                write('YES');
                f := true;
                break;
             end;
         end;
         if f = true then break;
     end;
     if f = false then write('NO');
end.


They've screwed something up yet again... In one nuclear reactor of a research station an uncontrolled reaction is in progress and explosion which will destroy the whole station will happen soon.The station is represented by a square n×n divided into 1×1 blocks. Each block is either a reactor or a laboratory. There can be several reactors and exactly one of them will explode soon. The reactors can be considered impassable blocks, but one can move through laboratories. Between any two laboratories, which are in adjacent blocks, there is a corridor. Blocks are considered adjacent if they have a common edge.In each laboratory there is some number of scientists and some number of rescue capsules. Once the scientist climbs into a capsule, he is considered to be saved. Each capsule has room for not more than one scientist.The reactor, which is about to explode, is damaged and a toxic coolant trickles from it into the neighboring blocks. The block, which contains the reactor, is considered infected. Every minute the coolant spreads over the laboratories through corridors. If at some moment one of the blocks is infected, then the next minute all the neighboring laboratories also become infected. Once a lab is infected, all the scientists there that are not in rescue capsules die. The coolant does not spread through reactor blocks.There are exactly t minutes to the explosion. Any scientist in a minute can move down the corridor to the next lab, if it is not infected. On any corridor an unlimited number of scientists can simultaneously move in both directions. It is believed that the scientists inside a lab moves without consuming time. Moreover, any scientist could get into the rescue capsule instantly. It is also believed that any scientist at any given moment always has the time to perform their actions (move from the given laboratory into the next one, or climb into the rescue capsule) before the laboratory will be infected.Find the maximum number of scientists who will be able to escape.

The first line contains two integers n and t (2≤n≤10, 1≤t≤60). Each of the next n lines contains n characters. These lines describe the scientists' locations. Then exactly one empty line follows. Each of the next n more lines contains n characters. These lines describe the rescue capsules' locations.
In the description of the scientists' and the rescue capsules' locations the character "Y" stands for a properly functioning reactor, "Z" stands for the malfunctioning reactor. The reactors' positions in both descriptions coincide. There is exactly one malfunctioning reactor on the station. The digits "0" - "9" stand for the laboratories. In the description of the scientists' locations those numbers stand for the number of scientists in the corresponding laboratories. In the rescue capsules' descriptions they stand for the number of such capsules in each laboratory.

Print a single number — the maximum number of scientists who will manage to save themselves.

In the second sample the events could take place as follows:

{$O-}
Uses Math, SysUtils;
type
	int = longint;
	bool = boolean;
const
  inf = maxint;
  ux : array [1..4] of int = (1, 0, -1, 0);
  uy : array [1..4] of int = (0, -1, 0, 1);
var
	mn, res, x, y, len, i, j, ii, jj, k, tt, t, n : int;
	can : array [0..61,0..11,0..11,0..11,0..11] of bool;
	d, a, b : array [0..11,0..11] of int;
	qx, qy, s, q : array [0..301] of int;
	f, p, u, v, next, w : array [0..50001] of int;
  used : array [0..301] of bool;
	was : array [0..11,0..11] of bool;

procedure scanf;
var
	c : char;
begin
	readln(n, t);
	for i := 1 to n do begin
	for j := 1 to n do begin
		read(c);
		a[i][j] := ord(c)-ord('0');
		if (c = 'Y') then a[i][j] := -1 else
		if (c = 'Z') then begin
			a[i][j] := -1;
			qx[1] := i;
			qy[1] := j;
		end;
	end;
		readln;
	end;
  readln;
	for i := 1 to n do begin
	for j := 1 to n do begin
		read(c);
		b[i][j] := ord(c)-ord('0');
		if (c in['Y','Z']) then b[i][j] := -1;
	end;
		readln;
	end;
end;
procedure bfs;
begin
	was[qx[1]][qy[1]] := true;
  for i := 1 to n do
  for j := 1 to n do
    d[i][j] := inf;
  d[qx[1]][qy[1]] := 0;
	i := 1; j := 1;
	while (i <= j) do begin
		for k := 1 to 4 do begin
			x := qx[i] + ux[k];
			y := qy[i] + uy[k];
			if (not was[x][y]) and (a[x][y] <> -1) and (1 <= x) and (x <= n) and (1 <= y) and (y <= n) then begin
				inc(j);
				qx[j] := x;
				qy[j] := y;
				was[x][y] := true;
				d[x][y] := d[qx[i]][qy[i]] + 1;
			end;
		end;
		inc(i);
	end;
end;
procedure precalc;
begin
	for i := 1 to n do
	for j := 1 to n do
    if (a[i][j] <> -1) then
  		can[0][i][j][i][j] := true;
	for tt := 1 to t do
	for i := 1 to n do
	for j := 1 to n do begin
		if (a[i][j] = -1) then continue;
		for ii := 1 to n do
		for jj := 1 to n do begin
    if (tt > d[ii][jj]) or (a[ii][jj] = -1) then continue;
		for k := 1 to 4 do begin
			x := ii + ux[k];
			y := jj + uy[k];
			if (tt-1 < d[x][y]) and (1 <= x) and (x <= n) and (1 <= y) and (y <= n) and (can[tt-1][i][j][x][y]) then begin
				can[tt][i][j][ii][jj] := true;
				break;
			end;
		end;
    end;
	end;
end;
procedure add(x, y, z : int);
begin
	inc(len);
	v[len] := y;
	next[len] := s[x];
	w[len] := z;
	s[x] := len;
end;
procedure findpath(x, y : int);
var
  rev : int;
begin
	while (x <> 0) do begin
		mn := min(mn, w[x]-f[x]);
		x := p[x];
	end;
	while (y <> 0) do begin
		if (y and 1 = 1) then rev := y + 1
		else rev := y - 1;
		f[y] := f[y] + mn;
		f[rev] := f[rev] - mn;
		y := p[y];
	end;
end;
procedure bfsflow;
var
  pos : int;
begin
	i := 1; j := 1;
	fillchar(used, sizeof(used), false);
	q[1] := 0; used[0] := true;
	while (i <= j) do begin
		pos := s[q[i]];
		while (pos <> 0) do begin
			if (not used[v[pos]]) and (w[pos]-f[pos] > 0) then begin
				inc(j);
				q[j] := v[pos];
				used[q[j]] := true;
				u[j] := pos;
				p[pos] := u[i];
				if (q[j] = 2*n*n+1) then begin
					findpath(pos, pos);
					exit;
				end;
			end;
			pos := next[pos];
		end;
		inc(i);
	end;
end;
procedure flow;
begin
	for i := 1 to n do
	for j := 1 to n do begin
    if (a[i][j] > 0) then begin
	  	add(0, (i-1)*n+j, a[i][j]);
  		add((i-1)*n+j, 0, 0);
    end;
    if (b[i][j] > 0) then begin
		  add(n*n+(i-1)*n+j, 2*n*n+1, b[i][j]);
	  	add(2*n*n+1, n*n+i*(n-1)+j, 0);
  	end;
  end;
	for i := 1 to n do
	for j := 1 to n do
	for ii := 1 to n do
	for jj := 1 to n do
	for tt := 0 to t do
		if (can[tt][i][j][ii][jj]) and (b[ii][jj] > 0) and (a[i][j] > 0) then begin
			add((i-1)*n+j, n*n+(ii-1)*n+jj, inf);
			add(n*n+(ii-1)*n+jj, (i-1)*n+j, 0);
      break;
		end;
	res := 0;
	while (true) do begin
		mn := inf;
		bfsflow;
		if (mn = inf) then begin
			write(res);
			halt;
		end;
		res := res + mn;
	end;
end;
begin
//	reset(input, 'a.in'); rewrite(output, 'a.out');
	scanf;
	bfs;
	precalc;
	flow;
end.


For each positive integer n consider the integer ψ(n) which is obtained from n by replacing every digit a in the decimal notation of n with the digit (9-a). We say that ψ(n) is the reflection of n. For example, reflection of 192 equals 807. Note that leading zeros (if any) should be omitted. So reflection of 9 equals 0, reflection of 91 equals 8.Let us call the weight of the number the product of the number and its reflection. Thus, the weight of the number 10 is equal to 10·89=890.Your task is to find the maximum weight of the numbers in the given range [l,r] (boundaries are included).

Input contains two space-separated integers l and r (1≤l≤r≤10^9) — bounds of the range.

Output should contain single integer number: maximum value of the product n·ψ(n), where l≤n≤r.
Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preferred to use cout (also you may use %I64d).

In the third sample weight of 8 equals 8·1=8, weight of 9 equals 9·0=0, weight of 10 equals 890.
Thus, maximum value of the product is equal to 890.

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils;
Var
   l,r,t,g,i,k:Int64;
Function Heg(n:Int64):Int64;
Var
   r,t,k:Int64;
Begin
   r:=0;
   t:=n;
   k:=1;
   While t>0 Do Begin
      r:=r+(9-t mod 10)*k;
      t:=t div 10;
      k:=k*10;
   End;
   Heg:=n*r;
End;
Begin
   Read(l,r);
   t:=r;
   g:=0;
   While t>0 Do Begin
      g:=g+1;
      t:=t div 10;
   End;
   k:=5;
   i:=1;
   While i<=g-1 Do Begin
      k:=k*10;
      i:=i+1;
   End;
   If (k>=l) and (k<=r) Then Write(Heg(k))
   Else Begin
      If Heg(l)>Heg(r) Then Write(Heg(l))
                       Else Write(Heg(r));
   End;
End.


In one very old text file there was written Great Wisdom. This Wisdom was so Great that nobody could decipher it, even Phong — the oldest among the inhabitants of Mainframe. But still he managed to get some information from there. For example, he managed to learn that User launches games for pleasure — and then terrible Game Cubes fall down on the city, bringing death to those modules, who cannot win the game...For sure, as guard Bob appeared in Mainframe many modules stopped fearing Game Cubes. Because Bob (as he is alive yet) has never been defeated by User, and he always meddles with Game Cubes, because he is programmed to this.However, unpleasant situations can happen, when a Game Cube falls down on Lost Angles. Because there lives a nasty virus — Hexadecimal, who is... mmm... very strange. And she likes to play very much. So, willy-nilly, Bob has to play with her first, and then with User.This time Hexadecimal invented the following entertainment: Bob has to leap over binary search trees with n nodes. We should remind you that a binary search tree is a binary tree, each node has a distinct key, for each node the following is true: the left sub-tree of a node contains only nodes with keys less than the node's key, the right sub-tree of a node contains only nodes with keys greater than the node's key. All the keys are different positive integer numbers from 1 to n. Each node of such a tree can have up to two children, or have no children at all (in the case when a node is a leaf).In Hexadecimal's game all the trees are different, but the height of each is not lower than h. In this problem «height» stands for the maximum amount of nodes on the way from the root to the remotest leaf, the root node and the leaf itself included. When Bob leaps over a tree, it disappears. Bob gets the access to a Cube, when there are no trees left. He knows how many trees he will have to leap over in the worst case. And you?

The input data contains two space-separated positive integer numbers n and h (n≤35, h≤n).

Output one number — the answer to the problem. It is guaranteed that it does not exceed 9·10^18.

{$R+Q+,I+}
{$apptype console}
Uses SysUtils,math;
Var
   dp:Array[0..50,0..50] of Int64;
   n,h,i,j:Integer;
   ans:Int64;
Function Solve(n,h:Integer):Int64;
Var v,h1,h2,k1,k2:Integer;
Begin
   If dp[n,h]<>-1 Then Begin
      Solve:=dp[n,h];
      Exit;
   End;
   If n=1 Then Begin
      If h=1 Then dp[n,h]:=1
             Else dp[n,h]:=0;
      Solve:=dp[n,h];
      Exit;
   End;
   If h=0 Then Begin
      dp[n,h]:=0;
      Solve:=dp[n,h];
      Exit;
   End;
   dp[n,h]:=0;
   For v:=1 To n Do Begin
      k1:=v-1;
      k2:=n-v;
      If v=1 Then Begin
         dp[n,h]:=dp[n,h]+Solve(n-1,h-1);
         Continue;
      End;
      If v=n Then Begin
         dp[n,h]:=dp[n,h]+Solve(n-1,h-1);
         Continue;
      End;
      For h1:=0 To min(k1,h-2) Do dp[n,h]:=dp[n,h]+Solve(k1,h1)*Solve(k2,h-1);
      For h2:=0 To min(k2,h-2) Do dp[n,h]:=dp[n,h]+Solve(k1,h-1)*Solve(k2,h2);
      dp[n,h]:=dp[n,h]+Solve(k1,h-1)*Solve(k2,h-1);
   End;
   Solve:=dp[n,h];
End;
Begin
   Read(n,h);
   For i:=0 To 50 Do
      For j:=0 To 50 Do dp[i,j]:=-1;
   ans:=0;
   For i:=h To n Do ans:=ans+Solve(n,i);
   Write(ans);
End.


Everyone knows that long ago on the territory of present-day Berland there lived Bindian tribes. Their capital was surrounded by n hills, forming a circle. On each hill there was a watchman, who watched the neighbourhood day and night.In case of any danger the watchman could make a fire on the hill. One watchman could see the signal of another watchman, if on the circle arc connecting the two hills there was no hill higher than any of the two. As for any two hills there are two different circle arcs connecting them, the signal was seen if the above mentioned condition was satisfied on at least one of the arcs. For example, for any two neighbouring watchmen it is true that the signal of one will be seen by the other.An important characteristics of this watch system was the amount of pairs of watchmen able to see each other's signals. You are to find this amount by the given heights of the hills.

The first line of the input data contains an integer number n (3≤n≤10^6), n — the amount of hills around the capital. The second line contains n numbers — heights of the hills in clockwise order. All height numbers are integer and lie between 1 and 10^9.

get_nums = lambda : [int(w) for w in input().split()]

N = int(input())
nums = get_nums()
idx = nums.index(max(nums))
nums = nums[idx:] + nums[:idx]

# nums.append(nums[0])
# left = [0] * len(N)
stk = []
result = 0
for i,n in enumerate(nums):
    if not stk or n < stk[-1][0]:
        stk.append([n, 1])
    elif n == stk[-1][0]:
        stk[-1][1] += 1
    else:
        while stk and stk[-1][0] < n:
            result += stk[-1][1] * (stk[-1][1] - 1) // 2 + stk[-1][1] * 2
            stk.pop()
        if n == stk[-1][0]:
            stk[-1][1] += 1
        else:
            stk.append([n, 1])

# if len(stk) > 1:
#     result -= stk[-1][1]

while len(stk) > 1:
    result += stk[-1][1] * 2 + stk[-1][1] * (stk[-1][1] - 1) // 2
    if len(stk) == 2 and stk[0][1] == 1:
        result -= stk[-1][1]
    stk.pop()
if stk:
    result += stk[0][1] * (stk[0][1] - 1) //2
print(result)