class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.z: B = None
        self.u: F = None
        self.q: B = None
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.w: C = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.w: C = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

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