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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.t: E = None
        self.q: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.q: B = None
        self.y: D = None
        self.p: C = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

l = A("l")
i = B("i")
f = C("f")
h = D("h")
k = E("k")
g = F("g")
d = G("d")
j = H("j")
b = C("b")
e = C("e")

l.u = k
l.t = j
i.p = h
f.v = k
f.t = k
f.u = d
f.q = h
f.o = i
h.z = l
k.z = l
k.w = g
k.u = g
k.q = i
k.y = h
k.p = e
g.w = d
g.r = f
d.q = f
j.t = g
b.v = k
b.t = k
b.u = d
b.q = h
b.o = i
e.v = k
e.t = k
e.u = d
e.q = h
e.o = i
assert j.t.w.q.u.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.t: E = None
        self.q: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: F = None
        self.q: B = None
        self.y: D = None
        self.p: C = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

l = A("l")
i = B("i")
f = C("f")
h = D("h")
k = E("k")
g = F("g")
d = G("d")
j = H("j")
b = C("b")
e = C("e")

l.u = k
l.t = j
i.p = h
f.v = k
f.t = k
f.u = d
f.q = h
f.o = i
h.z = l
k.z = l
k.w = g
k.u = g
k.q = i
k.y = h
k.p = e
g.w = d
g.r = f
d.q = f
j.t = g
b.v = k
b.t = k
b.u = d
b.q = h
b.o = i
e.v = k
e.t = k
e.u = d
e.q = h
e.o = i
assert j.t.w.q.u.q.q.txt == "h"