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

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

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

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

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

f = A("f")
m = B("m")
c = C("c")
d = D("d")
b = E("b")

f.p = b
f.s = b
f.t = b
f.y = m
f.o = d
m.u = c
m.p = c
c.u = b
c.o = f
c.p = m
c.w = m
d.u = c
d.o = c
d.v = b
d.x = m
b.o = f
b.s = d
assert f.y.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.t: E = None
        self.y: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

f = A("f")
m = B("m")
c = C("c")
d = D("d")
b = E("b")

f.p = b
f.s = b
f.t = b
f.y = m
f.o = d
m.u = c
m.p = c
c.u = b
c.o = f
c.p = m
c.w = m
d.u = c
d.o = c
d.v = b
d.x = m
b.o = f
b.s = d
assert f.y.u.w.txt == "m"