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

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

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

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

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

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

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

c.y = h
c.o = h
c.w = e
c.u = j
c.x = j
c.s = f
h.o = f
m.p = e
m.y = e
m.o = c
m.z = b
b.z = f
f.w = n
f.p = n
j.r = h
j.o = f
j.w = c
e.p = m
e.y = m
e.o = c
e.z = b
d.z = f
n.z = f
assert c.y.o.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.w: C = None
        self.u: F = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

c.y = h
c.o = h
c.w = e
c.u = j
c.x = j
c.s = f
h.o = f
m.p = e
m.y = e
m.o = c
m.z = b
b.z = f
f.w = n
f.p = n
j.r = h
j.o = f
j.w = c
e.p = m
e.y = m
e.o = c
e.z = b
d.z = f
n.z = f
assert c.y.o.w.z.txt == "f"