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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: D = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

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

f.p = e
f.o = h
f.w = d
f.t = d
e.o = j
e.s = m
e.t = f
j.u = h
m.w = e
m.z = e
k.o = j
k.q = j
k.r = e
k.w = e
k.v = m
k.u = m
h.t = e
h.r = m
h.w = m
h.z = f
d.o = j
d.q = j
d.r = e
d.w = e
d.v = m
d.u = m
assert k.w.s.z.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: F = None
        self.w: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: D = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

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

f.p = e
f.o = h
f.w = d
f.t = d
e.o = j
e.s = m
e.t = f
j.u = h
m.w = e
m.z = e
k.o = j
k.q = j
k.r = e
k.w = e
k.v = m
k.u = m
h.t = e
h.r = m
h.w = m
h.z = f
d.o = j
d.q = j
d.r = e
d.w = e
d.v = m
d.u = m
assert k.w.s.z.s.z.txt == "e"