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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

h = A("h")
i = B("i")
n = C("n")
d = D("d")
e = E("e")
j = F("j")
c = C("c")
f = E("f")
b = C("b")
m = D("m")

h.o = j
h.z = f
i.q = m
i.s = m
i.u = f
i.w = j
i.t = e
n.u = e
d.z = m
e.o = j
e.z = j
e.v = b
e.x = f
j.z = e
c.u = e
f.o = j
f.z = j
f.v = c
f.x = e
b.u = f
m.z = d
assert j.z.x.o.z.o.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

h = A("h")
i = B("i")
n = C("n")
d = D("d")
e = E("e")
j = F("j")
c = C("c")
f = E("f")
b = C("b")
m = D("m")

h.o = j
h.z = f
i.q = m
i.s = m
i.u = f
i.w = j
i.t = e
n.u = e
d.z = m
e.o = j
e.z = j
e.v = b
e.x = f
j.z = e
c.u = e
f.o = j
f.z = j
f.v = c
f.x = e
b.u = f
m.z = d
assert j.z.x.o.z.o.z.z.z.txt == "e"