class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: G = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.w: G = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.z: G = None
        self.r: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.s: F = None
        self.q: F = None
        self.o: D = None
        self.txt = txt

l = A("l")
h = B("h")
n = C("n")
c = D("c")
j = E("j")
k = F("k")
g = G("g")
b = F("b")
f = G("f")
i = D("i")

l.u = n
l.q = f
l.o = h
h.r = n
n.s = h
n.x = f
n.p = g
c.y = l
c.p = l
c.w = f
c.q = i
j.o = b
j.v = b
j.q = f
k.x = h
k.t = h
k.o = i
k.z = g
k.r = n
g.r = h
g.p = i
g.s = b
g.q = b
g.o = c
b.x = h
b.t = h
b.o = c
b.z = f
b.r = n
f.r = h
f.p = c
f.o = c
f.s = b
f.q = b
i.y = l
i.p = l
i.w = f
i.q = c
assert k.z.q.r.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: G = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.w: G = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.z: G = None
        self.r: C = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.s: F = None
        self.q: F = None
        self.o: D = None
        self.txt = txt

l = A("l")
h = B("h")
n = C("n")
c = D("c")
j = E("j")
k = F("k")
g = G("g")
b = F("b")
f = G("f")
i = D("i")

l.u = n
l.q = f
l.o = h
h.r = n
n.s = h
n.x = f
n.p = g
c.y = l
c.p = l
c.w = f
c.q = i
j.o = b
j.v = b
j.q = f
k.x = h
k.t = h
k.o = i
k.z = g
k.r = n
g.r = h
g.p = i
g.s = b
g.q = b
g.o = c
b.x = h
b.t = h
b.o = c
b.z = f
b.r = n
f.r = h
f.p = c
f.o = c
f.s = b
f.q = b
i.y = l
i.p = l
i.w = f
i.q = c
assert k.z.q.r.s.r.txt == "n"