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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.s: D = None
        self.t: F = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: B = None
        self.txt = txt

h = A("h")
a = B("a")
b = C("b")
e = D("e")
d = E("d")
m = F("m")
l = B("l")
n = D("n")

h.t = d
h.q = l
a.w = e
a.s = e
a.v = m
a.t = m
a.p = m
a.x = n
b.o = h
b.x = m
e.q = l
e.s = l
e.o = b
e.z = d
d.x = a
d.u = b
d.r = b
m.q = n
m.u = a
l.w = e
l.s = e
l.v = m
l.t = m
l.p = m
l.x = n
n.q = l
n.s = l
n.o = b
n.z = d
assert b.x.q.o.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.s: D = None
        self.t: F = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: B = None
        self.txt = txt

h = A("h")
a = B("a")
b = C("b")
e = D("e")
d = E("d")
m = F("m")
l = B("l")
n = D("n")

h.t = d
h.q = l
a.w = e
a.s = e
a.v = m
a.t = m
a.p = m
a.x = n
b.o = h
b.x = m
e.q = l
e.s = l
e.o = b
e.z = d
d.x = a
d.u = b
d.r = b
m.q = n
m.u = a
l.w = e
l.s = e
l.v = m
l.t = m
l.p = m
l.x = n
n.q = l
n.s = l
n.o = b
n.z = d
assert b.x.q.o.o.t.txt == "d"