class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

j = A("j")
h = B("h")
i = C("i")
m = D("m")
d = E("d")
k = F("k")
e = E("e")

j.w = i
j.v = d
j.z = m
j.t = h
h.o = m
h.p = e
i.p = j
m.v = j
m.q = k
d.t = k
d.z = m
d.x = e
d.u = h
d.w = i
d.y = j
k.o = h
k.p = i
e.t = k
e.z = m
e.x = d
e.u = h
e.w = i
e.y = j
assert d.w.p.v.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

j = A("j")
h = B("h")
i = C("i")
m = D("m")
d = E("d")
k = F("k")
e = E("e")

j.w = i
j.v = d
j.z = m
j.t = h
h.o = m
h.p = e
i.p = j
m.v = j
m.q = k
d.t = k
d.z = m
d.x = e
d.u = h
d.w = i
d.y = j
k.o = h
k.p = i
e.t = k
e.z = m
e.x = d
e.u = h
e.w = i
e.y = j
assert d.w.p.v.x.u.txt == "h"