class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.r: C = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.t: C = None
        self.p: H = None
        self.u: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: E = None
        self.s: A = None
        self.r: E = None
        self.z: G = None
        self.q: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: B = None
        self.r: H = None
        self.u: F = None
        self.v: A = None
        self.w: F = None
        self.o: H = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.txt = txt

b = A("b")
k = B("k")
n = C("n")
f = D("f")
e = E("e")
c = F("c")
l = G("l")
h = H("h")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.t: C = None
        self.p: H = None
        self.u: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: E = None
        self.s: A = None
        self.r: E = None
        self.z: G = None
        self.q: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: B = None
        self.r: H = None
        self.u: F = None
        self.v: A = None
        self.w: F = None
        self.o: H = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.txt = txt

b = A("b")
k = B("k")
n = C("n")
f = D("f")
e = E("e")
c = F("c")
l = G("l")
h = H("h")

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